/* --- General Setup & Variables --- */
:root {
    --primary-purple: #6a44ff; /* Остается как базовый */
    
    /* НОВАЯ ГРАДИЕНТНАЯ ПАЛИТРА */
    --gradient-bg: linear-gradient(135deg, #5f43ff00 0%, #2525510a 100%);
    --surface-color: rgba(38, 30, 78, 0.7); /* Полупрозрачный темно-фиолетовый */
    --surface-border: rgba(189, 169, 255, 0.15);
    --surface-hover: rgba(58, 48, 125, 0.7);

    --accent-pink: #ff6a88;
    --accent-glow: rgba(255, 106, 136, 0.3);

    --text-light: #e6e6fa; /* Лавандовый белый для мягкости */
    --text-muted: rgba(230, 230, 250, 0.6);
    --dark-purple: #231249;
    --light-bg: #f3f2ff;
    --text-dark: #222;         
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    background-color: #ffffff; /* Запасной цвет */
    color: #222;
    transition: background-color 0.3s ease;
}

/* Класс для блокировки скролла при открытом меню */
body.nav-open {
    overflow: hidden;
}

.container {
    width: 90%;
    max-width: 1400px;
    margin: 0 auto;
}

/* --- Animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Применяем анимацию к основным блокам */
.page-title-section, .hero-text, .hero-images, .feature-item {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* --- Buttons --- */
.btn {
    display: inline-block;
    text-decoration: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    text-align: center;
}

.btn-primary {
    background-color: var(--primary-purple);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(106, 68, 255, 0.3);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(106, 68, 255, 0.4);
}
.btn-primary_2 {
    background-color: var(--primary-purple);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(106, 68, 255, 0.3);
}

.btn-primary_2:hover {
    opacity: 0.9;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(106, 68, 255, 0.4);
}
/* --- Header & Mobile Navigation --- */
.site-header {
    background-color: #eceaf8;
    padding: 0px 0;
    position: relative;
    z-index: 1000; /* Ставим хедер выше всего */
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100px;
}

.logo img {
    height: 150px; /* Уменьшил лого для лучшего вида */
    transition: transform 0.3s ease;
}
.logo:hover img {
    transform: scale(1.05);
}

.main-nav {
    position: fixed; /* Делаем меню фиксированным на весь экран */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Анимация появления */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

.main-nav ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.main-nav a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 600;
    font-size: 24px;
    transition: color 0.3s ease, transform 0.3s ease;
}

.main-nav a:hover {
    color: var(--primary-purple);
    transform: scale(1.1);
}

/* Show nav when body has .nav-open class */
.nav-open .main-nav {
    padding-bottom: 300px;
    height: 100vh; /* <-- 100% высоты видимой части экрана (viewport height) */
    opacity: 1;
    visibility: visible;
    transform: translateY(0);

}

.header-cta { display: none; }

.nav-toggle {
    display: block;
    background: transparent;
    border: 0;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    z-index: 1001; /* Выше чем .main-nav */
}

.hamburger {
    display: block;
    position: relative;
    background-color: var(--text-dark);
    height: 3px;
    width: 25px;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}
.hamburger::before, .hamburger::after {
    content: '';
    position: absolute;
    background-color: var(--text-dark);
    height: 3px;
    width: 25px;
    border-radius: 2px;
    left: 0;
    transition: all 0.3s ease-in-out;
}
.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }
.nav-open .hamburger { background: transparent; }
.nav-open .hamburger::before { transform: rotate(45deg) translate(5px, 6px); }
.nav-open .hamburger::after { transform: rotate(-45deg) translate(5px, -6px); }

/* --- Page Title --- */
.page-title-section {
    text-align: center;
    padding-top: 40px;
    padding-bottom: 20px;
}
.page-title-section .subtitle {
    color: #6c757d;
    font-weight: 500;
}
.page-title-section h1 {
    margin-top: 5px;
    font-size: 2.5rem;
}

/* --- Hero Section --- */
.hero-section {
    position: relative;
    padding: 60px 0;
    text-align: center;
    overflow: hidden;
}
.hero-container { display: flex; flex-direction: column; }
.about-box {
    background-color: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 16px;
    padding: 25px 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
    color: #333;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.about-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}
.about-box p { font-size: 1rem; line-height: 1.6; margin: 0; }

.hero-images {
    margin-top: 50px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: center;
}
.hero-images img {
    max-width: 90%;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}
.hero-images img:hover {
    transform: scale(1.03);
}
.img-laptop, .img-tablet, .img-mobile { display: none; }

/* --- Decorative Shapes --- */
.shape { position: absolute; transition: transform 0.4s ease-out; }
.shape-1 { display: block; width: 15px; height: 15px; border: 2px solid var(--primary-purple); border-radius: 50%; top: 15%; left: 5%;}
.shape-4 { display: block; width: 0; height: 0; border-left: 8px solid transparent; border-right: 8px solid transparent; border-bottom: 12px solid var(--primary-purple); top: 10%; right: 8%;}
.shape-2, .shape-3, .shape-5 { display: none; }

/* --- Features Section --- */
.features-section {
    background-color: var(--dark-purple);
    color: var(--text-light);
    padding: 60px 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.04) 1px, transparent 0);
    background-size: 20px 20px;
}
.features-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
    text-align: center;
}
.feature-item {
    padding: 20px;
    border-radius: 12px;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
.feature-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateY(-8px);
}
.feature-item .icon-wrapper { font-size: 28px; color: var(--primary-purple); margin-bottom: 20px; }
.feature-item h3 { font-size: 20px; font-weight: 600; margin-bottom: 10px; }
.feature-item p { color: var(--text-muted); font-size: 15px; }


/* ==================================
   TABLET STYLES (min-width: 768px)
   ================================== */
@media (min-width: 330px) {
    .container { width: 85%; }
    .page-title-section h1 { font-size: 3.5rem; }
    .hero-images { grid-template-columns: repeat(2, 1fr); }
    .img-laptop, .img-tablet, .img-mobile { display: block; }
    .img-desktop { grid-column: 1 / -1; 
    width: 90%;
    }
}

/* ==================================
   DESKTOP STYLES (min-width: 1024px)
   ================================== */
@media (min-width: 1024px) {
    .container { width: 100%; }

    /* --- Desktop Header --- */
    .nav-toggle { display: none; }
    .header-cta { display: inline-block; }
    .main-nav {
        display: flex;
        position: static;
        background: transparent;
        box-shadow: none;
        width: auto;
        height: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        backdrop-filter: none;
    }
    .main-nav ul { flex-direction: row; gap: 40px; }
    .main-nav a { padding: 0; border: 0; font-size: 16px; }
    .main-nav a:hover { color: var(--primary-purple); transform: none; }

    /* --- Desktop Hero --- */
    .hero-section { padding: 80px 0; text-align: left; }
    .hero-container { flex-direction: row; align-items: center; gap: 40px; }
    .hero-text { flex: 1; }
    .page-title-section { text-align: left; padding: 60px 0 0 0; }
    .hero-images { flex: 1.2; position: relative; height: 500px; margin-top: 0; display: block; }
    .hero-images img { position: absolute; max-width: 100%; }
    .img-desktop { width: 80%; top: 0; right: 0; z-index: 2; }
    .img-laptop { width: 65%; top: 220px; left: 0; z-index: 3; }
    .img-tablet { width: 25%; top: 360px; left: 45%; z-index: 4; }
    .img-mobile { width: 15%; top: 360px; left: 75%; z-index: 4; }
    
    /* --- Desktop Features --- */
    .features-container { grid-template-columns: repeat(3, 1fr); gap: 60px; }
    
    /* --- Restore Decorative Shapes --- */
    .shape-2 { display: block; width: 40px; height: 2px; background: var(--primary-purple); position: absolute; top: 16%; left: 9%; transform: rotate(-30deg); }
    .shape-3 { display: block; width: 80px; height: 30px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 80 30'%3E%3Cpath d='M0 10 C 10 0, 20 20, 30 10 S 40 0, 50 10 S 60 20, 70 10 S 80 0, 80 10' stroke='%23333' fill='none' stroke-width='2'/%3E%3Cpath d='M0 15 C 10 5, 20 25, 30 15 S 40 5, 50 15 S 60 25, 70 15 S 80 5, 80 15' stroke='%23333' fill='none' stroke-width='2'/%3E%3Cpath d='M0 20 C 10 10, 20 30, 30 20 S 40 10, 50 20 S 60 30, 70 20 S 80 10, 80 20' stroke='%23333' fill='none' stroke-width='2'/%3E%3C/svg%3E"); background-repeat: no-repeat; position: absolute; bottom: 25%; left: 5%; }
    .shape-5 { display: block; width: 60px; height: 60px; position: absolute; bottom: 20%; right: 5%; background: radial-gradient(circle, rgba(255, 183, 197, 0.4) 0%, rgba(255, 183, 197, 0) 70%), repeating-conic-gradient(var(--primary-purple) 0% 25%, transparent 0% 50%) 50% / 10px 10px; background-blend-mode: multiply; opacity: 0.6; }
}


/* static/css/style.css */

/* --- Teacher Assistant Page --- */
.assistant-container {
    max-width: 920px;
    margin: 40px auto;
    padding: 0 20px;
}

.step-card {
    background-color: #fff;
    border-radius: 16px;
    padding: 30px 40px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9e8f3;
}

/* Анимация появления карточки */
.fade-in {
    animation: fadeInUp 0.7s ease-out forwards;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.step-number {
    background-color: var(--primary-purple);
    color: white;
    font-weight: 700;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.step-header h2 {
    font-size: 24px;
    margin: 30px;
    color: var(--dark-purple);
}

.step-description {
    color: #6c757d;
    margin-bottom: 30px;
}

.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(106, 68, 255, 0.2);
}

.btn-submit {
    width: 100%;
    padding-top: 15px;
    padding-bottom: 15px;
    font-size: 16px;
}

.btn-submit i {
    margin-right: 10px;
}

/* Стили для результатов */
.results-list ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    background-color: #f9f8ff;
    border-radius: 10px;
    margin-bottom: 10px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.topic-item:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: var(--primary-purple);
    background-color: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.07);
    color: var(--primary-purple);
}

.topic-item span {
    flex-grow: 1;
    margin-right: 15px;
}

.topic-item i {
    transition: transform 0.3s ease;
}

.topic-item:hover i {
    transform: translateX(5px);
}

.back-link {
    display: inline-block;
    margin-top: 30px;
    color: var(--primary-purple);
    text-decoration: none;
    font-weight: 600;
}

.back-link:hover {
    text-decoration: underline;
}

.back-link i {
    margin-right: 8px;
}

.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: .25rem;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

/* static/css/style.css */

/* ... (все ваши стили) ... */

/* Когда на форме появляется класс 'is-loading'... */
#dialog-form.is-loading {
    /* ... мы показываем спиннер (если он есть внутри) */
    & .htmx-indicator {
        display: block;
        opacity: 1;
        height: auto;
    }
}

