/* === Общие настройки и сбросы === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.2s ease; /* Плавные переходы для всех свойств */
}

body {
    font-family: 'Inter', sans-serif; /* Современный шрифт */
    background: linear-gradient(135deg, #121212, #1a1a1a); /* Градиентный фон */
    color: #e0e0e0; /* Светлый текст */
    text-align: center;
    padding: 40px 20px;
    min-height: 100vh;
    background-attachment: fixed;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased; /* Улучшенное сглаживание шрифтов */
    -moz-osx-font-smoothing: grayscale;
}

/* === Стилизация полосы прокрутки === */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(20, 20, 20, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: rgba(120, 120, 120, 0.4);
    border-radius: 3px;
    transition: background 0.2s ease;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(150, 150, 150, 0.6);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Для Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(120, 120, 120, 0.4) rgba(20, 20, 20, 0.2);
}

/* === Анимированный фон с частицами === */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    pointer-events: none;
}

.particle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
}

/* === Эффект параллакса === */
.parallax {
    transform: translateZ(0);
    will-change: transform;
}

/* === Основной контейнер === */
.container {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* === Заголовки === */
h1 {
    font-size: 2.4rem;
    margin-bottom: 16px;
    color: #a0d879; /* Акцентный зеленый */
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 1;
    font-weight: 700;
}

.subtitle {
    font-size: 1.4rem;
    margin-bottom: 24px;
    color: #e06666; /* Акцентный красный */
    font-weight: 500;
    position: relative;
    z-index: 1;
}

/* === Обычный текст === */
p {
    font-size: 1.1rem;
    margin-bottom: 24px;
    color: #aaa;
    line-height: 1.6;
    position: relative;
    z-index: 1;
}

/* === Блок с особенностями === */
.features {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 20px;
    margin: 30px 0;
    text-align: left;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
    border-left: 4px solid #e06666; /* Акцентная левая граница */
}

.feature-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.feature-item:hover {
    transform: translateX(5px);
}

.feature-item:last-child {
    margin-bottom: 0;
}

.feature-icon {
    font-size: 1.6rem;
    margin-right: 12px;
    color: #e06666;
    transition: transform 0.3s ease;
}

.feature-item:hover .feature-icon {
    transform: rotate(15deg) scale(1.1);
}

/* === Кнопки общие === */
.btn {
    display: inline-block;
    background: linear-gradient(45deg, #e06666, #c41e3a); /* Градиентный фон */
    color: white;
    padding: 16px 30px;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 600;
    text-decoration: none;
    margin: 20px 0;
    box-shadow: 0 4px 15px rgba(224, 102, 102, 0.4); /* Тень */
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 102, 102, 0.6);
    background: linear-gradient(45deg, #c41e3a, #9d1a21);
}

/* === Контейнер для кнопок === */
.btn-container {
    margin: 30px 0;
}

/* === Футер === */
.footer {
    margin-top: 40px;
    font-size: 0.9rem;
    color: #666;
    text-align: center;
    position: relative;
    z-index: 1;
}

.social-proof {
    font-size: 0.95rem;
    color: #666;
    margin: 15px 0;
    font-style: italic;
    position: relative;
    z-index: 1;
}

/* === Анимации === */

/* Анимация заголовка */
.animated-title {
    position: relative;
    overflow: hidden;
    display: inline-block;
}

.animated-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #e06666, transparent);
    animation: shine 2s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Анимация пульсации (для Telegram-виджета) */
.telegram-widget-container {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* Эффект появления при загрузке */
.container > * {
    opacity: 0;
    transform: translateY(30px);
}

.animate-in {
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.3s; }
.delay-3 { animation-delay: 0.5s; }
.delay-4 { animation-delay: 0.7s; }
.delay-5 { animation-delay: 0.9s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Анимация плавающих иконок */
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-8px); }
    100% { transform: translateY(0px); }
}

.floating {
    animation: float 3s ease-in-out infinite;
}

.floating:nth-child(1) { animation-delay: 0s; }
.floating:nth-child(2) { animation-delay: 0.7s; }
.floating:nth-child(3) { animation-delay: 1.4s; }
.floating:nth-child(4) { animation-delay: 2.1s; }

/* === Стили для формы авторизации/регистрации === */
.auth-container {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 15px;
    padding: 20px;
    margin: 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

/* Вкладки формы (Telegram/Email) - СТИЛЬ КНОПОК ВКЛАДОК */
.auth-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.auth-tab {
    /* Стиль как у кнопки */
    background: #333;
    color: #aaa;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 1rem;
    /* Минимальная ширина для равномерного распределения */
    flex: 1;
    max-width: 200px;
}

.auth-tab.active {
    background: linear-gradient(45deg, #e06666, #c41e3a);
    color: white;
    box-shadow: 0 2px 8px rgba(224, 102, 102, 0.3);
}

.auth-tab:hover:not(.active) {
    background: #444;
    transform: translateY(-1px);
}

.auth-content {
    min-height: 200px;
}

.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

/* Вкладки внутри Email формы (Регистрация/Вход) - СТИЛЬ КНОПОК ВКЛАДОК */
.form-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    gap: 10px;
}

.form-tab {
    /* Стиль как у кнопки */
    background: #333;
    color: #aaa;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 0.9rem;
    /* Минимальная ширина для равномерного распределения */
    flex: 1;
    max-width: 150px;
}

.form-tab.active {
    background: linear-gradient(45deg, #4a90e2, #6200EA);
    color: white;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.3);
}

.form-tab:hover:not(.active) {
    background: #444;
    transform: translateY(-1px);
}

/* Подформы (регистрация, вход, восстановление) */
.auth-sub-form {
    display: none;
    text-align: left;
}

.auth-sub-form.active {
    display: block;
}

/* Группы полей ввода */
.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #ccc;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #ddd;
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* Кнопки внутри формы - СТИЛЬ КНОПОК ФОРМЫ */
.btn-primary {
    width: 100%;
    padding: 12px;
    background: linear-gradient(45deg, #4a90e2, #6200EA);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
    background: linear-gradient(45deg, #3a7bca, #5200c9);
}

.btn-primary:active {
    transform: scale(0.98);
}

/* Ссылки внутри формы */
.form-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #4a90e2;
    text-decoration: none;
    font-size: 0.9rem;
}

.form-link:hover {
    text-decoration: underline;
}

/* Примечания */
.form-note {
    font-size: 0.8rem;
    color: #777;
    text-align: center;
    margin-top: 15px;
    line-height: 1.4;
}

.form-note a {
    color: #4a90e2;
    text-decoration: none;
}

.form-note a:hover {
    text-decoration: underline;
}

.auth-note {
    font-size: 0.85rem;
    color: #777;
    margin-top: 15px;
    line-height: 1.4;
}

/* === Стили для флеш-сообщений === */
.flash-messages {
    margin-bottom: 20px;
}

.flash-message {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    position: relative;
    text-align: left;
}

.flash-error {
    background-color: #2a1a1a;
    color: #f8d7da;
    border: 1px solid #e06666;
    box-shadow: 0 2px 8px rgba(224, 102, 102, 0.2);
}

.flash-success {
    background-color: #1a2a1a;
    color: #d4edda;
    border: 1px solid #a0d879;
    box-shadow: 0 2px 8px rgba(160, 216, 121, 0.2);
}

.flash-message .close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-weight: bold;
    background: none;
    border: none;
    font-size: 18px;
    color: inherit;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
}

.flash-message .close-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* === Стили для модальных окон === */

/* Общий оверлей */
.modal-overlay {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 3000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
    visibility: visible;
}

/* Основное окно модалки */
.modal {
    background: #1e1e1e;
    border-radius: 16px;
    width: 90%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7);
    border: 1px solid #333;
    animation: modalFadeIn 0.4s ease forwards;
}

@keyframes modalFadeIn {
    0% { opacity: 0; transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

/* Заголовок модалки */
.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    color: #a0d879;
    font-size: 1.4rem;
    margin: 0;
    font-weight: 600;
}

/* Кнопка закрытия */
.modal-close {
    background: none;
    border: none;
    font-size: 1.8rem;
    color: #aaa;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: scale(1.1);
}

/* Тело модалки */
.modal-body {
    padding: 24px;
    color: #e0e0e0;
    line-height: 1.6;
}

/* Футер модалки */
.modal-footer {
    padding: 16px 24px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #333;
    background: rgba(30, 30, 30, 0.8);
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.modal-footer button {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.btn-cancel {
    background: #555;
    color: white;
}

.btn-submit {
    background: linear-gradient(45deg, #4a90e2, #6200EA);
    color: white;
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.modal-footer button:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.4);
}

.modal-footer button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* === Стили для уведомлений (Toast) === */
#toast-container {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 300px;
}

.toast {
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    text-align: center;
    opacity: 0;
    animation: slideUp 0.3s forwards;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.toast-success {
    background: #4CAF50;
}

.toast-error {
    background: #f44336;
}

@keyframes slideUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Адаптивность === */
@media (max-width: 480px) {
    body {
        padding: 16px;
    }

    .modal {
        width: 95%;
        max-width: 500px;
    }

    .auth-tab,
    .form-tab {
        padding: 8px 12px;
        font-size: 0.8rem;
    }

    .form-group input,
    .btn-primary {
        font-size: 0.95rem;
        padding: 8px 10px;
    }

    .btn {
        font-size: 0.9rem;
        padding: 12px;
    }

    .form-link,
    .form-note {
        font-size: 0.8rem;
    }

    .flash-message {
        font-size: 0.9rem;
        padding: 12px;
    }

    .social-proof,
    .footer {
        font-size: 0.8rem;
    }
    
    /* Адаптация для маленьких экранов: кнопки вкладок на всю ширину */
    .auth-tabs,
    .form-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .auth-tab,
    .form-tab {
        width: 100%;
        max-width: none;
        margin-bottom: 5px;
    }
}

/* === Стили для превью вопросов теста === */
.quiz-preview-questions {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.quiz-preview-questions h3 {
    color: #a0d879;
    font-size: 1.4rem;
    margin-bottom: 20px;
    text-align: center;
}

.quiz-question-preview {
    background: rgba(40, 40, 40, 0.6);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.quiz-question-preview:last-child {
    margin-bottom: 0;
}

.quiz-question-preview h4 {
    color: #e0e0e0;
    font-size: 1.1rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.question-options {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.option {
    background: rgba(50, 50, 50, 0.8);
    border-radius: 8px;
    padding: 12px 15px;
    color: #ccc;
    font-size: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.option:hover {
    background: rgba(60, 60, 60, 0.8);
    border-color: rgba(255, 255, 255, 0.2);
}

.option-image {
    max-width: 80px;
    max-height: 80px;
    border-radius: 5px;
    object-fit: cover;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === Стили для информационного блока теста === */
.quiz-preview-info {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 15px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.quiz-preview-info p {
    margin: 10px 0;
    color: #ccc;
    font-size: 1rem;
}

/* Адаптивность для вопросов */
@media (min-width: 768px) {
    .question-options {
        grid-template-columns: 1fr 1fr;
    }
    
    .option-image {
        max-width: 100px;
        max-height: 100px;
    }
}

@media (min-width: 1024px) {
    .question-options {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* === Стили для реферального блока === */
.referral-info {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 15px;
    padding: 25px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.referrer-card {
    display: flex;
    align-items: center;
    background: rgba(40, 40, 40, 0.6);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.referrer-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
    border: 2px solid #a0d879;
}

.referrer-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(160, 216, 121, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-right: 15px;
    border: 2px solid #a0d879;
}

.referrer-details {
    flex: 1;
    text-align: left;
}

.referrer-name {
    font-size: 1.2rem;
    color: #a0d879;
    font-weight: 600;
    margin: 5px 0;
}

.referrer-name a {
    color: #4a90e2;
    text-decoration: none;
}

.referrer-name a:hover {
    text-decoration: underline;
}

.friendship-test-description {
    color: #ccc;
    font-size: 0.95rem;
    line-height: 1.4;
}

.username {
    color: #4a90e2;
    font-weight: 500;
}

/* === Стили для секции теста === */
.test-info {
    background: rgba(40, 40, 40, 0.6);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: left;
}

.test-info h2 {
    color: #e06666;
    font-size: 1.3rem;
    margin-bottom: 15px;
    text-align: center;
}

.test-info ul {
    list-style: none;
    padding: 0;
}

.test-info li {
    padding: 8px 0;
    padding-left: 25px;
    position: relative;
    color: #ccc;
    font-size: 0.95rem;
}

.test-info li:before {
    content: "✓";
    color: #a0d879;
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* === Стили для секции преимуществ === */
.features-section {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 15px;
    padding: 25px;
    margin: 30px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    z-index: 1;
}

.features-section h2 {
    color: #a0d879;
    font-size: 1.4rem;
    margin-bottom: 20px;
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.feature-card {
    background: rgba(40, 40, 40, 0.6);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.feature-card h3 {
    color: #e06666;
    font-size: 1.2rem;
    margin-bottom: 10px;
}

.feature-card p {
    color: #ccc;
    font-size: 0.95rem;
    margin-bottom: 0;
}

/* === Стили для бонусной информации === */
.bonus-info {
    background: rgba(160, 216, 121, 0.1);
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    border: 1px solid rgba(160, 216, 121, 0.2);
    color: #a0d879;
    font-size: 0.9rem;
}

/* === Адаптивность для новых элементов === */
@media (max-width: 480px) {
    .referral-info,
    .features-section {
        padding: 20px 15px;
    }
    
    .referrer-card {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    
    .referrer-avatar,
    .referrer-avatar-placeholder {
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .referrer-details {
        text-align: center;
    }
    
    .test-info {
        padding: 15px;
    }
    
    .features-grid {
        gap: 15px;
    }
    
    .feature-card {
        padding: 15px;
    }
}

@media (min-width: 768px) {
    .features-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .referrer-name {
        font-size: 1.3rem;
    }
}

@media (min-width: 1024px) {
    .features-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }
    
    .referrer-card {
        padding: 25px;
    }
}

/* === Дополнительные стили для формы === */
.auth-form h2 {
    color: #a0d879;
    font-size: 1.3rem;
    margin-bottom: 20px;
}

.cta-button {
    width: 100%;
    padding: 14px;
    background: linear-gradient(45deg, #e06666, #c41e3a);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(224, 102, 102, 0.4);
    margin-top: 15px;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(224, 102, 102, 0.6);
    background: linear-gradient(45deg, #c41e3a, #9d1a21);
}

/* === Стили для ссылок в реферальном блоке === */
.referral-info a {
    color: #4a90e2;
    text-decoration: none;
    font-weight: 500;
}

.referral-info a:hover {
    text-decoration: underline;
}

/* === Стили для заголовков в реферальном блоке === */
.referral-info h1 {
    color: #a0d879;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.referral-info h2 {
    color: #e06666;
    font-size: 1.4rem;
    margin: 20px 0 15px 0;
}