/* 
 * Login Page Styles - Wizard Analytics
 * Адаптивный дизайн в стиле лендинга
 * Дата: 13 ноября 2025
 */

/* === ПЕРЕМЕННЫЕ === */
:root {
    /* Цвета из лендинга */
    --primary-color: #6366f1;      /* Индиго */
    --primary-hover: #4f46e5;
    --secondary-color: #8b5cf6;    /* Фиолетовый */
    --accent-color: #ec4899;       /* Розовый */
    
    /* Нейтральные цвета */
    --bg-dark: #0f172a;            /* Тёмно-синий */
    --bg-card: rgba(255, 255, 255, 0.95);
    --bg-overlay: rgba(15, 23, 42, 0.7);
    
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-white: #ffffff;
    
    /* Telegram цвет */
    --telegram-color: #0088cc;
    --telegram-hover: #0077b3;
    
    /* Yandex цвет */
    --yandex-color: #fc3f1d;
    --yandex-hover: #e63600;
    
    /* Тени */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Радиусы */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    
    /* Переходы */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === БАЗОВЫЕ СТИЛИ === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    overflow-x: hidden;
}

/* === ФОН === */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
    
    /* Фоновое изображение */
    background-image: url('/static/images/login-bg.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    
    /* Overlay для читаемости */
    &::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-overlay);
        backdrop-filter: blur(2px);
    }
}

/* Fallback если картинки нет */
.background-overlay:not([style*="background-image"]) {
    background: linear-gradient(135deg, 
        var(--primary-color) 0%, 
        var(--secondary-color) 50%, 
        var(--accent-color) 100%);
}

/* === КОНТЕЙНЕР === */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === ХЕДЕР === */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: slideDown 0.6s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.logo-image {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
}

.logo-text {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--text-white);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tagline {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    font-weight: 400;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* === КАРТОЧКА АВТОРИЗАЦИИ === */
.auth-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(10px);
    animation: scaleIn 0.6s ease-out 0.2s both;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 1.5rem;
}

/* === МЕТОДЫ АВТОРИЗАЦИИ === */
.auth-method {
    margin-bottom: 1rem;
}

.telegram-login-wrapper {
    display: flex;
    justify-content: center;
    min-height: 48px;
}

/* Стилизация Telegram виджета */
.telegram-login-wrapper iframe {
    border-radius: var(--radius-md) !important;
    overflow: hidden;
}

/* === КНОПКИ === */
.auth-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.auth-button:active {
    transform: translateY(0);
}

.auth-icon {
    width: 20px;
    height: 20px;
}

/* Telegram кнопка (Deep Link) */
.telegram-button {
    background: var(--telegram-color);
    color: var(--text-white);
}

.telegram-button:hover {
    background: var(--telegram-hover);
}

/* Yandex кнопка */
.yandex-button {
    background: var(--yandex-color);
    color: var(--text-white);
}

.yandex-button:hover {
    background: var(--yandex-hover);
}

/* Email кнопка (пока отключена) */
.email-button {
    background: var(--text-secondary);
    color: var(--text-white);
    opacity: 0.6;
    cursor: not-allowed;
}

.email-button:hover {
    transform: none;
}

.coming-soon {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Подсказка под кнопкой */
.auth-hint {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    font-style: italic;
}

/* === РАЗДЕЛИТЕЛЬ === */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    gap: 1rem;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(
        to right,
        transparent,
        var(--text-secondary) 50%,
        transparent
    );
}

.divider-text {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* === ИНФОРМАЦИЯ === */
.auth-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--primary-color);
}