/* Кнопка, по которой кликнули */
.option-button.is-submitting,
.custom-answer-submit.is-submitting {
    background: linear-gradient(135deg, #1fa2ff, #12d8fa) !important; /* Ярко-синий */
    color: white !important;
    border-color: #1fa2ff !important;
    cursor: wait; /* Курсор ожидания */
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(20, 180, 255, 0.3);
}

/* Все остальные, неактивные кнопки */
.option-button.is-disabled,
.custom-answer-submit.is-disabled {
    background: #3a3a5a !important; /* Серый, неактивный цвет */
    color: var(--text-muted) !important;
    cursor: not-allowed;
    opacity: 0.6;
    pointer-events: none; /* Полностью отключаем клики */
}

/* ==================================
   ФИНАЛЬНЫЕ СТИЛИ ДЛЯ АНИМАЦИИ КНОПОК
   ================================== */

/* Когда на форме появляется класс 'is-loading' (добавляется JS)... */
form.is-loading {
    /* ...делаем ее полупрозрачной и некликабельной */
    opacity: 0.6;
    pointer-events: none;
    cursor: wait;
    transition: opacity 0.2s ease-in-out;
}

/* 
   Для кнопки, которая инициировала отправку (JS добавляет класс .is-submitting)...
*/
.btn.is-submitting {
    /* ...меняем ее фон, чтобы показать, что она активна */
    background: linear-gradient(135deg, #1fa2ff, #12d8fa) !important;
    color: white !important;
    border-color: #1fa2ff !important;
}

/* 
   И для иконки ВНУТРИ этой кнопки...
   ИСПОЛЬЗУЕМ ВАШ НАДЕЖНЫЙ СЕЛЕКТОР!
*/
.btn.is-submitting > i {
    /* ...применяем анимацию вращения */
    animation: spin 1s linear infinite;
}

/* 
   Убедимся, что сама анимация @keyframes spin определена где-то в вашем CSS
   (из ваших предыдущих логов она уже есть). Если нет, добавьте:
*/
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}



/* --- Стили для статического списка тем --- */
.topic-item-static {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 20px; background-color: #f9f8ff; border-radius: 10px;
    margin-bottom: 10px; color: var(--text-dark); font-weight: 500;
}
.topic-item-static i { color: var(--primary-purple); }

/* --- Стили для Аккордеона --- */
.accordion { display: flex; flex-direction: column; gap: 10px; }
.accordion-item { border: 1px solid #e9e8f3; border-radius: 10px; overflow: hidden; }
.accordion-header {
    width: 100%;
    background: #f9f8ff;
    border: none;
    padding: 18px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    color: var(--dark-purple);
    font-family: 'Poppins', sans-serif;
}
.accordion-header i { transition: transform 0.3s ease; }
.accordion-header.active i { transform: rotate(180deg); }
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
    background: #fff;
}
.lecture-text { padding: 20px; }
.lecture-text h2 { margin-top: 20px; margin-bottom: 10px; font-size: 20px; }
.lecture-text p { margin-bottom: 15px; }
.lecture-text ul { padding-left: 20px; margin-bottom: 15px; }


.topic-counter {
    width: 100px; /* или сколько нужно */
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
}


.divider { margin: 25px 0; border: 0; border-top: 1px solid #eee; }
.lesson-content-wrapper { padding: 20px; }
.lesson-content-wrapper h4 { font-size: 18px; color: var(--dark-purple); margin-bottom: 10px; }
.instruction { font-style: italic; color: #6c757d; font-size: 15px; margin-bottom: 15px; }
.task-list { margin-left: 20px; }
.task-list li { margin-bottom: 8px; }



.language-select {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    background-color: white;
}
.architect-background {
    position: relative; /* Нужно для позиционирования "светящихся" кругов */
    width: 100%;
    min-height: calc(100vh - 90px); /* 100% высоты экрана минус высота хедера */
    padding: 40px 0;
    display: flex;
    justify-content: center;
    background: var(--gradient-bg); /* Наш основной градиентный фон */
    overflow: hidden; /* Чтобы "светящиеся" круги не вылезали за пределы */
}

/* --- Декоративные "светящиеся" круги --- */
.glow-circle {
    position: absolute;
    border-radius: 50%;
    filter: blur(150px); /* Сильное размытие для эффекта свечения */
    opacity: 0.25; /* Делаем их полупрозрачными */
}
.circle-1 {
    width: 400px;
    height: 400px;
    background: var(--primary-purple);
    top: -150px;
    left: -150px;
}
.circle-2 {
    width: 350px;
    height: 350px;
    background: var(--accent-pink);
    bottom: -100px;
    right: -100px;
}
.circle-3 {
    width: 250px;
    height: 250px;
    background: #44aaff; /* Добавим еще один цвет для разнообразия */
    bottom: 50px;
    left: 100px;
    opacity: 0.15;
}

/* --- Основной контейнер для контента --- */
/* Он нужен, чтобы контент не растягивался на всю ширину */
.architect-background .assistant-container {
    position: relative; /* Чтобы быть поверх "светящихся" кругов */
    z-index: 2;
}

/* --- ИЗМЕНЕННЫЙ СТИЛЬ ДЛЯ ОКНА ЧАТА --- */
/* Теперь он полупрозрачный */
.chat-wrapper {
    max-width: 800px;
    margin: 0 auto;
    /* Полупрозрачный фон с эффектом "матового стекла" */
    background: rgba(28, 25, 56, 0.6); 
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    height: 75vh;
    overflow: hidden;
    border: 1px solid var(--surface-border);
}

/* Все остальные стили для .chat-window, .chat-message, .chat-form, .project-card
   остаются такими же, как в предыдущем ответе. Они будут отлично
   смотреться на новом фоне. */

/* Копируем сюда стили для .project-card, чтобы они тоже работали */
.project-types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
    place-items: center;

}

.project-card {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 600;
    text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
    width: 212px;
}

.project-card:hover {
    transform: translateY(-8px) scale(1.03);
    background: var(--surface-hover);
    border-color: var(--accent-pink);
    box-shadow: 0 0 25px var(--accent-glow);
}

.project-card i {
    font-size: 36px;
    /* Градиентный цвет для иконок */
    background: linear-gradient(45deg, var(--accent-pink), var(--primary-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-fill-color: transparent;
}

/* --- Стили для центрирования последней карточки --- */
.last-row-wrapper {
    /* Растягиваем этот элемент на все колонки грида */
    grid-column: 1 / -1; 
    
    /* Используем flexbox для центрирования содержимого (кнопки) */
    display: flex;
    justify-content: center;
}


/* ==================================
   СТИЛИ ДЛЯ ЗАГРУЗКИ ПРИ ВЫБОРЕ ПРОЕКТА
   ================================== */

/* Когда на всей сетке появляется класс 'is-loading'... */
.project-types-grid.is-loading {
    /* ...делаем все карточки внутри полупрозрачными и некликабельными */
    opacity: 0.7;
    pointer-events: none;
    cursor: wait;
    transition: opacity 0.3s ease;
}

/* Карточка, на которую нажали (получит класс 'is-submitting')... */
.project-card.is-submitting {
    /* ...становится ярче и получает тень */
    transform: translateY(-5px) scale(1.03);
    border-color: var(--accent-pink);
    box-shadow: 0 0 25px var(--accent-glow);
}

/* Иконка внутри нажатой карточки... */
.project-card.is-submitting i {
    /* ...превращается во вращающийся спиннер */
    /* Важно: нам нужно убрать градиент, чтобы анимация была видна */
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    color: var(--accent-pink); /* Задаем цвет напрямую */
    
}

/* Текст внутри нажатой карточки... */
.project-card.is-submitting span {
    /* ...можно немного приглушить */
    opacity: 0.8;
}




/* ==================================
   СТИЛИ ДЛЯ ДИАЛОГА НА "ИММЕРСИВНОМ" ФОНЕ
   ================================== */

/* 
   Это правило применится к ЛЮБОЙ карточке (.step-card) на странице,
   у которой есть наш анимированный фон.
*/
.immersive-background-page .step-card {
    background: rgba(30, 30, 47, 0.65); /* Полупрозрачный фон */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.4);
    
    /* Делаем весь текст внутри карточки светлым */
    color: var(--text-light);
}

/* 
   Нам нужно переопределить некоторые цвета текста внутри карточки,
   чтобы они были контрастными на темном "стеклянном" фоне.
*/
.immersive-background-page .step-card h2 {
    color: var(--text-light);
}

.immersive-background-page .step-card .step-description,
.immersive-background-page .custom-answer-wrapper p {
    color: var(--text-muted);
}

/* --- Стили для финального ТЗ на "стеклянном" фоне --- */
/* Убираем белый фон и темный текст, которые мы делали для светлой темы */
.immersive-background-page .final-spec-content {
    background-color: rgba(15, 12, 41, 0.7); /* Еще темнее для контраста */
    color: #e6e6fa;
    border-color: rgba(255, 255, 255, 0.15);
}

.immersive-background-page .final-spec-content h3 {
    color: #6a8eff;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.immersive-background-page .final-spec-content strong {
    color: #ffffff;
}

/* --- Стили для скроллбара внутри ТЗ --- */
.immersive-background-page .final-spec-content::-webkit-scrollbar-track {
    background: transparent;
}
.immersive-background-page .final-spec-content::-webkit-scrollbar-thumb {
    background-color: var(--accent-pink);
}

/* ==================================
   СТИЛИ ДЛЯ ПОЛЯ ВВОДА СВОЕГО ОТВЕТА
   ================================== */

.custom-answer-wrapper {
    margin-top: 20px;
    border-top: 1px solid var(--surface-border);
    padding-top: 20px;
}
.custom-answer-wrapper p {
    text-align: center;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
}

/* Контейнер для поля ввода и кнопки, используем стили от chat-form */
.custom-answer-wrapper .chat-form {
    display: flex;
    gap: 10px;
}

/* Поле ввода */
.custom-answer-input {
    flex-grow: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    transition: all 0.3s ease;
}
.custom-answer-input::placeholder {
    color: var(--text-muted);
}
.custom-answer-input:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Кнопка отправки */
.custom-answer-submit {
    flex-shrink: 0;
    background: var(--accent-pink);
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}
.custom-answer-submit:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.chat-window {
    flex-grow: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Стилизация скроллбара */
.chat-window::-webkit-scrollbar-thumb {
    background-color: var(--accent-pink);
    border-radius: 10px;
}
.chat-window::-webkit-scrollbar-track {
    background: transparent;
}

.chat-message {
    padding: 15px 20px;
    border-radius: 12px;
    max-width: 80%;
    line-height: 1.6;
    animation: fadeIn 0.5s ease-out;
    border: 1px solid var(--surface-border);
}

.bot-message {
    background: var(--surface-color);
    color: var(--text-light);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.5);
}

.user-message {
    /* Градиент для сообщений пользователя */
    background: linear-gradient(135deg, var(--accent-pink), var(--primary-purple));
    color: white;
    align-self: flex-end;
    border: none;
    border-bottom-right-radius: 4px;

    text-shadow: 0px 1px 3px rgba(0, 0, 0, 0.4);
}

.chat-form {
    display: flex;
    padding: 15px;
    border-top: 1px solid var(--surface-border);
    background: var(--surface-color);
    backdrop-filter: blur(10px);
}

.chat-form textarea {
    flex-grow: 1;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--surface-border);
    border-radius: 8px;
    padding: 10px 15px;
    color: var(--text-light);
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    resize: none;
    height: 50px;
    transition: all 0.3s ease;
}

.chat-form textarea:focus {
    outline: none;
    border-color: var(--accent-pink);
    box-shadow: 0 0 15px var(--accent-glow);
}

.chat-form button {
    background: #aa6aff;
    border: none;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 8px;
    margin-left: 10px;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.chat-form button:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px var(--accent-glow);
}

.last-row-wrapper {
    /* Эта строка заставляет div занять все колонки в ряду */
    grid-column: 1 / -1;

    /* А эти три строки элегантно центрируют его содержимое */
    display: flex;
    justify-content: center;
    gap: 20px; /* Такое же расстояние, как и в основной сетке */
}


/* Стили для диалога с вариантами */
.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
    margin: 30px 0;
}

.option-button {
    background: var(--surface-color);
    border: 1px solid var(--surface-border);
    color: var(--text-light);
    padding: 15px 20px;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    width: 100%;
}
.option-button:hover {
    background: var(--surface-hover);
    border-color: var(--accent-pink);
    transform: translateY(-3px);
}

.custom-answer-wrapper {
    margin-top: 20px;
    border-top: 1px solid var(--surface-border);
    padding-top: 20px;
}
.custom-answer-wrapper p {
    text-align: center;
    margin-bottom: 15px;
    color: rgb(47 47 47 / 60%);
}
.custom-answer-input { flex-grow: 1; }
.custom-answer-submit { flex-shrink: 0; }

/* Стили для финального ТЗ */
.final-spec-content {
    background-color: #16122d;
    color: #e6e6fa;
    padding: 20px;
    border-radius: 8px;
    white-space: pre-wrap; /* Сохраняет переносы строк и пробелы */
    word-wrap: break-word; /* Переносит длинные слова */
    font-family: 'Courier New', Courier, monospace;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--surface-border);
}
.final-actions {
    margin-top: 20px;
    text-align: center;
}

