/* Базовые переменные и настройки */
:root {
    --primary: #22c55e;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-alt: #152033;
    --text-main: #f8fafc;
    --text-dim: #94a3b8;
    --accent-blue: #38bdf8;
    --radius: 20px;
}

* { box-sizing: border-box; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.7;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

.container { max-width: 1100px; margin: auto; padding: 60px 20px; }

/* Типографика */
h1, h2, h3 { margin-top: 0; line-height: 1.3; }
h1 { font-size: clamp(32px, 5vw, 48px); font-weight: 800; margin-bottom: 24px; text-align: center; }
h1 span { color: var(--primary); }
h2 { font-size: clamp(26px, 4vw, 36px); margin-bottom: 40px; text-align: center; }
h3 { font-size: 22px; color: var(--primary); margin-bottom: 15px; }
p { margin-bottom: 20px; font-size: 16px; color: var(--text-dim); }

/* Кнопки */
.btn {
    background: var(--primary); padding: 18px 36px; border-radius: 12px;
    color: #000; text-decoration: none; display: inline-flex; justify-content: center;
    align-items: center; font-weight: 800; border: none; cursor: pointer;
    transition: 0.3s; text-transform: uppercase; letter-spacing: 0.5px; width: fit-content;
}
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 25px rgba(34, 197, 94, 0.4); }

/* Главная страница: Шапка и Видео */
header { text-align: center; padding-top: 80px; }
.hero-subtitle { font-size: 20px; max-width: 700px; margin: 0 auto 30px; color: var(--text-main); padding: 0 10px; }
.video-container {
    max-width: 320px; margin: 40px auto; border-radius: 24px; overflow: hidden;
    box-shadow: 0 25px 50px rgba(0,0,0,0.6); border: 4px solid var(--bg-card); background: #000;
}
video { width: 100%; display: block; cursor: pointer; object-fit: cover; }

/* Сетка и Карточки */
.grid { display: grid; gap: 30px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }

.card { background: var(--bg-card); padding: 40px; border-radius: var(--radius); border: 1px solid rgba(255,255,255,0.05); transition: 0.3s; }
.card:hover { border-color: var(--primary); transform: translateY(-5px); }
.price-badge { font-size: 32px; font-weight: 800; color: var(--accent-blue); display: block; margin-bottom: 15px; }