.auth-info p {
    font-size: 0.875rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.auth-info strong {
    color: var(--primary-color);
    font-weight: 600;
}

.international-notice {
    margin-top: 1rem;
    text-align: center;
}

.international-notice p {
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* === ФУТЕР === */
.login-footer {
    margin-top: 2rem;
    text-align: center;
    animation: fadeIn 0.6s ease-out 0.4s both;
}

.footer-link {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

.footer-link:hover {
    color: var(--text-white);
    text-decoration: underline;
}

.copyright {
    margin-top: 0.5rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8125rem;
}

/* === АДАПТИВНОСТЬ === */

/* Планшеты */
@media (max-width: 768px) {
    .login-container {
        max-width: 420px;
    }
    
    .auth-card {
        padding: 1.5rem;
    }
    
    .logo-text {
        font-size: 1.5rem;
    }
    
    .auth-title {
        font-size: 1.25rem;
    }
}

/* Мобильные устройства */
@media (max-width: 480px) {
    body {
        padding: 0.75rem;
    }
    
    .login-container {
        max-width: 100%;
    }
    
    .login-header {
        margin-bottom: 1.5rem;
    }
    
    .logo-image {
        width: 40px;
        height: 40px;
    }
    
    .logo-text {
        font-size: 1.25rem;
    }
    
    .tagline {
        font-size: 0.875rem;
    }
    
    .auth-card {
        padding: 1.25rem;
        border-radius: var(--radius-lg);
    }
    
    .auth-title {
        font-size: 1.125rem;
    }
    
    .auth-subtitle {
        font-size: 0.8125rem;
    }
    
    .auth-button {
        padding: 0.75rem 1.25rem;
        font-size: 0.9375rem;
    }
    
    .auth-info {
        padding: 0.875rem;
    }
    
    .divider {
        margin: 1.25rem 0;
    }
}

/* Маленькие мобильные */
@media (max-width: 360px) {
    .auth-card {
        padding: 1rem;
    }
    
    .auth-button {
        padding: 0.625rem 1rem;
        font-size: 0.875rem;
        gap: 0.5rem;
    }
    
    .auth-icon {
        width: 18px;
        height: 18px;
    }
    
    .logo {
        gap: 0.5rem;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-height: 600px) and (orientation: landscape) {
    .login-header {
        margin-bottom: 1rem;
    }
    
    .logo-text {
        font-size: 1.125rem;
    }
    
    .tagline {
        display: none;
    }
    
    .auth-card {
        padding: 1rem;
    }
    
    .login-footer {
        margin-top: 1rem;
    }
}

/* === ТЕМНАЯ ТЕМА (автоматически активна) === */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(30, 41, 59, 0.95);
    }
    
    .auth-title {
        color: var(--text-white);
    }
    
    .auth-subtitle {
        color: rgba(255, 255, 255, 0.7);
    }
    
    .auth-info {
        background: rgba(99, 102, 241, 0.15);
    }
    
    .auth-info p {
        color: rgba(255, 255, 255, 0.9);
    }
}

/* === ACCESSIBILITY === */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Фокус для клавиатурной навигации */
.auth-button:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.footer-link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 2px;
    border-radius: var(--radius-sm);
}

/* === EMAIL AUTH SECTION === */

.email-auth-section {
    width: 100%;
    margin-top: 0;
}

/* Табы (Вход / Регистрация) */
.auth-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: rgba(241, 245, 249, 0.5);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.auth-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.auth-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

/* Формы */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 1rem;
}

.auth-form.active {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 2px solid rgba(226, 232, 240, 0.8);
    border-radius: var(--radius-md);
    font-size: 1rem;
    color: var(--text-primary);
    background: white;
    transition: var(--transition);
    outline: none;
}

.form-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-group input:disabled {
    background: rgba(241, 245, 249, 0.5);
    cursor: not-allowed;
}