.option-button {
    position: relative; /* Нужно для позиционирования иконки */
}

.tooltip-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 16px;
}
/* --- БАЗОВЫЕ СТИЛИ И СБРОС --- */


/* --- СТИЛИ ДЛЯ СТРАНИЦЫ ЧАТ-БОТА V3 --- */
/* Основной контейнер, который теперь будет занимать всю высоту минус хедер */
.chatbot-main-container {
    display: flex;
    align-items: center; /* Центрируем контент по вертикали */
    flex-grow: 1;
    width: 100%;
    max-width: 1400px; /* Немного увеличим для пространства */
    margin: 0 auto;
    padding: 0 40px;
    height: calc(100vh - 100px); /* Высота экрана минус высота хедера */
    min-height: 600px;
}

.chatbot-column {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Левая колонка (CTA) */
.chatbot-cta-column {
    flex: 1;
    text-align: left; /* Выравниваем текст по левому краю */
    padding-right: 50px; /* Добавляем отступ справа */
}

.cta-content-wrapper {
    max-width: 550px;
}

.cta-content-wrapper h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.cta-content-wrapper .hero-text {
    margin: 20px 0 40px 0;
    font-size: 1.1rem;
    color: #6c757d;
}

.cta-content-wrapper .cta-block {
    display: flex;
    justify-content: flex-start; /* Выравниваем по левому краю */
    align-items: center;
    gap: 40px;
}

.cta-content-wrapper .btn {
    padding: 18px 36px;
    font-size: 1rem;
}

.cta-content-wrapper .qr-code img {
    width: 160px;
    height: 160px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(106, 68, 255, 0.25);
}

.cta-content-wrapper .qr-text,
.cta-content-wrapper .qr-subtext {
    text-align: center; /* Центрируем текст под QR */
}

/* Правая колонка (Features) - теперь это красивая карточка */
.chatbot-features-column {
    flex: 0.8; /* Делаем колонку чуть уже */
    height: fit-content; /* Высота по содержимому */
    background-color: var(--dark-purple, #231249);
    color: var(--text-light, #fff);
    border-radius: 24px; /* Главное закругление! */
    padding: 40px;
    box-shadow: 0 20px 50px rgba(35, 18, 73, 0.3);
}

.features-section-inner {
    width: 100%;
}

.features-section-inner h2 {
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
}

.features-container-compact {
    display: flex;
    flex-direction: column;
    gap: 15px; /* Уменьшим отступ */
}

.features-container-compact .feature-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px;
    background-color: transparent; /* Убираем фон у карточек */
    border: none; /* Убираем рамку */
    border-radius: 12px;
    transition: background-color 0.3s;
}

.features-container-compact .feature-item:hover {
    background-color: rgba(255, 255, 255, 0.07);
}

.features-container-compact .icon-wrapper {
    flex-shrink: 0;
    font-size: 22px;
    width: 45px;
    height: 45px;
    background-color: rgba(106, 68, 255, 0.2);
    color: #c4b0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.features-container-compact h3 {
    margin: 0 0 4px 0;
    font-size: 1rem;
}

.features-container-compact p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted, rgba(255, 255, 255, 0.7));
    line-height: 1.4;
}


/* Адаптивность */
@media (max-width: 1024px) {
    .chatbot-main-container {
        flex-direction: column-reverse;
        height: auto;
        padding: 20px;
    }
    .chatbot-cta-column {
        text-align: center;
        padding: 40px 0;
    }
    .cta-content-wrapper .cta-block {
        justify-content: center;
    }
    .cta-content-wrapper h1 { font-size: 2.5rem; }
    }



    /* Стили для финального отрендеренного ТЗ */
.final-spec-content {
    background-color: rgba(22, 18, 45, 0.7); /* Немного светлее основного фона */
    color: var(--text-light);
    padding: 20px 25px;
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    max-height: 50vh;
    overflow-y: auto;
    text-align: left;
    line-height: 1.7;
}

.final-spec-content h3 {
    font-size: 20px;
    color: var(--accent-pink);
    border-bottom: 1px solid var(--surface-border);
    padding-bottom: 8px;
    margin-top: 25px;
    margin-bottom: 15px;
}
.final-spec-content h3:first-child {
    margin-top: 0;
}

.final-spec-content h4 {
    font-size: 16px;
    color: var(--text-light);
    margin-top: 20px;
    margin-bottom: 10px;
}

.final-spec-content p {
    margin-bottom: 10px;
}

.final-spec-content strong {
    color: #f0f0f0;
    font-weight: 600;
}

.final-spec-content ul {
    list-style-type: disc;
    padding-left: 20px;
}
.final-spec-content li {
    margin-bottom: 8px;
}

.final-actions {
    margin-top: 20px;
    text-align: center;
}


.final-spec-content {
    /* --- ОСНОВНЫЕ СТИЛИ КОНТЕЙНЕРА --- */
    background-color: #ffffff; /* Светлый фон, как у документа */
    color: #333333; /* Темный, читаемый текст */
    padding: 30px 40px; /* Увеличим внутренние отступы */
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    max-height: 60vh; /* Увеличим максимальную высоту */
    overflow-y: auto;
    text-align: left;
    line-height: 1.7;
    font-family: 'Poppins', sans-serif; /* Используем основной шрифт сайта */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Стилизация скроллбара для светлой темы */
.final-spec-content::-webkit-scrollbar {
    width: 8px;
}
.final-spec-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.final-spec-content::-webkit-scrollbar-thumb {
    background-color: #cccccc;
    border-radius: 10px;
}
.final-spec-content::-webkit-scrollbar-thumb:hover {
    background-color: #aaaaaa;
}


/* --- СТИЛИ ДЛЯ ЗАГОЛОВКОВ И ТЕКСТА ВНУТРИ ТЗ --- */

/* Заголовки разделов (например, "1. Обзор и цели проекта") */
.final-spec-content h3 {
    font-size: 22px;
    color: #222; /* Убираем красный, делаем темно-серым */
    border-bottom: 2px solid var(--primary-purple); /* Фирменный акцент */
    padding-bottom: 8px;
    margin-top: 30px;
    margin-bottom: 0px;
}
.final-spec-content h3:first-child {
    margin-top: 0;
}

/* Подзаголовки */
.final-spec-content h4 {
    font-size: 18px;
    color: #444;
    margin-top: 25px;
    margin-bottom: -12px;
}

/* Обычные параграфы */
.final-spec-content p {
    margin-bottom: 2px;
}

/* Выделение жирным */
.final-spec-content strong {
    color: #000;
    font-weight: 600;
}

/* Списки */
.final-spec-content ul,
.final-spec-content ol {
    padding-left: 25px; /* Увеличим отступ для списков */
    margin-top: -50px;
}
.final-spec-content li {
    margin-bottom: -40px;
}

.final-actions {
    margin-top: 25px;
    text-align: center;
}

/* ==================================================
   ФИНАЛЬНАЯ МОБИЛЬНАЯ АДАПТАЦИЯ (САМЫЙ ПРОСТОЙ ПОДХОД)
   ================================================== */

@media (max-width: 768px) {

    /* --- 1. ОБЩИЕ УЛУЧШЕНИЯ --- */
    .architect-background .assistant-container {
        width: 90%;
    }
    .step-card {
        padding: 25px;
    }
    .intro-text-block {
        margin-bottom: 30px;
    }
    
    /* --- 2. СЕТКА ВЫБОРА ПРОЕКТА: ПРЕВРАЩАЕМ В ПРОСТОЙ СПИСОК --- */
    .project-types-grid {
        /* Отключаем Grid. Теперь элементы будут вести себя как обычные блоки. */
        display: block;
    }

    /* --- 3. АДАПТАЦИЯ САМИХ КАРТОЧЕК --- */
    .project-card {
        /* Заставляем каждую карточку занимать всю ширину */
        width: 100%;
        /* Добавляем отступ снизу между карточками */
        margin-bottom: 15px;
        
        /* Возвращаем вашу красивую вертикальную ориентацию */
        flex-direction: column;
        justify-content: center;
        gap: 15px;
        padding: 30px 25px;
    }

    /* Убедимся, что у последней карточки нет лишнего отступа снизу */
    .project-card:last-child {
        margin-bottom: 15px;
    }

    /* --- 4. АДАПТАЦИЯ ДИАЛОГОВОГО ОКНА (без изменений) --- */
    .chat-wrapper { height: 85vh; }
    .options-grid { grid-template-columns: 1fr; }
}

/* --- Стили для кнопки "Выйти" в навигации --- */

.logout-form {
    display: inline; /* Чтобы форма не занимала всю ширину */
    margin: 0;
    padding: 0;
}

.logout-button {
    /* Сбрасываем все стандартные стили кнопки */
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit; /* Наследуем шрифт от родителя (<li>) */
    color: inherit; /* Наследуем цвет текста */
    cursor: pointer;

    /* Копируем стили из вашего .main-nav a, чтобы выглядело одинаково */
    /* Эти значения могут отличаться в вашем файле */
    display: block;
    padding: 15px 20px; /* Пример, как в вашем меню */
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.logout-button:hover {
    /* Стиль при наведении, как у ваших ссылок */
    color: var(--primary-purple);
}

/* --- Стили для хедера --- */
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.main-nav { flex-grow: 1; } /* Заставляет основное меню занять место слева */

.user-nav {
    display: none; /* Скрываем на мобильных по умолчанию */
    align-items: center;
    gap: 15px; /* Отступ между кнопками */
}

/* Новый стиль для вторичной кнопки (например, "Регистрация") */
.btn-secondary {
    background: transparent;
    color: var(--text-dark);
    font-weight: 600;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.btn-secondary:hover {
    background-color: rgba(0,0,0,0.05);
}


/* --- Стили для страниц входа/регистрации --- */
.auth-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 450px;
    width: 100%;
    margin: 40px auto;
}
.auth-card h2 {
    text-align: center;
    margin-bottom: 30px;
    font-size: 28px;
    color: var(--dark-purple);
}

.auth-card .form-group {
    margin-bottom: 20px;
}
.auth-card label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
}
.auth-card input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    transition: all 0.3s ease;
}
.auth-card input:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(106, 68, 255, 0.2);
}

