:root {
    /* --- ТЕМНАЯ ТЕМА (По умолчанию) --- */
    --bg-main: #020604;       /* Глубокий черно-зеленый */
    --bg-card: #0A1410;       /* Фон карточек */
    --primary: #10B981;       /* Яркий зеленый (Emerald) */
    --primary-glow: rgba(16, 185, 129, 0.4);
    --accent: #D1FAE5;        /* Акцент (лайм/мятный) */
    
    /* Тексты */
    --text-main: #ECFDF5;     /* Основной текст (светло-мятный) */
    --text-head: #FFFFFF;     /* Заголовки (Белый) */
    --text-muted: #9CA3AF;    /* Второстепенный текст (Серый) */
    
    /* Элементы формы и границ */
    --border: rgba(16, 185, 129, 0.2);
    --input-bg: rgba(255,255,255,0.05);
    --input-border: rgba(255,255,255,0.1);
    --input-text: #FFFFFF;
}

/* --- СВЕТЛАЯ ТЕМА (Активируется классом .light-theme) --- */
body.light-theme {
    --bg-main: #F0FDF4;       /* Очень светлый мятный фон */
    --bg-card: #FFFFFF;       /* Белые карточки */
    --primary: #059669;       /* Темно-зеленый */
    --primary-glow: rgba(5, 150, 105, 0.15);
    --accent: #064E3B;        /* Акцент */
    
    /* Тексты */
    --text-main: #1F2937;     /* Текст (Почти черный) */
    --text-head: #111827;     /* Заголовки (Черный) */
    --text-muted: #4B5563;    /* Серый */
    
    /* Элементы */
    --border: rgba(0,0,0,0.1); 
    --input-bg: #FFFFFF;       
    --input-border: #D1D5DB;   
    --input-text: #000000;     
}

/* --- БАЗОВЫЕ СТИЛИ --- */
body {
    background-color: var(--bg-main);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    margin: 0;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    margin: 0;
    color: var(--text-head);
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
a { text-decoration: none; transition: 0.3s; }

/* ЯЗЫКОВОЙ ПЕРЕКЛЮЧАТЕЛЬ */
.lang-switcher {
    position: fixed;
    top: 20px; left: 20px;
    z-index: 1000;
    background: rgba(10, 20, 16, 0.6);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
    display: flex;
}

.lang-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    transition: 0.3s;
    font-family: 'Inter', sans-serif;
}

.lang-btn:hover { color: var(--text-head); background: rgba(255,255,255,0.05); }
.lang-btn.active { background: var(--primary); color: #FFFFFF; box-shadow: 0 2px 8px var(--primary-glow); }

/* Кнопка ТЕМЫ */
.theme-toggle {
    position: fixed;
    top: 20px; right: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-head);
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    z-index: 1000;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transition: 0.3s;
}
.theme-toggle:hover { transform: scale(1.1); border-color: var(--primary); }

/* Анимации (Scroll Reveal) */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.5, 0, 0, 1);
}
.reveal.active { opacity: 1; transform: translateY(0); }

/* --- HERO SECTION --- */
.hero {
    min-height: 90vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -20%; right: -10%;
    width: 60%; height: 80%;
    background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
    filter: blur(80px);
    z-index: 0;
    pointer-events: none;
}
.hero-content { position: relative; z-index: 1; max-width: 800px; }

.tag {
    display: inline-block;
    padding: 12px 24px;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid var(--primary); /* Утолщенная рамка */
    border-radius: 30px;
    
    color: var(--primary);
    font-size: 1.1rem;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    
    margin-bottom: 30px;
    text-transform: uppercase;
    letter-spacing: 2px;
    
    /* Мощное неоновое свечение (криптонит) */
    box-shadow: 
        0 0 10px rgba(16, 185, 129, 0.4),
        0 0 20px rgba(16, 185, 129, 0.3),
        0 0 30px rgba(16, 185, 129, 0.2),
        0 0 40px rgba(16, 185, 129, 0.1);
    
    /* Плавная пульсация */
    animation: neonGlow 2.5s ease-in-out infinite;
}

