/* style.css - Modern Premium Design */

/* 1. БАЗОВЫЕ НАСТРОЙКИ */
@import url('https://fonts.googleapis.com/css2?family=Mountains+of+Christmas:wght@400;700&display=swap');

/* 1. БАЗОВЫЕ НАСТРОЙКИ */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    
    /* ИСПРАВЛЕНИЕ: */
    min-height: 100vh;        /* Минимальная высота - экран, но может расти */
    height: auto;             /* Убираем жесткую высоту */
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* ВАЖНО: Прижимаем всё к ВЕРХУ, а не к центру */
}

body.auth-page {
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Красивый фон для входа */
}

/* 2. АВТОРИЗАЦИЯ (Вход/Регистрация) */
.auth-card {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); /* Мягкая тень */
    width: 100%;
    max-width: 380px;
    text-align: center;
    margin-top: 80px;    /* Отступ от верхнего меню */
    margin-bottom: 40px; /* Отступ снизу (чтобы не прилипало к подвалу) */
}

.auth-card h2 {
    color: #333;
    font-weight: 700;
    margin-bottom: 25px;
}

.auth-link {
    display: block;
    margin-top: 20px;
    font-size: 14px;
    color: #667eea;
    font-weight: 500;
    text-decoration: none;
}

.error-msg {
    color: #d8000c;
    background-color: #ffd2d2;
    font-size: 14px;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
}

/* 3. ЭЛЕМЕНТЫ ФОРМ */
input {
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border: 1px solid #e1e1e1;
    border-radius: 12px; /* Сильное закругление */
    box-sizing: border-box;
    font-size: 15px;
    background: #f9f9f9;
    transition: all 0.2s;
    outline: none;
}

input:focus {
    background: white;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

button.primary-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); /* Градиент */
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    transition: transform 0.1s, box-shadow 0.2s;
    box-shadow: 0 4px 10px rgba(118, 75, 162, 0.3);
}

button.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(118, 75, 162, 0.4);
}

/* 4. ЧАТ (ПРИЛОЖЕНИЕ) */
.app-container {
    width: 100%;
    max-width: 600px;
    background: white;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: 0 0 40px rgba(0,0,0,0.05);
}

/* Шапка чата */
.header {
    background: white;
    color: #333;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f0f0f0;
    z-index: 10;
}