.auth-card .btn-primary {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    margin-top: 10px;
}

.auth-switch-link {
    text-align: center;
    margin-top: 25px;
    color: #6c757d;
}
.auth-switch-link a {
    color: var(--primary-purple);
    font-weight: 600;
    text-decoration: none;
}
.auth-switch-link a:hover {
    text-decoration: underline;
}

/* Показываем user-nav на десктопах */
@media (min-width: 1024px) {
    .user-nav { display: flex; }
}

/* --- Общие стили --- */
.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.main-nav { flex-grow: 1; }

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}
.user-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* --- МОБИЛЬНАЯ ВЕРСИЯ (по умолчанию) --- */
.desktop-only {
    display: none !important; /* Скрываем элементы только для десктопа */
}
.mobile-only {
    display: block; /* Показываем элементы только для мобильного меню */
}

/* На мобильных мы хотим видеть только имя пользователя, если он залогинен */
.user-nav .logout-form,
.user-nav .btn-secondary { /* Это скроет "Регистрация" и "Профиль" (имя останется) */
    display: none;
}
/* Но имя пользователя мы хотим видеть */
.user-nav .user-profile-link {
    display: block;
    color: var(--text-dark); /* Делаем его похожим на обычный текст */
    font-weight: 600;
}


/* --- ПЛАНШЕТЫ И ДЕСКТОПЫ (начиная с 1024px) --- */
@media (min-width: 1024px) {
    .desktop-only {
        display: inline-block !important; /* Показываем десктопные элементы */
    }
    .mobile-only {
        display: none !important; /* Скрываем мобильные */
    }
    
    /* Возвращаем все кнопки для пользователя */
    .user-nav .logout-form,
    .user-nav .btn-secondary {
        display: inline-block;
    }
    
    /* Стилизуем ссылку-имя, чтобы она выглядела как вторичная кнопка */
    .user-nav .user-profile-link {
        /* Применяем стили от .btn-secondary */
        background: transparent;
        color: var(--text-dark);
        text-decoration: none;
        padding: 10px 20px;
        border-radius: 8px;
        transition: all 0.3s ease;
    }
    .user-nav .user-profile-link:hover {
        background-color: rgba(0,0,0,0.05);
    }
}

/* --- Стили для баланса токенов --- */
.token-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    color: var(--text-light); /* Или var(--text-dark) в зависимости от темы хедера */
}
.token-balance i {
    color: #ffd700; /* Золотой цвет для иконки монетки */
}

/* --- Стили для блокировки интерфейса для анонимов --- */
.disabled-grid {
    opacity: 0.3;
    pointer-events: none; /* Отключаем клики */
    filter: blur(2px);
}

.auth-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(28, 25, 56, 0.5); /* Полупрозрачный фон */
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 16px; /* Если у родителя есть */
}

.auth-overlay .btn-lg {
    padding: 15px 30px;
    font-size: 18px;
}

/* --- Стили для страницы профиля --- */
.profile-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
    padding: 30px;
}
.profile-header {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
    margin-bottom: 20px;
}
.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--gradient-bg);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
}
.profile-info h2 { margin: 0; font-size: 28px; }
.profile-info p { margin: 0; color: #6c757d; }
.profile-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
}
.stat-value { font-size: 24px; font-weight: 700; display: block; }
.stat-label { font-size: 14px; color: #6c757d; }
.profile-actions { text-align: right; margin-top: 20px; }

/* --- Стили для хедера и профиля --- */

/* Ссылка на профиль в хедере */
.user-profile-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 20px;
    transition: background-color 0.3s ease;
}
.user-profile-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Новый, контрастный аватар в хедере */
.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink), var(--primary-purple)); /* Яркий градиент */
    color: white; /* Белый текст на градиенте */
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    border: 2px solid rgba(255, 255, 255, 0.8); /* Светлая обводка */
}

.header-username {
    font-weight: 600;
    color: var(--text-light); /* Или var(--text-dark) в зависимости от темы хедера */
}

/* Аватар на странице профиля (у вас уже есть, можно просто проверить) */
.profile-avatar {
    /* ... */
    background: linear-gradient(135deg, var(--accent-pink), var(--primary-purple));
    color: white;
    border: 3px solid white;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}


/* --- Главный контейнер виджета (теперь это ссылка <a>) --- */
.user-profile-widget {
    display: flex;
    align-items: center;
    background: var(--surface-color); /* Полупрозрачный фон */
    border: 1px solid var(--surface-border);
    border-radius: 50px; /* Полностью скругленные края */
    padding: 4px; /* Небольшой внутренний отступ */
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.user-profile-widget:hover {
    background: var(--surface-hover);
    border-color: var(--accent-pink);
    box-shadow: 0 0 15px var(--accent-glow);
    transform: translateY(-2px);
}

/* --- Баланс токенов --- */
.token-balance {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    font-weight: 600;
    color: var(--text-light);
    font-size: 14px;
}

.token-balance i {
    color: #ffd700; /* Золотой цвет для иконки монетки */
}

/* --- Вертикальный разделитель --- */
.widget-divider {
    width: 1px;
    height: 24px;
    background-color: var(--surface-border);
    margin-left: 5px;
}

/* --- Блок с аватаром и именем --- */
.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 10px 0 6px;
}

.header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-pink), var(--primary-purple));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0; /* Чтобы аватар не сжимался */
}

.header-username {
    font-weight: 600;
    color: var(--text-light);
    white-space: nowrap; /* Чтобы имя не переносилось на новую строку */
}

/* --- Кнопка "Выйти" --- */
.logout-btn-header {
    /* Сделаем ее менее навязчивой */
    background: transparent;
    border: 1px solid var(--accent-pink);
    color: var(--accent-pink);
    padding: 10px 20px;
}
.logout-btn-header:hover {
    background: var(--accent-pink);
    color: white;
}


/* --- АДАПТИВНОСТЬ --- */
/* На мобильных устройствах скрываем текст */
@media (max-width: 768px) {
    .header-username{
        display: none;
    }
    .widget-divider {
        margin: 0 4px;
    }
}


.progress-bar-container {
    width: 100%;
    background-color: #e0e0de;
    border-radius: 5px;
    margin: 20px 0;
}
.progress-bar {
    width: 0%;
    height: 10px;
    background-color: var(--primary-purple);
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}
/* ==================================
   НОВЫЕ СТИЛИ ДЛЯ СТРАНИЦЫ AI-ПРЕПОДАВАТЕЛЯ
   ================================== */

/* --- Общая структура страницы --- */
.teacher-assistant-page {
    display: flex;
    /* ИСПРАВЛЕНИЕ: Выравниваем по верху, а не по центру */
    align-items: flex-start; 
    gap: 60px;
    min-height: calc(100vh - 120px);
    width: 100%;
    max-width: 1300px;
    margin: 20px auto;
    padding: 40px; /* Добавляем отступы, чтобы контент не прилипал к краям */
}