/* Подсказка для пароля */
.password-hint {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

/* Password Requirements Indicator */
.password-requirements {
    margin-top: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    transition: var(--transition);
}

.requirement .icon {
    font-size: 0.75rem;
    width: 1rem;
    height: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.requirement .text {
    color: var(--text-secondary);
    line-height: 1.3;
}

/* Невыполненное требование (красный крестик) */
.requirement:not(.met) .icon {
    color: #ef4444;
}

.requirement:not(.met) .text {
    color: var(--text-secondary);
}

/* Выполненное требование (зелёная галочка) */
.requirement.met .icon {
    color: #10b981;
}

.requirement.met .text {
    color: #10b981;
    font-weight: 500;
}

/* Email кнопка */
.email-button {
    background: var(--primary-color);
    color: var(--text-white);
    margin-top: 0.5rem;
    cursor: pointer;
}

.email-button:hover:not(:disabled) {
    background: var(--primary-hover);
}

.email-button:disabled {
    background: rgba(203, 213, 225, 0.5);
    cursor: not-allowed;
    opacity: 0.6;
}

/* Footer форм */
.form-footer {
    text-align: center;
    margin-top: 0.5rem;
}

.forgot-password {
    font-size: 0.875rem;
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.forgot-password:hover {
    text-decoration: underline;
}

.terms-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.terms-text a {
    color: var(--primary-color);
    text-decoration: none;
}

.terms-text a:hover {
    text-decoration: underline;
}

/* === VALIDATION ERRORS === */

.form-group.error input {
    border-color: #ef4444;
}

.form-group .error-message {
    font-size: 0.75rem;
    color: #ef4444;
    margin-top: 0.25rem;
}

.form-group .success-message {
    font-size: 0.75rem;
    color: #10b981;
    margin-top: 0.25rem;
}

/* === ТЕМНАЯ ТЕМА (формы) === */
@media (prefers-color-scheme: dark) {
    .auth-tabs {
        background: rgba(51, 65, 85, 0.5);
    }
    
    .auth-tab {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .auth-tab:hover {
        color: rgba(255, 255, 255, 0.9);
        background: rgba(255, 255, 255, 0.1);
    }
    
    .auth-tab.active {
        background: rgba(99, 102, 241, 0.2);
        color: var(--text-white);
    }
    
    .form-group label {
        color: rgba(255, 255, 255, 0.9);
    }
    
    .form-group input {
        background: rgba(30, 41, 59, 0.5);
        border-color: rgba(71, 85, 105, 0.5);
        color: var(--text-white);
    }
    
    .form-group input:focus {
        border-color: var(--primary-color);
        background: rgba(30, 41, 59, 0.8);
    }
    
    .form-group input::placeholder {
        color: rgba(255, 255, 255, 0.4);
    }
    
    .password-hint {
        color: rgba(255, 255, 255, 0.6);
    }
    
    .terms-text {
        color: rgba(255, 255, 255, 0.7);
    }
}

/* === АДАПТИВНОСТЬ (формы) === */
@media (max-width: 640px) {
    .auth-tab {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .form-group input {
        padding: 0.625rem 0.875rem;
        font-size: 0.9375rem;
    }
}

/* === МОДАЛЬНОЕ ОКНО (Password Reset) === */
.modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    max-width: 480px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.75rem;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    line-height: 1;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
    transform: rotate(90deg);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.modal-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Адаптивность модального окна */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
}

/* === EMAIL VERIFICATION PAGE === */
.verification-loading,
.verification-success,
.verification-error {
    text-align: center;
    padding: 2rem;
}

.spinner {
    width: 80px;
    height: 80px;
    display: block;
    margin: 0 auto 20px;
}

.success-icon,
.error-icon {
    display: block;
    margin: 0 auto;
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* === NOTIFICATION BANNER (для /account) === */
.notification-banner {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
}

.notification-banner.warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-left-color: #f59e0b;
}

.notification-banner.info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    border-left-color: #3b82f6;
}

.notification-banner.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    border-left-color: #10b981;
}

.banner-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.banner-icon {
    font-size: 1.5rem;
    line-height: 1;
}

.banner-text h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.banner-text p {
    margin: 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.banner-actions {
    display: flex;
    gap: 0.75rem;
}

.banner-button {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.banner-button.primary {
    background: #f59e0b;
    color: white;
}

.banner-button.primary:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.banner-button.secondary {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-primary);
}

.banner-button.secondary:hover {
    background: rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .notification-banner {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .banner-actions {
        width: 100%;
    }
    
    .banner-button {
        flex: 1;
    }
}

