/* Общие настройки */
body {
    margin: 0;
    padding: 0;
    background-color: var(--main-bg);
    color: var(--main-text);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    overflow-x: hidden;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Логотип и хедер */
.logo {
    width: 60%;
    max-width: 300px;
    height: auto;
    margin-bottom: 20px;
    animation: fadeInDown 1.5s ease forwards;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.hero-section {
    text-align: center;
    padding: 50px 20px 30px;
    border-bottom: 1px solid var(--secondary-bg);
}

.headline {
    font-size: 32px;
    margin: 10px 0;
    animation: fadeInUp 1.5s ease forwards;
}

.subhead {
    font-size: 18px;
    margin-bottom: 30px;
    color: var(--gray-text);
    animation: fadeInUp 1.7s ease forwards;
}

.cta-button {
    background-color: var(--btn-bg);
    color: var(--black);
    padding: 14px 28px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    display: inline-block;
    margin-top: 15px;
    box-shadow: 0 0 12px rgba(240, 185, 58, 0.7);
    animation: pulseGlow 2.5s ease-in-out infinite;
}

.cta-button:hover {
    background-color: var(--border-yellow);
    box-shadow: 0 0 20px rgba(240, 185, 58, 1);
}

/* Между секциями уменьшаем отступы и добавляем разделители */
.section {
    padding: 40px 20px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--secondary-bg);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 1.5s ease forwards;
}

.section.cta-section {
    margin-bottom: 60px;
    border-bottom: none;
}

/* Таблицы */
table {
    border-collapse: collapse;
    width: 100%;
    margin-top: 30px;
    margin-bottom: 30px;
    font-size: 16px;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.15);
    background-color: var(--secondary-bg);
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
    word-break: break-word;
}

thead tr {
    background-color: var(--btn-bg);
    color: var(--black);
    text-align: left;
    font-weight: bold;
}

thead th,
tbody td {
    padding: 12px 15px;
}

tbody tr {
    border-bottom: 1px solid var(--accent);
}

tbody tr:last-child {
    border-bottom: none;
}

/* Списки */
.bullet-list {
    list-style: disc inside;
    font-size: 16px;
    line-height: 1.9;
    margin: 25px 0;
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
}