/* --- Левая информационная колонка --- */
.info-panel-column {
    flex: 1; /* Занимает доступное пространство */
    padding-right: 40px;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-panel-title {
    font-size: 3rem; /* Крупный заголовок */
    font-weight: 700;
    line-height: 1.2;
    color: var(--dark-purple, #231249);
    margin-bottom: 15px;
}

.info-panel-subtitle {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 40px;
}

.features-list {
    display: flex;
    flex-direction: column;
    gap: 25px; /* Отступ между фичами */
    background-color: var(--dark-purple, #231249);
    color: var(--text-light, #fff);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 50px rgba(35, 18, 73, 0.3);
}

.features-list .feature-item {
    display: flex;
    align-items: flex-start; /* Иконка и текст на одном уровне */
    gap: 20px;
    /* Анимация появления для каждого элемента списка */
    opacity: 0;
    transform: translateX(-20px);
    animation: slideIn 0.5s ease-out forwards;
    
}

/* Задержка анимации для каждого элемента, чтобы они появлялись по очереди */
.features-list .feature-item:nth-child(1) { animation-delay: 0.2s; }
.features-list .feature-item:nth-child(2) { animation-delay: 0.3s; }
.features-list .feature-item:nth-child(3) { animation-delay: 0.4s; }
.features-list .feature-item:nth-child(4) { animation-delay: 0.5s; }

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.features-list .icon-wrapper {
    flex-shrink: 0;
    font-size: 22px;
    width: 45px;
    height: 45px;
    background-color: rgba(106, 68, 255, 0.2);
    color: #c4b0ff;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.features-list .feature-text h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
    font-weight: 600;
}
.features-list .feature-text p {
    margin: 0;
    font-size: 0.95rem;
    color: #6c757d;
    line-height: 1.5;
}

/* --- Правая колонка с формами --- */
.workflow-column {
    flex: 1.1; /* Делаем ее немного шире, т.к. там основной интерактив */
    min-width: 500px; /* Минимальная ширина, чтобы форма не сжималась */
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Адаптивность --- */
@media (max-width: 1024px) {
    .teacher-assistant-page {
        flex-direction: column; /* Колонки встают друг под другом */
        min-height: auto;
        gap: 30px;
        padding: 20px;
    }
    .info-panel-column {
        padding-right: 0;
        text-align: center;
    }
    .features-list .feature-item {
        text-align: left; /* Внутри карточки текст по левому краю */
    }
    .workflow-column {
        min-width: 100%;
        width: 100%;
    }
}
















/* ==================================
   АНИМАЦИЯ КОЛОНОК ДЛЯ AI-ПРЕПОДАВАТЕЛЯ
   ================================== */

/* --- Базовая настройка родительского контейнера --- */
.teacher-assistant-page {
    position: relative; /* Обязательно для абсолютного позиционирования дочерних элементов */
    display: flex;
    align-items: center;
    gap: 60px;
    /* ... (остальные ваши стили) ... */
}

/* --- Настройка обеих колонок --- */
.info-panel-column, .workflow-column {
    /* Плавный переход для всех свойств */
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1); /* Красивая кривая замедления */
}

/* --- Состояние, когда левая колонка СКРЫТА --- */
.info-panel-column.is-hidden {
    /* Уводим ее далеко влево и делаем некликабельной */
    pointer-events: none;
    max-width: 533px; /* Ограничиваем ширину, чтобы не занимала место */
    /* Делаем ее абсолютно спозиционированной, чтобы она вышла из потока */
    position: absolute;
    display:none; /* Скрываем элемент, чтобы не занимал место */
}

/* --- Состояние, когда правая колонка ЦЕНТРИРОВАНА --- */
.workflow-column.is-centered {
    /* 
       Этот трюк с transform центрирует элемент абсолютно,
       независимо от других элементов.
    */
    margin: 0 auto; /* Центрируем по горизонтали */
    width: 100%; /* Занимаем всю ширину родителя .assistant-container */
    max-width: 700px; /* Можно задать максимальную ширину для центрированного блока */
}


/* --- Адаптивность: на мобильных анимация не нужна --- */
@media (max-width: 1024px) {
    /* Просто скрываем левую панель, когда она не нужна */
    .info-panel-column.is-hidden {
        display: none;
    }
    /* Убираем абсолютное позиционирование для правой */
    .workflow-column.is-centered {
        position: static;
        left: auto;
        top: auto;
        transform: none;
        max-width: none; /* Возвращаем к 100% ширины */
    }
}




/* ==================================
   СТИЛИ ДЛЯ "ИММЕРСИВНОЙ" СТАРТОВОЙ СТРАНИЦЫ AI-АРХИТЕКТОРА
   ================================== */

/* --- Анимированный фон для всей страницы --- */
.immersive-background-page {
    background: linear-gradient(-45deg, #0f0c29, #302b63, #24243e, #ff6a88);
    background-size: 400% 400%;
    animation: gradient-animation 15s ease infinite;
    color: var(--text-light); /* Весь текст на этой странице по умолчанию будет светлым */
}

@keyframes gradient-animation {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Главный контейнер на всю высоту --- */
.immersive-container {
    display: flex;
    align-items: center; /* Центрируем колонки по вертикали */
    justify-content: center;
    min-height: calc(100vh - 85px); /* Высота экрана минус хедер */
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px;
    gap: 60px;
}

.immersive-column {
    flex: 1; /* Обе колонки занимают равное пространство */
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* --- Левая информационная колонка --- */
.info-column {
    animation: fadeInUp 0.8s ease-out;
}

.immersive-title {
    font-size: 4.5rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 25px;
}
/* Анимация появления строк заголовка */
.immersive-title span {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: slideUp 0.6s ease-out forwards;
}
.immersive-title span:nth-child(2) { animation-delay: 0.1s; }
.immersive-title span:nth-child(3) { animation-delay: 0.2s; }

@keyframes slideUp { to { opacity: 1; transform: translateY(0); } }


.immersive-subtitle {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 500px;
}

.immersive-features {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.immersive-features .feature-item {
    display: flex;
    align-items: center;
    gap: 15px;
    opacity: 0;
    transform: translateY(20px);
    animation: slideUp 0.5s ease-out forwards;
}
.immersive-features .feature-item:nth-child(1) { animation-delay: 0.4s; }
.immersive-features .feature-item:nth-child(2) { animation-delay: 0.5s; }
.immersive-features .feature-item:nth-child(3) { animation-delay: 0.6s; }

.feature-icon {
    font-size: 18px;
    color: var(--accent-pink);
}
.immersive-features p {
    margin: 0;
    font-size: 1rem;
    font-weight: 500;
}


/* --- Правая колонка с карточками --- */
.workflow-column .step-card.glass-effect {
    background: rgba(30, 30, 47, 0.6); /* Полупрозрачный фон */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    animation: fadeInUp 0.8s ease-out 0.2s backwards; /* Появляется чуть позже */
}
.workflow-column .step-card.glass-effect h2,
.workflow-column .step-card.glass-effect .step-description {
    color: var(--text-light);
}

/* Стили для карточек выбора проекта остаются прежними, они отлично впишутся */

/* --- Адаптивность --- */
@media (max-width: 1024px) {
    .immersive-container {
        flex-direction: column;
        min-height: auto;
        padding: 20px;
        text-align: center;
    }
    .immersive-subtitle {
        margin-left: auto;
        margin-right: auto;
    }
    .immersive-features {
        align-items: center;
    }
    .immersive-features .feature-item {
        justify-content: center;
    }
}



/* --- Главный контейнер хедера --- */
.site-header {
    padding: 15px 0;
    position: sticky; /* Делаем хедер "липким" */
    top: 0;
    z-index: 1000;
    width: 100%;

    /* Эффект "матового стекла" */
    background: rgba(22, 18, 45, 0.6); /* Полупрозрачный темно-фиолетовый */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Тонкая светлая граница */
    transition: background-color 0.3s ease;
}

/* Добавляем тень при скролле (понадобится маленький JS) */
.site-header.scrolled {
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.site-header .container {
    max-height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Логотип --- */
.logo img {
    margin-top: 8px;
    height: 130px;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.logo:hover img {
    transform: scale(1.05);
    opacity: 0.9;
}

/* --- Основная навигация --- */
.main-nav {
    flex-grow: 1;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 35px; /* Расстояние между пунктами */
    margin: 0;
    padding: 0;
}

.main-nav a {
    position: relative; /* Нужно для анимации подчеркивания */
    text-decoration: none;
    color: var(--text-muted, rgba(230, 230, 250, 0.7)); /* Приглушенный цвет */
    font-weight: 600;
    font-size: 16px;
    padding: 10px 5px;
    transition: color 0.3s ease;
}

/* Эффект при наведении */
.main-nav a:hover {
    color: var(--text-light, #e6e6fa); /* Становится ярче */
}

/* Анимация подчеркивания при наведении */
.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-pink), var(--primary-purple));
    transform: scaleX(0); /* Изначально линия "сжата" */
    transform-origin: center;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1); /* Плавный эффект */
}

.main-nav a:hover::after {
    transform: scaleX(1); /* "Растягиваем" линию при наведении */
}






/* ==================================


/* --- Класс для стандартного фона --- */
.default-background-page {
    background-color: #F9F9FB;
    /* Текстура "цифрового шума" - тонкая, едва заметная */
    background-image: url('data:image/svg+xml,%3Csvg width="100" height="100" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noise"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.8" numOctaves="4" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%" height="100%" filter="url(%23noise)" opacity="0.02"/%3E%3C/svg%3E');
}

/* --- Обновляем "парящий" хедер для светлой темы --- */
.default-background-page .site-header {
    /* Делаем его полупрозрачным белым */
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
/* Меняем цвет текста в навигации на темный */
.default-background-page .main-nav a {
    color: #555;
}
.default-background-page .main-nav a:hover {
    color: #000;
}
/* Стили для виджета пользователя тоже нужно адаптировать */
.default-background-page .user-profile-widget {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}
.default-background-page .header-username {
    color: #333;
}
.default-background-page .token-balance {
    color: #333;
}


/* Обновляем цвета внутри карточки */
.default-background-page .step-card h2 {
    color: #111;
}
.default-background-page .step-card .step-description {
    color: #666;
}

/* --- Стили для главной страницы (core/home.html) --- */
.default-background-page .page-title-section {
    text-align: center;
}
.default-background-page .page-title-section h1 {
    font-size: 3.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-pink), var(--primary-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.default-background-page .page-title-section .lead {
    font-size: 1.2rem;
    color: #555;
    max-width: 600px;
    margin: 20px auto 0 auto;
}

/* Карточки-фичи на главной */






/* ==================================
   ПОЛНЫЕ СТИЛИ ДЛЯ ПУБЛИЧНОГО ДАШБОРДА
   ================================== */

/* --- Заголовок страницы --- */
.page-header {
    text-align: center;
    margin-bottom: 50px;
    padding-top: 40px;
}

.page-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.page-header .lead {
    font-size: 1.1rem;
    color: #6c757d;
    margin: 0 auto;
}

/* --- Сетка для виджетов --- */
.dashboard-grid {
    display: grid;
    /* Создаем 2 колонки одинаковой ширины */
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}
.dashboard-grid_for_admin {
    display: grid;
    /* Создаем 2 колонки одинаковой ширины */
    grid-template-columns: 1fr 1fr 1fr;
    gap: 30px;
}
.assistant-container_for_admin_dashboard {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}
/* --- Стиль для отдельного виджета --- */
.dashboard-widget {
    background: #ffffff;
    padding: 25px 30px;
    border-radius: 16px;
    /* Мягкая тень в стиле Apple */
    box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 10px 25px rgba(0,0,0,0.08);
    border: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 450px; /* Фиксированная высота для единообразия */

}

.dashboard-widget h3 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

/* Контейнер для canvas, чтобы он занимал все доступное место */
.chart-container {
    position: relative;
    flex-grow: 1;
}

/* Виджет, который занимает всю ширину */
.full-width-widget {
    /* Растягиваем этот виджет на обе колонки */
    grid-column: 1 / -1;
}

/* --- Адаптивность для дашборда --- */
@media (max-width: 992px) {
    .dashboard-grid {
        /* На планшетах и мобильных - одна колонка */
        grid-template-columns: 1fr;
    }
}



.cta-banner {
    background: var(--gradient-bg, linear-gradient(135deg, #6a44ff, #ff6a88));
    padding: 30px 40px;
    border-radius: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    box-shadow: 0 10px 30px rgba(106, 68, 255, 0.3);
}
.cta-banner h3 { margin: 0 0 5px 0; font-size: 22px; }
.cta-banner p { margin: 0; opacity: 0.9; color:(38, 30, 78, 0.7);}




/* --- Стили для Персонального Дашборда Студента --- */
.text-center { text-align: center; }

/* Мини-борд */
.mini-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}
.mini-board-widget {
    background: #fff;
    padding: 25px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
}
.mini-board-widget h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #6c757d;
}
.stat-main {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-purple);
    line-height: 1;
}
.stat-sub {
    font-size: 14px;
    color: #888;
}

/* Списки предметов */
.subject-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.subject-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}
.subject-list li:last-child {
    border-bottom: none;
}
.subject-name {
    font-weight: 500;
}
.subject-grade {
    font-size: 18px;
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 8px;
}
.top-grade {
    background-color: #e6f9f1;
    color: #00b074;
}
.worst-grade {
    background-color: #fff0f0;
    color: #f44336;
}


.mini-board-grid-large {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}



/* --- Стили для переключателя графиков --- */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.widget-header h3 {
    margin: 0;
}
.chart-toggle {
    display: flex;
    background-color: #f0f0f0;
    border-radius: 8px;
    padding: 4px;
}
.toggle-btn {
    padding: 6px 12px;
    border: none;
    background-color: transparent;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}
.toggle-btn.active {
    background-color: #fff;
    color: var(--primary-purple);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}


/* --- Стили для дашборда студента --- */
.chart-subtitle {
    font-size: 14px;
    color: #6c757d;
    text-align: center;
    margin-top: -15px;
    margin-bottom: 15px;
}




.ai-insight-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.ai-insight-section h4 {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}
.ai-insight-section p {
    margin: 0;
    color: #555;
}

/* --- Основной контейнер-виджет --- */
.ai-analysis-container {
    display: flex;
    flex-direction: column;
    /* Убедимся, что он может растягиваться, если нужно */
    min-height: 450px; /* Та же высота, что и у других виджетов */
}

.ai-analysis-container .widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Заголовок не должен сжиматься */
}
.ai-analysis-container h3 {
    text-align: left;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0; /* Убираем лишние отступы */
}

/* --- Контейнер для контента (кнопки или текста) --- */
#ai-analysis-content {
    flex-grow: 1; /* Заставляет этот блок занять все доступное место */
    
    /* --- КЛЮЧЕВЫЕ СВОЙСТВА ДЛЯ АДАПТИВНОСТИ --- */
    
    /* 1. Устанавливаем максимальную высоту. 
       calc(100% - ...) не всегда надежен, лучше использовать flexbox. */
    overflow-y: auto; /* Добавляем вертикальную прокрутку, если контент не помещается */
    
    /* 2. Гарантируем, что длинные слова/ссылки будут переноситься */
    word-wrap: break-word;
    overflow-wrap: break-word;
    
    padding-right: 15px; /* Отступ справа, чтобы скроллбар не "прилипал" к тексту */
}

/* Стили для секций с текстом от AI */
.ai-insight-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}



/* --- Стили для вкладок --- */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    margin-bottom: 30px;
}
.auth-tab {
    padding: 10px 20px;
    text-decoration: none;
    color: #6c757d;
    font-weight: 600;
    border-bottom: 3px solid transparent;
}
.auth-tab.active {
    color: var(--primary-purple);
    border-bottom-color: var(--primary-purple);
}
.auth-tab.special {
    margin-left: auto; /* Прижимает вкладку "Я студент" вправо */
    color: #61ff2b
}
.auth-tab.special.active {
    border-bottom-color: #61ff2b;
}

/* --- Стили для поля email --- */
.email-input-group {
    display: flex;
    align-items: center;
}
.email-input-group input {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}
.email-domain {
    padding: 12px 15px;
    background-color: #f9f9fb;
    border: 1px solid #ccc;
    border-left: none;
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
    font-weight: 600;
    color: #555;
}



/* ==================================
   СТИЛИ ДЛЯ ПЛАШКИ-ДИСКЛЕЙМЕРА
   ================================== */
.disclaimer-box {
    display: flex;
    align-items: flex-start; /* Выравниваем по верху, если текст многострочный */
    gap: 15px;
    
    /* Используем цвета, характерные для предупреждений */
    background-color: #fffbe6; /* Светло-желтый фон */
    color: #8a6d3b; /* Темно-желтый текст */
    border: 1px solid #ffeeba; /* Желтая рамка */
    
    padding: 15px 20px;
    border-radius: 12px; /* Скругление в стиле Apple */
    margin-bottom: 40px; /* Отступ от контента ниже */
}

.disclaimer-icon {
    font-size: 20px;
    margin-top: 2px; /* Небольшая коррекция для выравнивания с текстом */
}

.disclaimer-text {
    font-size: 15px;
    line-height: 1.6;
}

.disclaimer-text strong {
    color: #664d03; /* Еще более темный желтый для заголовка */
}


@media (max-width: 768px) {
    .mini-board-grid-large {
        /* Переключаем сетку на 2 колонки */
        grid-template-columns: repeat(2, 1fr);
        gap: 15px; /* Немного уменьшаем отступ */
    }

    /* Делаем шрифт в виджетах чуть меньше, чтобы все помещалось */
    .mini-board-widget h4 {
        font-size: 14px;
    }
    .stat-main {
        font-size: 2rem;
    }
    .stat-sub {
        font-size: 12px;
    }
}




.ai-insight-box {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}
.ai-insight-box p {
    font-size: 15px;
    color: #555;
    line-height: 1.6;
    font-style: italic;
}
.spinner-inline {
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}






/* ==================================
   СТИЛИ ДЛЯ МОДАЛЬНОГО ОКНА AI-АНАЛИЗА
   ================================== */

.widget-footer {
    margin-top: auto; /* Прижимает кнопку к низу виджета */
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}


/* ==================================================
   СТИЛИ ДЛЯ СТАТИЧНОГО БЛОКА "НАШИ ПРОЕКТЫ"
   ================================================== */

.full-width-projects-section {
    padding: 80px 0;
    background-color: #f7f7ff; /* Светлый фон */
}

.full-width-projects-section .section-title {
    text-align: center;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--text-dark-primary);
    margin-bottom: 50px;
}

/* --- Адаптивная сетка карточек --- */
.projects-grid {
    display: grid;
    /* По умолчанию 5 колонок, если хватит места */
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
}

.project-grid-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    padding: 30px 15px;
    
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 15px;
    
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.project-grid-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(122, 92, 255, 0.15);
}

.project-grid-card.active {
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(122, 92, 255, 0.3);
    transform: translateY(-4px);
}

.project-grid-card i {
    font-size: 32px;
    color: var(--primary-purple);
}

.project-grid-card span {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-dark-primary);
    line-height: 1.4;
}

.project-grid-card i { font-size: 32px; color: var(--primary-purple); }
.project-grid-card span { font-size: 1.1rem; font-weight: 600; line-height: 1.4; }


/* --- Панель с описаниями --- */
.project-descriptions-panel {
    min-height: 100px;
    margin-top: 50px;
    text-align: center;
}

.project-description {
    display: none;
}
.project-description.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

.project-description h3 {
    font-size: 1.6rem;
    margin-bottom: 10px;
    color: var(--text-dark-primary);
}
.project-description p {
    font-size: 1.1rem;
    color: #6c757d;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 auto;
}


/* Для средних экранов (ноутбуки) - 4 колонки */
@media (max-width: 1200px) {
    .projects-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Для планшетов - 2 колонки */
@media (max-width: 992px) {
    .projects-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Для мобильных - 1 колонка */
@media (max-width: 576px) {
    .projects-grid {
        grid-template-columns: 1fr;
    }
    .project-grid-card {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
    }
}

/* ==================================================
   РЕДИЗАЙН ЛЕНДИНГА "AI AVATAR" (v.Final)
   ================================================== */

/* --- 1. Секция HERO (Главный экран) - РЕДИЗАЙН --- */

.avatar-hero-section {
    padding: 100px 0;
    background-color: #f7f7ff;
}

.avatar-hero-container {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-text-content {
    flex: 1.2; /* Даем текстовому блоку больше места */
    text-align: left;
}

.hero-text-content h1 {
    /* Делаем заголовок НАМНОГО крупнее */
    font-size: 4.5rem; /* было 3.5rem */
    font-weight: 800; /* делаем жирнее */
    line-height: 1.15;
    color: var(--text-dark-primary);
    margin-bottom: 25px;
}

.hero-text-content p {
    font-size: 1.2rem; /* Увеличиваем текст описания */
    color: #6c757d;
    margin-bottom: 40px;
    max-width: 550px;
}

.hero-text-content .btn-primary { padding: 18px 36px; font-size: 1.1rem; margin-right: 25px; }
.watch-video-btn { font-size: 1.1rem; }

.hero-image-content {
    flex: 1;
    text-align: right;
}
.hero-image-content img {
    max-width: 100%;
    height: auto;
}


/* --- 2. Секция FEATURES (Особенности курса) - без изменений --- */

.avatar-features-section {
    padding: 100px 0; /* Увеличиваем отступы */
    background-color: #ffffff; 
}

.avatar-features-section .section-title,
.avatar-course-section .section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 50px;
    color: var(--text-dark-primary);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    text-align: left; /* Выравниваем текст по левому краю для аккуратности */
}

.feature-card {
    padding: 30px;
    border-radius: 16px;
    background-color: #f7f7ff; /* Фон карточек */
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}
.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(122, 92, 255, 0.1);
    border-color: var(--primary-purple);
}

.feature-card i {
    font-size: 28px; /* Уменьшаем иконки */
    color: var(--primary-purple);
    margin-bottom: 20px;
    /* Помещаем иконку в кружок */
    display: inline-flex;
    width: 60px;
    height: 60px;
    align-items: center;
    justify-content: center;
    background-color: #ede9ff;
    border-radius: 50%;
}
.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.feature-card p {
    color: #6c757d;
}


/* --- 3. Секция COURSE (Программа курса) - РЕДИЗАЙН --- */

.avatar-course-section {
    padding: 100px 0;
    background-color: var(--dark-purple, #231249);
    color: #ffffff;
    
    /* Добавляем декоративный элемент */
    position: relative;
    overflow: hidden;
}
.avatar-course-section::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(122, 92, 255, 0.15), transparent 70%);
}

.avatar-course-section .container {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center; /* Центрируем все содержимое */
    text-align: center;
}

.avatar-course-section .section-title {
    color: #ffffff;
    font-size: 2.8rem;
}
.avatar-course-section .section-subtitle {
    max-width: 600px;
    margin-top: -30px;
    margin-bottom: 40px;
    color: var(--text-muted, rgba(255,255,255,0.7));
}

/* static/css/style.css */

.course-grid {
    width: 100%;
    max-width: 800px;
    min-height: 150px;
    background-color: rgba(0,0,0,0.15);
    border: 1px dashed var(--surface-border, rgba(189, 169, 255, 0.2)); /* Делаем рамку пунктирной */
    border-radius: 16px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    
    /* Стили для текста-заглушки */
    color: var(--text-muted, rgba(255,255,255,0.5));
    font-style: italic;
}

/* Кнопка теперь идеально вписана */
.btn-large {
    padding: 18px 40px;
    font-size: 1.1rem;
}


/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media (max-width: 992px) {
    .avatar-hero-section { padding: 60px 0; }
    .avatar-hero-container { flex-direction: column-reverse; }
    .hero-text-content { text-align: center; }
    .hero-text-content h1 { font-size: 2.8rem; }
    
    .avatar-features-section { padding: 60px 0; }
    .features-grid { grid-template-columns: 1fr; }
    
    .avatar-course-section { padding: 60px 0; }
}

/* ==================================
   СТИЛИ ДЛЯ СТРАНИЦЫ КУРСА (AI AVATAR PLAYER)
   ================================== */

.course-player-container {
    display: flex;
    gap: 30px;
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 40px;
}

/* --- Левая колонка (список лекций) --- */
.lecture-list-sidebar {
    flex: 0 0 350px; /* Фиксированная ширина 350px */
    background-color: #fff;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04);
    align-self: flex-start; /* "Прилипает" к верху */
}
.lecture-list-sidebar h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
}
.video-responsive-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    
    /* Анимация появления */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    
    /* Анимация появления */
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
.modal-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: #f9f9fb; /* Чистый, светло-серый фон */
    border-radius: 16px;
    box-shadow: 0 10px 50px rgba(0,0,0,0.2);
    width: 90%;
    /* Увеличиваем максимальную ширину для комфортного просмотра */
    max-width: 1200px; 
    height: 85vh; /* Занимает 85% высоты экрана */
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-backdrop.is-visible .modal-content {
    transform: scale(1);
}