/* Анимация пульсации свечения */
@keyframes neonGlow {
    0%, 100% {
        box-shadow: 
            0 0 10px rgba(16, 185, 129, 0.4),
            0 0 20px rgba(16, 185, 129, 0.3),
            0 0 30px rgba(16, 185, 129, 0.2);
    }
    50% {
        box-shadow: 
            0 0 15px rgba(16, 185, 129, 0.6),
            0 0 30px rgba(16, 185, 129, 0.4),
            0 0 45px rgba(16, 185, 129, 0.3),
            0 0 60px rgba(16, 185, 129, 0.1);
    }
}



.hero h1 { font-size: 3.5rem; line-height: 1.1; margin-bottom: 24px; color: var(--text-head); }
.hero p { font-size: 1.25rem; color: var(--text-muted); margin-bottom: 40px; max-width: 600px; }

/* --- BENTO GRID --- */
.bento-section { padding: 80px 0; }
.bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 50px;
}
.bento-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 30px;
    border-radius: 24px;
    transition: 0.3s;
    position: relative;
    overflow: hidden;
}
.bento-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px var(--primary-glow);
}
.span-2 { grid-column: span 2; }
.span-3 { grid-column: span 3; }

.bento-icon { font-size: 2rem; margin-bottom: 15px; display: block; }
.bento-card h3 { font-size: 1.3rem; margin-bottom: 10px; color: var(--text-head); }
.bento-card p { font-size: 0.95rem; color: var(--text-muted); margin: 0; }

/* --- BUTTONS --- */
.btn {
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex; align-items: center; justify-content: center;
    transition: 0.3s;
    border: 2px solid transparent;
}
.btn-primary { background: var(--primary); color: #FFFFFF; }
.btn-primary:hover { filter: brightness(1.1); box-shadow: 0 0 20px var(--primary-glow); }

.btn-outline { border-color: var(--text-head); color: var(--text-head); background: transparent; }
.btn-outline:hover { background: var(--bg-card); opacity: 0.8; }

/* --- CALCULATOR SECTION (Исправленная версия) --- */

/* 1. Главный контейнер */
.calc-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 30px; /* Оптимально для десктопа и мобильных */
    max-width: 800px;
    margin: 0 auto;
    box-shadow: 0 10px 40px -10px rgba(0,0,0,0.2);
    text-align: center;
    box-sizing: border-box;
}

.calc-header { margin-bottom: 40px; }

/* 2. Поля ввода */
.calc-grid {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.calc-inputs {
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    text-align: left;
}

.calc-inputs label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
}

.calc-inputs .btn-primary {
    width: 100%;
    margin-top: 15px;
    justify-content: center;
    height: 54px;
    font-size: 1.1rem;
}

/* 3. Блок Результата */
.calc-result {
    display: none;
    margin-top: 30px;
    background: rgba(16, 185, 129, 0.05);
    border: 2px solid var(--primary);
    border-radius: 20px;
    
    /* Отступы внутри */
    padding: 30px;
    padding-bottom: 40px;
    
    text-align: center;
    box-sizing: border-box;
    width: 100%; /* Занимает всю ширину родителя */
}