/* Блок преимуществ */
.benefits-grid {
    display: flex;
    justify-content: space-between;
    gap: 30px;
    margin-top: 30px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.benefits-grid > div {
    background-color: var(--secondary-bg);
    padding: 20px;
    border-radius: 10px;
    flex: 1;
    box-shadow: 0 0 8px rgba(0, 0, 0, 0.3);
}

.benefits-grid h3 {
    margin-top: 0;
    color: var(--btn-bg);
    font-size: 1.6rem;
}

/* Заголовки */
h2 {
    font-weight: 700;
    font-size: 2.4rem;
    margin-bottom: 25px;
    color: var(--btn-bg);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Анимации ключевые */

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

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Пульс для кнопок */
@keyframes pulseGlow {
    0%,
    100% {
        box-shadow: 0 0 12px rgba(240, 185, 58, 0.7);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(240, 185, 58, 1);
        transform: scale(1.05);
    }
}

/* Футер */
.site-footer {
    background-color: #2c3139;
    text-align: center;
    padding: 30px 20px;
    font-size: 12px;
    border-top: 1px solid #3a3f47;
}

.site-footer a {
    color: #f0b93a;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Адаптивность */
@media (max-width: 768px) {
    .headline {
        font-size: 24px;
    }

    .subhead {
        font-size: 16px;
    }

    .benefits-grid {
        flex-direction: column;
        gap: 20px;
    }

    .benefits-grid > div {
        max-width: 100%;
    }

    table {
        font-size: 14px;
    }

    .bullet-list {
        max-width: 100%;
    }
}
/* Общие стили, отступы и анимации (только ключевые) */

.section,
.fade-in,
.slide-from-left,
.slide-from-right,
.slide-from-bottom,
.special-anim {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 1.2s ease,
        transform 1.2s ease;
}

/* Разные варианты сдвига */

.slide-from-left {
    transform: translateX(-50px);
}

.slide-from-right {
    transform: translateX(50px);
}

.slide-from-bottom {
    transform: translateY(50px);
}

.special-anim {
    transform: scale(0.6) rotate(-10deg);
    transition:
        opacity 1.2s ease,
        transform 1.2s ease;
}

/* Когда visible — плавно появляем */

.section.visible,
.fade-in.visible,
.slide-from-left.visible,
.slide-from-right.visible,
.slide-from-bottom.visible,
.special-anim.visible {
    opacity: 1;
    transform: none;
}
/* Модальное окно */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: flex-start;
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background-color: #2e3440;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    margin: 40px auto;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
    animation: fadeInUp 0.6s ease-out;
    box-sizing: border-box;
    width: 100%;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    background: none;
    border: none;
    color: #f0b93a;
    cursor: pointer;
}

.modal-close:hover {
    color: #ffffff;
}

.test-result {
    background-color: #3a3f47;
    border-left: 4px solid #f0b93a;
    padding: 20px;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease-out forwards;
    box-sizing: border-box;
    width: 100%;
}
.style-name {
    color: #f0b93a;
    font-weight: bold;
}

.real-test-invite p {
    font-size: 16px;
    line-height: 1.6;
    text-align: center;
    margin-bottom: 10px;
}

/* Demo Chat Styles */
.demo-chat {
    background-color: #3a3f47;
    border-radius: 10px;
    padding: 15px;
    height: 400px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    gap: 15px;
    margin-left: 0;
    margin-right: 0;
    box-sizing: border-box;
    width: 100%;
}

.demo-chat h3 {
    color: #f0b93a;
    margin: 0;
    text-align: center;
    font-size: 1.2em;
    padding: 0 10px;
}

.demo-chat .chat-messages {
    height: 100%;
    overflow-y: auto;
    padding: 12px;
    background-color: #2c3139;
    border-radius: 8px;
}

/* Стили для сообщений */
.demo-chat .message-wrapper {
    display: flex;
    align-items: flex-start;
    margin: 8px 0;
    animation: messageAppear 0.3s ease-out forwards;
}

.demo-chat .user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    flex-shrink: 0;
}

.demo-chat .trainer-avatar {
    background-color: #f0b93a;
    color: #000;
}

.demo-chat .student-avatar {
    background-color: #4a4f57;
    color: #fff;
}

.demo-chat .from-ai-avatar {
    background-color: #4caf50; /* зелёный */
    color: #fff;
}

.demo-chat .message {
    padding: 10px 14px;
    border-radius: 12px;
    max-width: 85%;
    margin: 0;
    line-height: 1.3;
    font-size: 0.95em;
}

.demo-chat .trainer-message {
    background-color: #f0b93a;
    color: #000;
}

.demo-chat .student-message {
    background-color: #4a4f57;
    color: #fff;
}

.demo-chat .from-ai-message {
    background-color: #388e3c; /* темно зелёный */
    color: #fff;
}

/* Стилизация скроллбара */
.demo-chat .chat-messages::-webkit-scrollbar {
    width: 8px;
}

.demo-chat .chat-messages::-webkit-scrollbar-track {
    background: #2c3139;
    border-radius: 4px;
    margin: 4px 0;
}

.demo-chat .chat-messages::-webkit-scrollbar-thumb {
    background: #4a4f57;
    border-radius: 4px;
    border: 2px solid #2c3139;
}

.demo-chat .chat-messages::-webkit-scrollbar-thumb:hover {
    background: #f0b93a;
}

/* Firefox */
.demo-chat .chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #4a4f57 #2c3139;
}

/* Область ввода */
.demo-chat .chat-input-area {
    background-color: #3a3f47;
    border-radius: 8px;
    padding: 9px;
}