.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 28px;
    color: #aaa;
    cursor: pointer;
    transition: color 0.2s;
}
.modal-close-btn:hover { color: #333; }

.modal-content h2 {
    padding: 25px 30px;
    margin: 0;
    border-bottom: 1px solid #eee;
    font-size: 22px;
}

/* --- Шапка модального окна --- */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    flex-shrink: 0; /* Шапка не будет сжиматься */
}
.modal-header h2 { margin: 0; font-size: 20px; }

.modal-body-split {
    display: flex;
    flex-grow: 1;
    overflow: hidden; /* Важно, чтобы дочерние скроллы работали */
}
.modal-chart-container {
    height: 400px;
}

/* Левая колонка (график) */
.modal-chart-container {
    flex: 1.5; /* Даем графику чуть больше места */
    padding: 20px;
    position: relative; /* Нужно для Chart.js */
}

/* Правая колонка (текст анализа) */
.modal-insight-container {
    flex: 1;
    border-left: 1px solid #e0e0e0;
    background-color: #ffffff; /* Чистый белый фон для текста */
    
    /* Ключевое свойство: включаем собственную прокрутку */
    overflow-y: auto; 
}

/* --- Стилизация отрендеренного Markdown-текста --- */
.ai-insight-text {
    padding: 25px 30px;
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}
.ai-insight-text h3 {
    font-size: 18px;
    margin-top: 20px;
    margin-bottom: 10px;
}
.ai-insight-text p {
    margin-bottom: 15px;
}
.ai-insight-text strong, .ai-insight-text b {
    font-weight: 600;
    color: #000;
}
.ai-insight-text em, .ai-insight-text i {
    font-style: italic;
    color: #555;
}
.ai-insight-text ul, .ai-insight-text ol {
    padding-left: 25px;
    margin-bottom: 15px;
}
.ai-insight-text hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 25px 0;
}