/* Анимация появления */
.calc-result.active {
    display: block;
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.res-row {
    display: flex; justify-content: space-between; 
    margin-bottom: 15px; 
    font-size: 1.1rem;
    color: var(--text-main);
    border-bottom: 1px dashed var(--border);
    padding-bottom: 10px;
}

.res-row strong { font-weight: 700; color: var(--text-head); }
.res-row.good strong { color: var(--primary); }

.lost-money-block { margin-top: 30px; margin-bottom: 10px; }

.lost-amount {
    font-size: 3rem;
    font-weight: 900;
    color: #EF4444;
    text-shadow: 0 0 30px rgba(239, 68, 68, 0.25);
    margin: 10px 0 20px 0;
    display: block;
    line-height: 1;
}

/* Кнопка "Исправить" внутри результата */
.result-btn-container {
    margin-top: 30px;
}
.result-btn-container {
    margin-top: 30px;
    display: flex;             /* Включаем flex для родителя */
    justify-content: center;   /* Центрируем кнопку */
}

.result-btn-container .btn {
    display: inline-flex;      /* Кнопка подстраивается под контент */
    width: auto;               /* Ширина авто */
    min-width: 280px;          /* Минимальная ширина (чтобы не была слишком узкой) */
    max-width: 100%;           /* Чтобы не вылезала на мобильных */
    
    justify-content: center;
    padding: 16px 32px;        /* Хорошие отступы внутри */
    height: auto;
    font-size: 1rem;
    line-height: 1.4;
    text-align: center;
    
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 15px var(--primary-glow);
    border-radius: 12px;       /* Скругление */
}


/* Убираем лишние отступы у инлайн стилей в HTML, если они есть */
.calc-result > div[style] {
    margin: 0 !important;
    padding: 0 !important;
}

/* --- STATS --- */
.stats-bar {
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 60px 0;
    background: rgba(16, 185, 129, 0.02);
}
.stats-grid {
    display: flex; justify-content: space-around; flex-wrap: wrap; gap: 30px; text-align: center;
}
.stat-item .num { font-size: 3.5rem; font-weight: 800; color: var(--primary); line-height: 1; }
.stat-item .label { color: var(--text-muted); margin-top: 10px; font-size: 1.1rem; }

/* --- FAQ SECTION --- */
.faq-grid {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: 0.3s;
}

.faq-item:hover { border-color: var(--primary); }
.faq-item[open] {
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    background: rgba(255,255,255,0.03);
}

summary {
    padding: 20px 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.1rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-head);
}
summary::-webkit-details-marker { display: none; }

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary);
    transition: transform 0.3s;
    line-height: 1;
}
details[open] summary .faq-icon { transform: rotate(45deg); color: var(--text-muted); }

.faq-content {
    padding: 0 25px 25px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    animation: fadeIn 0.4s ease;
}

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

/* --- FORM --- */
.form-section { padding: 100px 0; background: var(--bg-main); }
.form-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.form-box {
    background: var(--bg-card);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 10px 40px -5px rgba(0,0,0,0.1);
}

/* Inputs */
input, select {
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: var(--input-text);
    padding: 16px;
    width: 100%;
    border-radius: 10px;
    margin-bottom: 15px;
    box-sizing: border-box;
    font-family: inherit; font-size: 1rem;
    transition: 0.3s;
}
input::placeholder { color: var(--text-muted); opacity: 0.7; }
input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-glow); }
input[type="checkbox"] { width: auto; margin-right: 10px; }

/* Footer */
footer {
    padding: 40px 0; text-align: center;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}
footer a { color: var(--primary); text-decoration: underline; }

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media (max-width: 1024px) {
    .bento-grid { grid-template-columns: 1fr 1fr; }
    .span-3 { grid-column: span 2; }
}

@media (max-width: 768px) {
    .bento-grid { grid-template-columns: 1fr; margin-top: 30px; }
    .span-2, .span-3 { grid-column: span 1; }
    
    .hero { padding: 120px 0 60px; text-align: center; }
    .hero h1 { font-size: 2.2rem; }
    .hero-content > div { justify-content: center; }
    
    .form-wrapper { grid-template-columns: 1fr; gap: 40px; }
    .form-section { padding: 60px 0; }
    .form-box { padding: 25px; }
    
    .stats-grid { flex-direction: column; gap: 40px; }
    .theme-toggle { top: 15px; right: 15px; }
    
    /* Калькулятор на мобильном */
    .calc-wrapper { padding: 20px; }
    .calc-result { padding: 20px; padding-bottom: 30px; }
    .lost-amount { font-size: 2.2rem; }
}