.demo-chat textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #4a4f57;
    border-radius: 5px;
    background-color: #2c3139;
    color: #fff;
    resize: none;
    font-family: inherit;
    box-sizing: border-box;
    min-height: 50px;
    max-height: 100px;
    margin-bottom: 10px;
    font-size: 0.95em;
}

.demo-chat textarea:focus {
    outline: none;
    border-color: #f0b93a;
}

.demo-chat .cta-button {
    align-self: flex-end;
    margin: 0;
    padding: 8px 20px;
    font-size: 0.95em;
    white-space: nowrap;
    width: auto;
    min-width: 110px;
}

/* Анимация появления сообщений */
@keyframes messageAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 20px auto;
        padding: 20px;
    }

    .demo-chat {
        width: 100%;
    }

    .demo-chat .chat-input-area {
        padding: 10px;
    }

    .demo-chat .cta-button {
        width: 100%;
    }

    .demo-chat .message {
        max-width: 90%;
    }
}

/* Адаптация для ноутбуков и планшетов */
@media (max-width: 1200px) {
    .container {
        max-width: 98vw;
        padding: 0 10px;
    }
    .modal-content {
        max-width: 90vw;
        padding: 20px;
    }
    .demo-chat {
        height: 350px;
        padding: 10px;
    }
}

@media (max-width: 900px) {
    .modal-content {
        max-width: 98vw;
        padding: 12px;
    }
    .demo-chat {
        height: 300px;
        padding: 7px;
    }
    .demo-chat h3 {
        font-size: 1em;
    }
    .demo-chat .message {
        font-size: 0.9em;
        padding: 8px 10px;
    }
    .demo-chat .user-avatar {
        width: 24px;
        height: 24px;
    }
    .demo-chat .chat-input-area {
        padding: 6px;
    }
    .demo-chat .cta-button {
        font-size: 0.9em;
        min-width: 90px;
        padding: 7px 12px;
    }
}

/* Мобильная адаптация */
@media (max-width: 600px) {
    html,
    body {
        overflow-x: hidden;
    }
    .container {
        max-width: 100%;
        padding: 0 8px;
    }
    .modal-overlay {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        min-height: 100vh;
    }
    .modal-content {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 8px;
        border-radius: 0;
        box-sizing: border-box;
    }
    .demo-chat,
    .test-result,
    .real-test-invite,
    .question,
    table,
    form {
        max-width: 100%;
        box-sizing: border-box;
        padding-left: 0;
        padding-right: 0;
    }
    .demo-chat {
        width: 100%;
        padding-top: 4px;
        padding-bottom: 4px;
        margin-top: 8px;
        border-radius: 6px;
        gap: 7px;
    }
    table {
        font-size: 12px;
        overflow-x: auto;
        display: block;
    }
    .test-result,
    .real-test-invite,
    .question {
        padding: 8px;
        border-radius: 6px;
    }
    .demo-chat h3 {
        font-size: 0.95em;
        padding: 0 2px;
    }
    .demo-chat .chat-messages {
        padding: 4px;
        border-radius: 4px;
    }
    .demo-chat .message {
        font-size: 0.85em;
        padding: 6px 6px;
        border-radius: 8px;
        max-width: 98%;
    }
    .demo-chat .user-avatar {
        width: 18px;
        height: 18px;
        margin-right: 5px;
    }
    .demo-chat .chat-input-area {
        padding: 2px;
        border-radius: 4px;
    }
    .demo-chat textarea {
        min-height: 32px;
        max-height: 60px;
        font-size: 0.85em;
        padding: 4px;
        margin-bottom: 4px;
    }
    .demo-chat .cta-button {
        font-size: 0.85em;
        min-width: 60px;
        padding: 5px 8px;
    }
}

/* Глобально для всех блоков */
.container,
.modal-content,
.demo-chat,
.test-result,
.real-test-invite,
.question,
table,
form {
    box-sizing: border-box;
    width: 100%;
}

/* Для таблиц — не вылазить за пределы */
table {
    table-layout: fixed;
    word-break: break-word;
}