/* --- Адаптивность для модального окна --- */
@media (max-width: 992px) {
    .modal-body-split {
        flex-direction: column; /* Колонки встают друг под другом */
    }
    .modal-chart-container {
        height: 350px; /* Фиксированная высота для графика на мобильных */
        flex-shrink: 0;
    }
    .modal-insight-container {
        border-left: none;
        border-top: 1px solid #e0e0e0;
    }
}



/* --- Стили для генератора отчетов --- */
.report-generator-widget {
    background: #fff;
    padding: 25px 30px;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.04), 0 10px 25px rgba(0,0,0,0.08);
    margin-bottom: 40px;
}
.report-generator-controls p {
    text-align: center;
    color: #555;
    margin-bottom: 20px;
}
.report-buttons-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}
.btn-success { background-color: #00b074; border-color: #00b074; color: #fff; }
.btn-danger { background-color: #f44336; border-color: #f44336; color: #fff; }

/* --- Стили для модального окна отчета --- */
.report-modal .modal-body-single {
    padding: 0; /* Убираем паддинги, так как они будут у текста */
    overflow-y: hidden; /* Скролл будет внутри .ai-insight-text */
}
.report-modal .ai-insight-text {
    height: 65vh; /* Занимает почти всю высоту окна */
    overflow-y: auto;
    padding: 25px 30px;
}
.modal-footer {
    padding: 15px 30px;
    border-top: 1px solid #eee;
    background-color: #f9f9fb;
    flex-shrink: 0;
    text-align: right;
}

.lecture-info-panel {
    padding: 30px 40px;
}
.lecture-info-panel h1 {
    font-size: 2rem;
    margin-bottom: 20px;
}

/* --- Правая колонка: Список лекций --- */
.lecture-list-column {
    width: 380px;
    flex-shrink: 0;
    background-color: #ffffff;
    border-left: 1px solid #e0e0e0;
    display: flex;
    flex-direction: column;
}

.lecture-list-header {
    padding: 20px;
    border-bottom: 1px solid #e0e0e0;
}
.lecture-list-header h3 {
    margin: 0 0 5px 0;
}
.lecture-list-header p {
    margin: 0;
}
.progress-info {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.lecture-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.lecture-item {
    margin-bottom: 5px;
}
.lecture-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: background-color 0.3s ease;
}
.lecture-item a:hover {
    background-color: #f7f7ff;
}
.lecture-order {
    font-size: 0.9rem;
    color: #fff;
    background-color: #ccc;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.lecture-title { flex-grow: 1; }
.status-icon {
    font-size: 1.1rem;
    color: #ccc;
}
.lecture-item.completed .lecture-order {
    background-color: var(--primary-purple);
}
.lecture-item.completed .status-icon {
    color: #28a745; /* Зеленый */
}
.lecture-item.locked {
    opacity: 0.6;
}
.lecture-item a.disabled-link {
    pointer-events: none;
    cursor: default;
}
.test-item i:first-child { font-size: 1rem; color: var(--primary-purple); }


/* --- Правая колонка (плеер) --- */
.lecture-content-main {
    flex-grow: 1;
}
.lecture-content-main h2 {
    font-size: 2rem;
    margin-bottom: 25px;
}
.video-player-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9; /* Сохраняет пропорции 16:9 */
    background-color: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
#youtube-player {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}
.transcript-accordion {
    margin-top: 25px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}
.transcript-accordion .accordion-header {
    width: 100%;
    background: #f7f7ff;
    padding: 15px 20px;
    /* ... (стили как у аккордеона из AI-преподавателя) ... */
}
.transcript-accordion .accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out;
}
.transcript-text { padding: 20px; }
.next-step-container { text-align: center; margin-top: 30px; }

.disabled-link {
    pointer-events: none;
    cursor: default;
}

/* --- Адаптивность --- */
@media (max-width: 1024px) {
    .course-player-container {
        flex-direction: column;
    }
    .lecture-list-sidebar {
        flex: 0 0 auto;
        width: 100%;
    }
}

/* --- Стили для блока с фидбэком --- */
.feedback-card {
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border-left-width: 5px;
    border-left-style: solid;
}
.feedback-card.passed {
    background-color: #f0fff4; /* Светло-зеленый фон */
    border-left-color: #28a745; /* Зеленая полоса */
}
.feedback-card.failed {
    background-color: #fff5f5; /* Светло-красный фон */
    border-left-color: #dc3545; /* Красная полоса */
}
.feedback-card h4 {
    margin-top: 0;
}
.feedback-status { font-size: 1.1rem; }
.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}
.status-passed { background-color: #28a745; }
.status-failed { background-color: #dc3545; }
.feedback-text { margin-top: 10px; }

/* --- Стили для кнопки "Следующая лекция" --- */
.next-step-container {
    text-align: center;
    margin-top: 40px;
    height: 60px; /* Резервируем место, чтобы страница не "прыгала" */
}

/* Анимация плавного появления */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.btn-large {
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
}

/* ==================================
   СТИЛИ ДЛЯ ФОРМЫ ФИНАЛЬНОГО ЗАДАНИЯ
   ================================== */

/* Применяем стили к textarea, как к другим полям ввода */
#submission-textarea {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid #ddd;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    transition: all 0.3s ease;
    min-height: 200px; /* Задаем минимальную высоту */
    resize: vertical; /* Позволяем изменять размер только по вертикали */
}

#submission-textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 4px rgba(106, 68, 255, 0.15);
}

/* 
   Стилизуем кнопку "Отправить", используя уже существующий класс .btn-primary.
   Нам нужно просто убедиться, что она имеет правильные отступы и размер.
*/
#assignment-form-container {
    text-align: center; /* Центрируем кнопку */
}

#submit-assignment-btn {
    margin-top: 20px;
    /* Используем стили от .btn-large, чтобы кнопка была заметной */
    padding: 16px 32px;
    font-size: 1.1rem;
    font-weight: 600;
    width: auto; /* Ширина по контенту */
    min-width: 300px;
}   

/* ==================================
   ФИНАЛЬНЫЕ СТИЛИ ДЛЯ СЕРТИФИКАТА (v3 - Надежная верстка)
   ================================== */

.certificate-page-container {
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.certificate-logo2{
    height: 60px;
    width: auto;
    margin-bottom: 30px;
}

.certificate-wrapper {
    width: 100%;
    max-width: 1000px;
    aspect-ratio: 1.412 / 1;
    background: white;
    box-shadow: 0 10px 50px rgba(0,0,0,0.1);
    padding: 20px;
}

.certificate-border {
    border: 13px solid #f3f2ff;
    width: 100%;
    height: 100%;
    padding: 40px 60px;
    text-align: center;
    /* УБИРАЕМ FLEXBOX ОТСЮДА */
}

/* --- Хедер сертификата --- */
.certificate-header {
    /* Ничего не меняем, он остается как есть */
}
.certificate-logo {
    height: 170px;
    width: auto;
    margin-bottom: 10px;
}
.certificate-main-title {
    font-size: 42px;
    font-weight: 800;
    color: var(--dark-purple);
    letter-spacing: 6px;
    margin: 0;
}
.certificate-subtitle {
    font-size: 18px;
    margin: 5px 0 0 0;
    color: #555;
    letter-spacing: 3px;
    text-transform: uppercase;
}

/* --- Тело сертификата (с отступами) --- */
.certificate-body { 
    /* Задаем большие отступы сверху и снизу, чтобы отодвинуть от хедера и футера */
    margin: 10px 0; 
}
.award-text { 
    font-size: 18px; 
    color: #6c757d; 
}
.student-name {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-purple);
    margin: 15px 0;
}
.divider-line { 
    width: 200px; 
    height: 1px; 
    background: #ddd; 
    margin: 8px auto; 
}
.course-text { 
    font-size: 18px; 
    color: #6c757d; 
}
.course-name { 
    font-size: 24px; 
    font-weight: 600; 
    color: var(--dark-purple); 
    margin-top: 5px; 
}

/* --- Футер сертификата (обновленная версия) --- */
.certificate-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    margin-top: auto; 
    padding-top: 40px; /* Добавим отступ сверху */
}
.footer-item { 
    text-align: center; 
    width: 45%; /* Немного изменим ширину для баланса */
}

/* Линия для подписи */
.signature-line { 
    border-bottom: 1px solid #333; 
    width: 220px; /* Сделаем линию чуть длиннее */
    margin: 0 auto 8px auto; /* Увеличим отступ снизу */
}

/* Заголовок "Председатель..." */
.signature-title { 
    font-size: 14px; 
    color: #333; /* Сделаем текст темнее и четче */
    font-weight: 600;
    margin: 0;
}

/* --- НОВЫЙ СТИЛЬ для ФИО --- */
.signature-name {
    font-size: 14px;
    color: #555;
    margin-top: 4px;
}

.date-issued, .certificate-id { 
    font-size: 14px; 
    color: #888; 
    text-align: right; /* Выравниваем дату и ID по правому краю */
}
/* Выравниваем ID под датой */
.footer-item.date-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}


/* --- Кнопки под сертификатом --- */
.certificate-actions { 
    text-align: center; 
    margin-top: 10px; 
}

/* Добавьте в style.css */
.assignment-layout {
    display: flex;
    gap: 40px;
}
.assignment-details { flex: 1; }
.assignment-submission { flex: 1; }

