/* public/css/auth.css */

/* Затемнение фона */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    /* Учитывает адресную строку Safari */
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;

    /* Центрирование */
    display: flex;
    align-items: center;
    justify-content: center;

    /* Отступы, чтобы на мобилках не прилипало к краям */
    padding: 20px;
    box-sizing: border-box;
}

/* Белое окно */
.auth-window {
    background: white;
    width: 100%;
    max-width: 420px;
    /* Ширина на ПК */
    border-radius: 12px;
    position: relative;
    padding: 30px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);

    /* === ГЛАВНЫЕ ИСПРАВЛЕНИЯ ДЛЯ IPHONE === */

    /* 1. Максимальная высота, чтобы окно не вылезало за экран */
    max-height: 90vh;
    /* Для старых браузеров */
    max-height: 85dvh;
    /* Для новых мобилок (учитывает челку и бары) */

    /* 2. Включаем скролл ВНУТРИ окна, если контент не влезает */
    overflow-y: auto;

    /* 3. Плавный скролл для iOS */
    -webkit-overflow-scrolling: touch;

    /* 4. Фикс, чтобы контент не наезжал на закругленные края при скролле */
    display: flex;
    flex-direction: column;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Кнопка закрыть (крестик) */
.auth-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.auth-close:hover {
    color: #000;
}

/* Табы (Вход / Регистрация) */
.auth-tabs {
    display: flex;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
}

.auth-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    color: #999;
    padding-bottom: 15px;
}

.auth-tab.active {
    color: #000;
    /* Розетка зеленый: #00a046, но у нас ЧБ стиль */
    border-bottom: 3px solid #000;
}

/* Поля ввода */
.auth-group {
    margin-bottom: 15px;
}

.auth-group label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 5px;
}

.auth-input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    box-sizing: border-box;
    outline: none;
}

.auth-input:focus {
    border-color: #000;
}

/* Кнопка действия */
.auth-btn {
    width: 100%;
    background: #000;
    /* Зеленый розетки: #00a046 */
    color: #fff;
    padding: 14px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 10px;
}

.auth-btn:hover {
    background: #333;
}

/* Ошибки */
.auth-error,
.error-msg {
    color: #d32f2f;
    font-size: 13px;
    margin-top: 5px;
}

.auth-footer {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
}

.auth-footer a {
    text-decoration: none;
}


/* Контейнер для инпута с глазиком */
.password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

/* Кнопка "Глазик" */
.toggle-password {
    position: absolute;
    right: 15px;
    cursor: pointer;
    color: #999;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    height: 100%;
}

.toggle-password:hover {
    color: #333;
}

/* Индикатор силы пароля */
.password-strength {
    font-size: 12px;
    margin-top: 5px;
    height: 5px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
    transition: all 0.3s;
    width: 100%;
    display: none;
    /* Скрыт пока не начнем вводить */
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: width 0.3s, background-color 0.3s;
}

.password-strength-text {
    font-size: 11px;
    margin-top: 3px;
    display: block;
    text-align: right;
    font-weight: bold;
}

/* === ИСПРАВЛЕННЫЕ ЦВЕТА (ВСТАВИТЬ ВМЕСТО СТАРЫХ) === */

/* 1. Стили для ПОЛОСКИ (Меняем только фон) */
.password-strength-bar.strength-weak {
    background-color: #ef4444;
}

/* Красный */
.password-strength-bar.strength-medium {
    background-color: #f59e0b;
}

/* Оранжевый */
.password-strength-bar.strength-strong {
    background-color: #10b981;
}

/* Зеленый */

/* 2. Стили для ТЕКСТА (Меняем только цвет букв, фон прозрачный) */
.password-strength-text.strength-weak {
    color: #ef4444;
    background: none;
}

.password-strength-text.strength-medium {
    color: #f59e0b;
    background: none;
}

.password-strength-text.strength-strong {
    color: #10b981;
    background: none;
}

/* Ошибка валидации (красная рамка) */
.input-error {
    border-color: #ef4444 !important;
}

.input-success {
    border-color: #10b981 !important;
}

/* --- СТИЛИ ДЛЯ ИНПУТА --- */
.iti {
    width: 100%;
    display: block;
    margin-bottom: 5px;
}

.iti__tel-input {
    height: 42px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding-left: 90px !important;
    width: 100% !important;
    font-size: 1rem;
    color: #000;
    background-color: #fff;
}

/* --- ВЫПАДАЮЩИЙ СПИСОК --- */
/* Мы НЕ задаем здесь width и position, это делает JS */
.iti__dropdown-content {
    z-index: 100000 !important; /* Чтобы было поверх модалки */
    
    /* Красота */
    background-color: #ffffff;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2); /* Хорошая тень */
    
    font-family: inherit;
    overflow: hidden;
}

/* Поле поиска */
.iti__search-input {
    width: 100%;
    border: none;
    border-bottom: 1px solid #eee;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    background-color: #f9fafb;
}

/* Список стран */
.iti__country-list {
    max-height: 220px;
    overflow-y: auto;
    border: none !important;
}

/* Пункты */
.iti__country {
    padding: 10px 12px;
    color: #1f2937;
}

/* Подсветка */
.iti__country:hover, .iti__country--highlight {
    background-color: #f3f4f6;
}

.input-error {
    border-color: #ff4d4f !important;
}

/* --- ФИКС ЗУМА НА IPHONE --- */
@media screen and (max-width: 768px) {
    /* Для всех полей ввода ставим 16px, чтобы iOS не приближал */
    input, 
    select, 
    textarea,
    .auth-input, 
    .iti__tel-input,
    .iti__search-input {
        font-size: 16px !important;
    }
}