.header-info { display: flex; align-items: center; gap: 12px; }
.avatar-circle { 
    width: 42px; height: 42px; 
    border-radius: 50%; 
    overflow: hidden; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.avatar-circle img { width: 100%; height: 100%; object-fit: cover; }

.header-text h2 { margin: 0; font-size: 17px; font-weight: 700; color: #2d3748; }
.header-text p { margin: 2px 0 0 0; font-size: 13px; color: #48bb78; font-weight: 500; } /* Зеленый "Online" */

.logout-btn { 
    color: #718096; 
    text-decoration: none; 
    font-size: 20px; /* Сделаем иконкой (крестик или выход) */
    font-weight: bold;
    padding: 5px;
}
.logout-btn:hover { color: #e53e3e; }

/* Окно сообщений */
#chat-window {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #ffffff; /* Чистый белый фон */
}

/* Сообщения */
.message-row { display: flex; width: 100%; }
.user-row { justify-content: flex-end; }
.ai-row { justify-content: flex-start; }

.bubble {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.5;
    position: relative;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}

/* Пузырь пользователя (Градиент) */
.user-bubble { 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

/* Пузырь учителя (Серый) */
.ai-bubble { 
    background-color: #f1f3f5;
    color: #2d3748;
    border-bottom-left-radius: 4px;
}

.sender-name { 
    font-size: 11px; 
    font-weight: 700; 
    margin-bottom: 5px; 
    color: #764ba2; /* Цвет имени учителя */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Плеер внутри сообщения */
audio { 
    width: 100%; 
    height: 32px; 
    margin-top: 8px; 
    border-radius: 20px;
    outline: none;
}
/* Делаем плеер белым для пользователя и темнее для учителя, если нужно, но стандартный тоже ок */

/* Индикатор печати */
.typing-indicator { 
    display: none; 
    gap: 4px; 
    padding: 12px 16px; 
    background: #f1f3f5; 
    border-radius: 18px; 
    border-bottom-left-radius: 4px;
    width: fit-content; 
    margin-bottom: 15px; 
    margin-left: 0;
}
.dot { width: 8px; height: 8px; background: #cbd5e0; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out both; }
.dot:nth-child(1) { animation-delay: -0.32s; }
.dot:nth-child(2) { animation-delay: -0.16s; }

/* Зона ввода */
.input-area { 
    background: white; 
    padding: 15px 20px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    border-top: 1px solid #f0f0f0; 
}

.input-area input { 
    margin: 0;
    background: #f7fafc;
    border: 1px solid #edf2f7;
    padding: 12px 20px;
    border-radius: 25px;
}

.send-btn { 
    width: 48px; 
    height: 48px; 
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white; 
    border: none; 
    border-radius: 50%; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 18px; 
    box-shadow: 0 4px 10px rgba(118, 75, 162, 0.3);
    transition: transform 0.1s; 
}
.send-btn:active { transform: scale(0.95); }


/* --- 5. ГЛАВНАЯ СТРАНИЦА (LANDING) --- */
.landing-page {
    flex-direction: column;
    display: block; /* Отменяем flex-center от body */
    background: white;
    height: auto;
}

.landing-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    max-width: 1000px;
    margin: 0 auto;
}

.logo { font-weight: 800; font-size: 20px; color: #333; }
.nav-links a { text-decoration: none; color: #333; margin-left: 20px; font-weight: 500; }
.nav-links a.primary { color: #667eea; }

.hero-section {
    text-align: center;
    padding: 60px 20px;
    background: white; /* Теперь фон идеально белый */
}

.hero-content h1 { font-size: 42px; color: #2d3748; margin-bottom: 20px; line-height: 1.2; }
.hero-content p { font-size: 18px; color: #718096; margin-bottom: 30px; }

.cta-button {
    display: inline-block;
    padding: 15px 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 30px;
    font-weight: bold;
    font-size: 18px;
    box-shadow: 0 4px 15px rgba(118, 75, 162, 0.4);
    transition: transform 0.2s;
}
.cta-button:hover { transform: translateY(-2px); }

.features {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 30px;
    padding: 50px 20px;
    max-width: 1000px;
    margin: 0 auto;
}

.feature-card {
    flex: 1;
    min-width: 250px;
    padding: 30px;
    border-radius: 20px;
    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    text-align: center;
}
.feature-card .icon { font-size: 40px; margin-bottom: 15px; }
.feature-card h3 { margin: 10px 0; color: #2d3748; }
.feature-card p { color: #718096; font-size: 14px; line-height: 1.6; }


/* --- 6. ЛИЧНЫЙ КАБИНЕТ (DASHBOARD) --- */
.dashboard-page {
    background-color: #f7fafc;
    align-items: flex-start; /* Чтобы контент шел сверху */
    padding-top: 40px;
}

.dashboard-container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
}

.dash-header {
        text-align: center;     /* По центру */
        margin-bottom: 35px;    /* Отступ снизу */
        margin-top: 10px;
    }
    
    
.dash-header h2 {
        /* 2. Применяем этот шрифт */
        font-family: 'Mountains of Christmas', cursive;
        font-weight: 700;       /* Делаем чуть жирнее, чтобы читалось хорошо */
        font-size: 34px;        /* Увеличили размер для красоты */
        
        color: black;         /* Светло-серый цвет */
        margin: 0;
        letter-spacing: 1px;    /* Чуть больше воздуха между буквами */
    }
.logout-link { color: #e53e3e; text-decoration: none; font-weight: 500; }

.dash-grid { display: flex; flex-direction: column; gap: 15px; }

.dash-card {
    background: white;
    padding: 20px;
    border-radius: 16px;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: transform 0.2s;
    display: flex;
    align-items: center;
    gap: 15px;
}
.dash-card:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.07); }

.main-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}
.main-card h3 { color: white; margin: 0; }
.main-card p { color: rgba(255,255,255,0.8); margin: 5px 0 0 0; font-size: 13px; }
.main-card .card-icon { font-size: 30px; }
.main-card .arrow { margin-left: auto; font-size: 24px; font-weight: bold; }

.secondary-card h3 { color: #2d3748; margin: 0; font-size: 16px; }
.secondary-card p { color: #718096; margin: 3px 0 0 0; font-size: 13px; }
.secondary-card .card-icon { font-size: 24px; }

/* --- 7. ГЛОБАЛЬНЫЕ HEADER и FOOTER --- */

/* Чтобы подвал всегда был внизу, даже если страница пустая */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1; /* Растягивает контент, прижимая футер вниз */
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрируем содержимое (карточки входа и т.д.) */
}

/* ШАПКА САЙТА */
.site-header {
    background: white;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    
    /* ИСПРАВЛЕНИЕ: Приклеиваем шапку к верху */
    position: sticky; 
    top: 0;
    z-index: 1000; /* Чтобы она была поверх всего */
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-logo {
    font-size: 24px;
    font-weight: 800;
    color: #333;
    text-decoration: none;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent; /* Делаем текст градиентным */
}

.nav-menu a {
    text-decoration: none;
    color: #555;
    font-weight: 500;
    margin-left: 20px;
    font-size: 15px;
    transition: color 0.2s;
}

.nav-menu a:hover { color: #764ba2; }

.nav-btn-small {
    padding: 8px 18px;
    background: #f1f3f5;
    border-radius: 20px;
    color: #333 !important;
}
.nav-btn-small:hover { background: #e2e8f0; }

/* ПОДВАЛ САЙТА */
.site-footer {
    background: white;
    width: 100%;
    border-top: 1px solid #eee;
    padding: 20px 0;
    margin-top: auto; /* Волшебное свойство для прижатия к низу */
    text-align: center;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    color: #888;
    font-size: 13px;
}

/* --- 8. СТРАНИЦА ПОДПИСКИ (PRICING) --- */
.pricing-container {
    padding: 40px 20px;
    max-width: 1100px; /* БЫЛО 900px -> СТАЛО 1100px (чтобы влезло 3 карточки) */
    width: 100%;
    margin: 0 auto;
    text-align: center;
}

.pricing-header h2 { font-size: 32px; margin-bottom: 10px; color: #2d3748; }
.pricing-header p { color: #718096; margin-bottom: 40px; }

.pricing-grid {
    display: flex;
    justify-content: center;
    gap: 30px; /* Чуть больше воздуха между карточками */
    flex-wrap: wrap; /* На телефонах они всё равно перенесутся (это правильно для мобильных) */
    align-items: flex-start; /* Чтобы они ровно стояли по верху */
}

.plan-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    width: 260px; /* Чуть шире */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    position: relative;
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    transition: transform 0.2s;
}
.plan-card:hover { transform: translateY(-5px); }

/* Стиль для выделенной карточки (PRO) */
.plan-card.featured {
    border: 2px solid #667eea;
    transform: scale(1.05);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
    z-index: 2;
}
.plan-card.featured:hover { transform: scale(1.08); }

.badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.plan-card h3 { margin: 10px 0; color: #2d3748; }

.price { font-size: 32px; font-weight: 800; color: #333; margin: 15px 0; }
.price span { font-size: 14px; font-weight: normal; color: #999; }

.features-list {
    list-style: none;
    padding: 0;
    text-align: left;
    margin: 20px 0;
    flex: 1;
}
.features-list li { margin-bottom: 12px; font-size: 14px; color: #555; display: flex; gap: 8px; }

.plan-btn {
    padding: 12px;
    border-radius: 12px;
    font-weight: bold;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.plan-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}
.plan-btn.primary:hover { box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3); }

.plan-btn.outline {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: #718096;
}
.plan-btn.outline:hover { border-color: #667eea; color: #667eea; }


/* Блок с исправлением (Верхний пузырь) */
.correction-box {
    background-color: #fff4e6; /* Мягкий оранжевый фон */
    border: 1px solid #fed7aa;  /* Оранжевая граница */
    border-left: 5px solid #f97316; /* Жирная полоска слева */
    border-radius: 12px 12px 12px 0; /* Закругления как у бабла */
    padding: 12px 16px;
    margin-bottom: 10px; /* Отступ от латышского ответа */
    font-size: 0.95em;
    color: #9a3412;
    line-height: 1.5;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: block; /* Убедимся, что это блок */
    width: fit-content; /* Ширина по контенту */
    max-width: 100%;
}

.correction-title {
    font-weight: 800;
    font-size: 0.85em;
    text-transform: uppercase;
    color: #c2410c;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Основной пузырь (Нижний) */
.ai-bubble {
    /* Ваши текущие стили... */
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 0 12px 12px 12px;
}
/* === СТРАНИЦА ПОЛИТИКИ COOKIE === */

.policy-container {
    background-color: #f9f9f9; /* Слегка серый фон всей секции */
    padding: 60px 20px;
    min-height: 60vh; /* Чтобы страница не была слишком короткой */
}

.policy-content {
    max-width: 800px; /* Ограничиваем ширину текста, так удобнее читать */
    margin: 0 auto;   /* Центрируем блок */
    background: #ffffff;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    font-family: Arial, sans-serif;
    color: #333;
}

.policy-content h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.policy-content .last-updated {
    color: #888;
    font-style: italic;
    margin-bottom: 30px;
    font-size: 14px;
}

.policy-content h2 {
    font-size: 22px;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #444;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.policy-content p {
    line-height: 1.6;
    margin-bottom: 15px;
    color: #555;
}

.policy-content ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.policy-content ul li {
    margin-bottom: 10px;
    line-height: 1.5;
    color: #555;
}

/* Адаптив для телефонов */
@media (max-width: 600px) {
    .policy-content {
        padding: 20px;
    }
    .policy-content h1 {
        font-size: 24px;
    }
}
/* СТИЛИ ДЛЯ ФУТЕРА */
.footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px; /* Расстояние между элементами */
    flex-wrap: wrap; /* Чтобы на телефоне переносилось, если не влезет */
}

.footer-links a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
}

.footer-links a:hover {
    color: #000;
    text-decoration: underline;
}

.separator {
    color: #ccc;
}

/* На мобильных можно скрыть разделители и поставить всё столбиком */
@media (max-width: 600px) {
    .footer-links {
        flex-direction: column;
        gap: 5px;
    }
    .separator {
        display: none;
    }
}