@media (max-width: 992px) {
    .assignment-layout { flex-direction: column; }
}

/* ==================================
   НОВЫЕ СТИЛИ ДЛЯ СТРАНИЦЫ ТЕСТА
   ================================== */

.test-card {
    background: #fff;
    border-radius: 20px;
    padding: 30px 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

/* --- Шапка теста --- */
.test-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.test-header h2 { margin: 0; font-size: 1.8rem; }
.test-header p { margin: 5px 0 0 0; color: #6c757d; }

.test-progress-tracker {
    text-align: right;
    width: 150px;
}
#progress-text {
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
    display: block;
}
.test-progress-bar-container {
    width: 100%;
    height: 8px;
    background-color: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}
.test-progress-bar {
    height: 100%;
    width: 0%; /* Начинаем с 0% */
    background: linear-gradient(90deg, var(--primary-purple), var(--accent-pink));
    border-radius: 4px;
    transition: width 0.4s ease-in-out;
}

/* --- Список вопросов --- */
.test-questions-list {
    list-style: none;
    padding: 0;
}
.test-question-item {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}
.question-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 20px;
}
.options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.option-wrapper {
    position: relative;
}

/* --- Стиль для скрытых радио-кнопок и красивых лейблов --- */
.radio-input {
    /* Полностью скрываем стандартную радио-кнопку */
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
}
.option-label {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.option-label:hover {
    background-color: #f7f7ff;
    border-color: #c4b0ff;
}

/* Стиль для ВЫБРАННОГО ответа */
.radio-input:checked + .option-label {
    background-color: #ede9ff;
    border-color: var(--primary-purple);
    box-shadow: 0 0 10px rgba(106, 68, 255, 0.2);
}
.radio-input:checked + .option-label .option-letter {
    background-color: var(--primary-purple);
    color: white;
}

.option-letter {
    font-weight: 700;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: #e9ecef;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

/* --- Стили для блоков с кодом в заданиях --- */
.assignment-text pre {
    background-color: #f0f0f0; /* Светло-серый фон */
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    white-space: pre-wrap; /* Сохраняет переносы и пробелы */
    word-wrap: break-word;
    font-family: 'Courier New', Courier, monospace; /* Моноширинный шрифт */
    font-size: 14px;
    margin-top: 15px;
}

.assignment-text code {
    background-color: #e9e9e9;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
}
/* ==================================
   ФИНАЛЬНЫЕ СТИЛИ ДЛЯ СТРАНИЦЫ ЗАВЕРШЕНИЯ (v6 - Полная версия)
   ================================== */

.completion-page-container {
    padding: 60px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 85px); /* Занимаем почти весь экран */
    position: relative;
    overflow: hidden; /* Чтобы конфетти не вылезало */
}

#confetti-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1; /* Помещаем за контентом */
    pointer-events: none; /* Делаем некликабельным */
}

.completion-content-wrapper {
    position: relative;
    z-index: 2; /* Помещаем поверх конфетти */
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.completion-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out;
}
.completion-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
}
.completion-header .lead {
    font-size: 1.2rem;
    color: #555;
    max-width: 600px;
    margin: 15px auto 0 auto;
}

.certificate-preview-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.certificate-wrapper {
    width: 100%;
    max-width: 1000px; /* Уменьшенный, сбалансированный размер */
    aspect-ratio: 1.414 / 1;
    background: white;
    box-shadow: 0 15px 50px rgba(0,0,0,0.12);
    padding: 20px;
    border-radius: 4px;
}

.certificate-border {
    border: 12px solid #f3f2ff;
    width: 100%;
    height: 100%;
    padding: 30px 50px;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.certificate-header {
    flex-shrink: 0;
}

.certificate-logo {
    height: 200px;
    width: auto;
    margin-bottom: -40px;

}

.certificate-main-title {
    font-size: 48px;
    font-weight: 700;
    color: var(--dark-purple);
    letter-spacing: 5px;
    margin: 0;
}

.certificate-subtitle {
    font-size: 16px;
    margin: 5px 0 0 0;
    color: #555;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.certificate-body { 
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin: 20px 0;
}

.award-text { 
    font-size: 18px; 
    color: #6c757d; 
}

.student-name {
    font-size: 38px;
    font-weight: 700;
    color: var(--primary-purple);
    margin: 15px 0;
}

.divider-line { 
    width: 200px; 
    height: 1px; 
    background: #ddd; 
    margin: 0px auto; 
}

.course-text { 
    font-size: 18px; 
    color: #6c757d; 
}

.course-name { 
    font-size: 24px; 
    font-weight: 600; 
    color: var(--dark-purple); 
    margin-top: 5px; 
}

.certificate-footer {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    flex-shrink: 0;
}

.footer-item { 
    text-align: center; 
    width: 40%; 
}

.signature-title, .date-issued, .certificate-id { 
    font-size: 14px; 
    color: #888; 
}

.completion-actions { 
    text-align: center; 
    margin-top: 40px; 
    display: flex;
    gap: 20px;
    justify-content: center;
    animation: fadeInUp 1s ease-out 0.4s backwards;
}

.completion-actions .btn {
    transition: all 0.3s ease;
}
.completion-actions .btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
.completion-actions .btn-secondary {
    background-color: #f0f0f0;
    border-color: #f0f0f0;
    color: #333;
}
.completion-actions .btn-secondary:hover {
    background-color: #e0e0e0;
}

.submission-container {
    margin-top: 30px;
    animation: fadeInUp 1.2s ease-out 0.6s backwards;
}

#toggle-submission {
    color: var(--primary-purple);
    font-weight: 600;
    text-decoration: none;
    font-size: 16px;
}
#toggle-submission:hover {
    text-decoration: underline;
}

.submission-details {
    max-width: 800px;
    margin: 20px auto;
    padding: 25px;
    background: #f7f7ff;
    border-radius: 12px;
    text-align: left;
    border: 1px solid #eee;
}

.submission-details h4 {
    margin-top: 0;
    margin-bottom: 15px;
}

.submission-details pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}




/* Стиль для кнопки в момент отправки */
.btn.is-loading {
    position: relative; /* Нужно для позиционирования спиннера */
    color: transparent !important; /* Прячем текст кнопки */
    pointer-events: none; /* Блокируем повторные нажатия */
    cursor: wait;
}

/* Спиннер, который появляется внутри кнопки */
.btn.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px; /* Размер спиннера */
    height: 20px;
    margin-top: -10px; /* Центрируем по вертикали */
    margin-left: -10px; /* Центрируем по горизонтали */
    
    border: 3px solid rgba(255, 255, 255, 0.5); /* Цвет фона спиннера */
    border-top-color: #ffffff; /* Цвет вращающейся части */
    border-radius: 50%;
    
    animation: spin 1s linear infinite;
}

/* Убедитесь, что анимация @keyframes spin у вас уже определена */



.next-step-container .btn-large {
/* ==== ИСПРАВЛЕНИЕ №2: ЦЕНТРИРОВАНИЕ ИКОНКИ ==== */
    display: inline-flex;  /* Обязательно для align-items */
    align-items: center;    /* Вертикально центрирует иконку и текст */
    gap: 10px;              /* Добавляет красивый отступ между текстом и иконкой */
}


/* ==================================
   СТИЛИ ДЛЯ ПОЛНОЭКРАННОГО ЗАГРУЗЧИКА (ИСПРАВЛЕННАЯ ВЕРСИЯ)
   ================================== */
.page-loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(5px);
    z-index: 9999;
    
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0.3s ease;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.page-loader-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* --- ИСПРАВЛЕНИЕ: Используем тот же самый стиль спиннера --- */
.page-loader-overlay .spinner {
    /* Копируем стили из вашего рабочего спиннера HTMX */
    width: 60px;
    height: 60px;
    border: 6px solid #e0e0e0;
    border-top: 6px solid var(--primary-purple); /* Используем цвет из палитры */
    border-radius: 50%;
    
    /* Добавляем анимацию вращения */
    animation: spin 1s linear infinite;
}
/* --- КОНЕЦ ИСПРАВЛЕНИЯ --- */


.page-loader-overlay p {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--dark-purple);
}

/* 
   Убедимся, что сама анимация @keyframes spin определена где-то в вашем CSS.
   Она у вас уже есть от спиннера HTMX.
*/
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.access-denied-icon {
    font-size: 4rem;
    color: var(--primary-purple);
    margin-bottom: 20px;
}

/* ==================================
   СТИЛИ ДЛЯ СЕРТИФИКАТОВ В ПРОФИЛЕ
   ================================== */
.certificate-list {
    margin-top: 20px;
}
.certificate-item {
    display: flex;
    align-items: center;
    gap: 20px;
    background-color: #f7f7ff;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}
.cert-icon {
    flex-shrink: 0;
    font-size: 24px;
    width: 60px;
    height: 60px;
    background-color: #ede9ff;
    color: var(--primary-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.cert-info {
    flex-grow: 1;
    text-align: left;
}
.cert-info h4 {
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}
.cert-info p {
    margin: 0;
    color: #6c757d;
}
.cert-actions {
    flex-shrink: 0;
}

/* ==================================
   ИСПРАВЛЕНИЕ ДЛЯ МОБИЛЬНОГО МЕНЮ НА ИММЕРСИВНОМ ФОНЕ
   ================================== */

/* 
   Это правило сработает, только когда у body есть ОБА класса:
   .immersive-background-page (наша страница архитектора)
   И .nav-open (когда гамбургер-меню открыто)
*/
.immersive-background-page.nav-open .main-nav {
    /* 
     * Добавляем фон, который соответствует стилю "матового стекла",
     * но делаем его более плотным, чтобы контент не просвечивал.
     */
    background: rgba(30, 30, 47, 0.95); /* Более плотный полупрозрачный фон */
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
}

/* 
   Дополнительно улучшим читаемость ссылок внутри открытого меню
   на темном фоне.
*/
.immersive-background-page.nav-open .main-nav a {
    color: var(--text-light, #e6e6fa); /* Делаем ссылки светлыми */
    font-size: 24px; /* Увеличим для удобства на мобильных */
    padding: 15px 20px;
}

/* И иконку гамбургера тоже сделаем светлой на темном фоне */
.immersive-background-page .hamburger,
.immersive-background-page .hamburger::before,
.immersive-background-page .hamburger::after {
    background-color: var(--text-light, #e6e6fa);
}

/* Когда меню открыто, "крестик" тоже будет светлым */
.immersive-background-page.nav-open .hamburger {
    background: transparent;
}
.immersive-background-page.nav-open .hamburger::before,
.immersive-background-page.nav-open .hamburger::after {
    background-color: var(--text-light, #e6e6fa);
}

/* templates/ai_avatar/certificate_pdf_template.html -> <style> */

.footer-table { width: 100%; margin-top: 60px; border-collapse: collapse; }
.footer-table td { width: 50%; font-size: 11pt; color: #555; vertical-align: bottom; }

.signature-line { border-bottom: 1px solid #333; width: 220px; margin-bottom: 8px; }
.signature-title { font-weight: bold; color: #333; }
.signature-name { color: #555; margin-top: 4px; }

.date-issued, .certificate-id { color: #888; }