/* SEO Блоки */
.seo-section { background: var(--bg-alt); border-radius: var(--radius); padding: 50px; margin: 40px 0; }
.seo-section h2 { text-align: left; margin-bottom: 25px; }
.seo-section p { color: var(--text-main); font-size: 17px; }
.ref-section { background: linear-gradient(145deg, #152033, #0f172a); border: 1px solid var(--primary); }
.ref-section h2 { text-align: center; color: var(--primary); }

/* Калькулятор */
.calc-box {
    background: linear-gradient(145deg, #1e293b, #0f172a); padding: 50px; border-radius: var(--radius);
    text-align: center; border: 1px solid var(--primary); margin-bottom: 60px;
}
input[type=range] { width: 100%; margin: 30px 0; accent-color: var(--primary); }
.calc-result { font-size: clamp(40px, 8vw, 54px); font-weight: 800; color: var(--primary); line-height: 1; margin: 20px 0; }

/* Квиз и Форма */
.quiz-wrapper { background: var(--bg-card); padding: 50px; border-radius: var(--radius); max-width: 600px; margin: 0 auto; text-align: center; }
.quiz-option {
    display: block; width: 100%; padding: 18px; margin: 12px 0;
    background: rgba(255,255,255,0.03); border: 1px solid #334155;
    color: #fff; border-radius: 12px; cursor: pointer; font-size: 16px; transition: 0.2s;
}
.quiz-option:hover { background: var(--primary); color: #000; border-color: var(--primary); }

input[type="text"], input[type="tel"] {
    width: 100%; padding: 18px; margin-bottom: 15px; border-radius: 12px;
    border: 1px solid #334155; background: #020617; color: #fff; font-size: 16px; transition: 0.3s;
}
input:focus { outline: none; border-color: var(--primary); }
.error-msg { color: #ef4444; font-size: 14px; text-align: left; margin: -10px 0 15px 5px; display: none; }

#success-message { display: none; padding: 40px 20px; animation: fadeIn 0.5s ease; }
#success-message h2 { color: var(--primary); font-size: 32px; margin-bottom: 15px; }
#success-message p { font-size: 18px; color: var(--text-main); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

footer { text-align: center; padding: 40px 20px; color: var(--text-dim); font-size: 14px; border-top: 1px solid #1e293b; background: var(--bg-card); }

/* --- СТИЛИ ДЛЯ СТРАНИЦЫ 404 --- */
.wrapper-404 {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    background-image: radial-gradient(circle at 50% 0%, #1e293b 0%, #0f172a 70%);
}
.error-box {
    background: var(--bg-card); padding: 60px 40px; border-radius: 24px;
    border: 1px solid rgba(34, 197, 94, 0.2); text-align: center; max-width: 500px; width: 100%;
    box-shadow: 0 25px 50px rgba(0,0,0,0.5), 0 0 40px rgba(34, 197, 94, 0.05);
    animation: float 6s ease-in-out infinite;
}
.error-code {
    font-size: clamp(80px, 15vw, 120px); font-weight: 800; color: var(--primary);
    line-height: 1; margin: 0 0 20px 0; text-shadow: 0 0 30px rgba(34, 197, 94, 0.4);
}
@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}
/* Стили для модального окна (Popup) */
.modal {
    display: none; 
    position: fixed; 
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%; 
    height: 100%; 
    background-color: rgba(0,0,0,0.85);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--bg-card);
    margin: 5% auto;
    padding: 40px;
    border: 1px solid var(--primary);
    border-radius: var(--radius);
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: var(--text-dim);
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
}

.close-modal:hover { color: var(--primary); }

.modal-text {
    overflow-y: auto;
    padding-right: 15px;
    text-align: left;
}

.modal-text h3 {
    font-size: 18px;
    margin-top: 25px;
    color: var(--text-main);
}

.modal-text p {
    font-size: 14px;
    line-height: 1.6;
}

/* Кастомизация скроллбара внутри попапа */
.modal-text::-webkit-scrollbar { width: 6px; }
.modal-text::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 10px; }

.policy-checkbox-wrapper {
    margin: 15px 0;
    text-align: left;
}

.custom-checkbox {
    display: flex;
    align-items: flex-start;
    position: relative;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.4;
    user-select: none;
}

.custom-checkbox input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    min-width: 18px;
    height: 18px;
    background-color: #020617;
    border: 1px solid #334155;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    margin-top: 2px;
}

.custom-checkbox:hover input ~ .checkmark { border-color: var(--primary); }
.custom-checkbox input:checked ~ .checkmark { background-color: var(--primary); border-color: var(--primary); }

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 4px;
    height: 8px;
    border: solid #000;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after { display: block; }

.label-text a {
    color: var(--primary);
    text-decoration: underline;
}
/* Стили для FAQ Аккордеона */
.faq-section {
    max-width: 800px;
    margin: 0 auto;
}

.faq-item {
    background: var(--bg-card);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    margin-bottom: 15px;
    overflow: hidden;
    transition: 0.3s;
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question {
    padding: 20px 25px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 18px;
    color: var(--text-main);
    user-select: none;
}

.faq-icon {
    color: var(--primary);
    font-size: 24px;
    transition: transform 0.3s ease;
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
    background: rgba(0, 0, 0, 0.1);
}

.faq-answer p {
    padding: 0 25px 20px 25px;
    margin: 0;
    font-size: 15px;
    color: var(--text-dim);
}

/* Класс для открытого состояния */
.faq-item.active .faq-answer {
    max-height: 200px; /* Достаточно для текста */
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
    color: #ef4444; /* Можно сменить цвет при открытии */
}


/* Адаптивность для мобильных */
@media(max-width: 768px) {
    .container { padding: 40px 20px; }
    header { padding-top: 40px; }
    .hero-subtitle { font-size: 18px; }
    .card, .error-box { padding: 30px 20px; }
    .seo-section, .calc-box, .quiz-wrapper { padding: 30px 20px; margin: 30px 0; }
    .seo-section h2 { text-align: center; }
    .btn { width: 100%; }
}