/* ==========================================================================
   ОГЛАВЛЕНИЕ
   1. Шрифты и Глобальные настройки
   2. Контейнер и Карточка
   3. Заголовок и Анимации
   4. Flash-сообщения
   5. Форма и Поля ввода
   6. Кнопка отправки
   7. Ссылки и Футер карточки
   8. Адаптивность (Media Queries)
   ========================================================================== */

/* ==========================================================================
   1. ШРИФТЫ И ГЛОБАЛЬНЫЕ НАСТРОЙКИ
   ========================================================================== */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 400;
  src: url('/static/fonts/Montserrat-VariableFont_wght.ttf') format('ttf');
  font-display: swap;
}

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh; /* Изменено с height для безопасности на мобильных */
    overflow-x: hidden; /* Предотвращает горизонтальный скролл, но оставляет вертикальный */
    font-family: 'Montserrat', sans-serif;
}

/* ==========================================================================
   2. КОНТЕЙНЕР И КАРТОЧКА
   ========================================================================== */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    animation: fadeIn 0.6s ease;
}

.auth-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card); /* Было: rgba(18, 18, 32, 0.95) */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color); /* Было: rgba(255, 255, 255, 0.08) */
    border-radius: 24px;
    padding: 40px 36px;
    box-shadow: var(--shadow-card); /* Было: 0 20px 60px rgba(0, 0, 0, 0.5), ... */
    transition: all 0.3s ease;
}

/* ==========================================================================
   3. ЗАГОЛОВОК И АНИМАЦИИ
   ========================================================================== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes btnGlow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-title {
    font-family: 'Rajdhani', sans-serif;
    font-size: clamp(28px, 5vw, 40px);
    font-weight: 700;
    margin-bottom: 8px;
    background: var(--gradient-primary); /* Было: linear-gradient(...) */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-secondary); /* Было: rgba(255, 255, 255, 0.6) */
    margin: 0;
    transition: color 0.3s ease;
}

/* ==========================================================================
   4. FLASH-СООБЩЕНИЯ
   ========================================================================== */
.flash {
    padding: 12px 16px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border: 1px solid transparent;
    animation: slideDown 0.3s ease;
}

.flash.error { background: rgba(255, 68, 102, 0.15); color: #ff6680; border-color: rgba(255, 68, 102, 0.3); }
.flash.success { background: rgba(0, 255, 200, 0.15); color: #66ffcc; border-color: rgba(0, 255, 200, 0.3); }
.flash.info { background: rgba(0, 200, 255, 0.15); color: #66ddff; border-color: rgba(0, 200, 255, 0.3); }

/* ==========================================================================
   5. ФОРМА И ПОЛЯ ВВОДА
   ========================================================================== */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary); /* Было: rgba(255, 255, 255, 0.75) */
    display: flex;
    align-items: center;
    gap: 6px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-input); /* Было: rgba(255, 255, 255, 0.04) */
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    font-size: 15px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input::placeholder {
    color: var(--text-muted); /* Было: rgba(255, 255, 255, 0.35) */
    transition: color 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--border-focus); /* Было: rgba(255, 0, 255, 0.6) */
    background: var(--bg-input-focus); /* Было: rgba(255, 0, 255, 0.05) */
    box-shadow: 0 0 0 4px var(--accent-glow); /* Было: rgba(255, 0, 255, 0.1) */
}

.form-input.error {
    border-color: #ff4466 !important;
    background: rgba(255, 68, 102, 0.08);
    box-shadow: 0 0 0 4px rgba(255, 68, 102, 0.1);
}

/* Обёртка для поля с кнопкой показа пароля */
.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper .form-input {
    padding-right: 48px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

/* Объединили hover и active для экономии места */
.toggle-password:hover,
.toggle-password.active {
    background: var(--bg-hover); /* Было: rgba(255, 0, 255, 0.15) */
    border-color: var(--border-hover); /* Было: rgba(255, 0, 255, 0.4) */
}

.eye-icon {
    font-size: 16px;
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.toggle-password:hover .eye-icon,
.toggle-password.active .eye-icon {
    color: var(--text-primary);
}

/* ==========================================================================
   6. КНОПКА ОТПРАВКИ
   ========================================================================== */
.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 32px;
    background: linear-gradient(135deg, #ff00ff, #7b00ff, #00ffff);
    background-size: 200% 200%;
    animation: btnGlow 4s ease infinite;
    border: none;
    border-radius: 50px;
    color: #ffffff;
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    box-shadow: var(--shadow-glow);
    transition: all 0.3s ease;
    margin-top: 8px;
}

.submit-btn:hover {
    box-shadow: 0 0 50px rgba(255, 0, 255, 0.8), 0 0 80px rgba(123, 0, 255, 0.5);
    transform: translateY(-3px) scale(1.02);
}

.submit-btn:active {
    transform: translateY(0) scale(0.98);
}

.btn-arrow {
    font-size: 20px;
    transition: transform 0.3s ease;
}

.submit-btn:hover .btn-arrow {
    transform: translateX(4px);
}

/* ==========================================================================
   7. ССЫЛКИ И ФУТЕР КАРТОЧКИ
   ========================================================================== */
.auth-links {
    text-align: center;
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
    transition: border-color 0.3s ease;
}

.auth-links p {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.auth-link {
    display: inline-block;
    color: var(--accent-cyan); /* Было: #00ffff */
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    padding: 6px 16px;
    border-radius: 50px;
}

.auth-link:hover {
    color: var(--accent-pink); /* Было: #ff66ff */
    background: var(--bg-hover);
    text-shadow: 0 0 10px var(--accent-glow);
}

/* ==========================================================================
   8. АДАПТИВНОСТЬ (Media Queries)
   ========================================================================== */
@media (max-width: 768px) {
    .auth-page {
        padding: 24px 16px;
        align-items: flex-start;
    }

    .auth-card {
        padding: 28px 24px;
        border-radius: 20px;
    }

    .form-input {
        padding: 12px 14px;
        font-size: 14px;
    }

    .submit-btn {
        padding: 14px 28px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 24px 20px;
    }

    .auth-title {
        font-size: 26px;
    }

    .form-label {
        font-size: 12px;
    }

    .toggle-password {
        width: 32px;
        height: 32px;
    }
}