/* --- Стили для Калькулятора Сна (Night Theme) --- */
:root {
    --accent-night: #818CF8; /* Indigo 400 */
    --accent-night-dark: #312E81;
    --gradient-night-card: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
    --text-night-light: #E0E7FF;
}

.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

.calc-grid { display: grid; grid-template-columns: 1fr; gap: 24px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1fr 1.2fr; } }

/* Inputs */
.calc-inputs { gap: 24px; }
.input-group { margin-bottom: 24px; }
.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }

/* --- ДОБАВЛЕНО: Переключатель режимов --- */
.mode-switcher {
    display: flex; background: #F3F4F6; padding: 4px;
    border-radius: 12px; margin-bottom: 24px; gap: 4px;
}
.mode-btn {
    flex: 1; padding: 10px 4px; border: none; background: transparent;
    color: var(--text-secondary); font-size: 13px; font-weight: 600;
    border-radius: 8px; cursor: pointer; transition: all 0.2s; text-align: center;
}
.mode-btn.active { 
    background: #fff; 
    color: var(--text-primary); 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
}
.mode-btn:hover:not(.active) { color: var(--text-primary); }

/* Time Input */
.time-input-container {
    display: flex; align-items: center; gap: 12px;
}
.main-time-input {
    flex-grow: 1; padding: 12px 16px; 
    font-size: 24px; font-weight: 700; font-family: monospace;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: border 0.2s;
    background: #fff;
    -webkit-appearance: none;
}
.main-time-input:focus { border-color: var(--accent-night); }

.btn-now-text {
    background: #EEF2FF; color: var(--accent-night-dark); border: none;
    font-weight: 700; padding: 0 16px; height: 56px; border-radius: 12px;
    cursor: pointer; transition: all 0.2s; white-space: nowrap;
}
.btn-now-text:hover { background: #E0E7FF; }

/* Range Slider */
.range-wrapper { margin-top: 8px; }
.row-value-top { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.range-val { font-weight: 700; color: var(--accent-night-dark); font-size: 16px; }

.range-slider {
    width: 100%; -webkit-appearance: none; height: 6px;
    background: #E5E7EB; border-radius: 5px; cursor: pointer;
}
.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: var(--accent-night-dark); cursor: pointer; border: 2px solid #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2); transition: transform 0.1s;
}

.sleep-note {
    font-size: 12px; background: #EEF2FF; padding: 12px; border-radius: 8px;
    color: #4338CA; line-height: 1.4;
}

/* --- Результаты (Night Card) --- */
.card--night { 
    background: var(--gradient-night-card); 
    color: #fff; 
    border: none; 
    position: relative; overflow: hidden;
}
.card--night::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-image: 
        radial-gradient(white, rgba(255,255,255,.2) 2px, transparent 3px),
        radial-gradient(white, rgba(255,255,255,.15) 1px, transparent 2px),
        radial-gradient(white, rgba(255,255,255,.1) 2px, transparent 3px);
    background-size: 550px 550px, 350px 350px, 250px 250px;
    background-position: 0 0, 40px 60px, 130px 270px;
    opacity: 0.1; pointer-events: none;
}

.card--night h2 { color: rgba(255,255,255,0.9); margin-bottom: 24px; font-size: 16px; position: relative; z-index: 2; }

/* ВИЗУАЛЬНЫЙ ЧАСЫ */
.sleep-visual-clock {
    display: flex; justify-content: center; margin-bottom: 24px; position: relative; z-index: 2;
}
.clock-circle {
    width: 220px; height: 220px; border-radius: 50%;
    background: rgba(255,255,255,0.1); 
    position: relative;
    transition: background 0.5s ease;
    box-shadow: 0 0 30px rgba(129, 140, 248, 0.1);
    display: flex; align-items: center; justify-content: center;
}
.clock-circle::after {
    content: ''; position: absolute; width: 70%; height: 70%;
    background: #252355; border-radius: 50%;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.3);
}

.clock-center-text {
    position: relative; z-index: 3; text-align: center;
    display: flex; flex-direction: column;
}
#best-time { font-size: 36px; font-weight: 700; line-height: 1; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.clock-center-text small { font-size: 11px; opacity: 0.7; text-transform: uppercase; margin-top: 4px; }

/* Список циклов */
.cycles-list {
    display: grid; grid-template-columns: 1fr 1fr; gap: 12px; position: relative; z-index: 2;
}
.cycle-card {
    background: rgba(255,255,255,0.1); border-radius: 12px; padding: 12px;
    display: flex; flex-direction: column; align-items: center; text-align: center;
    border: 1px solid rgba(255,255,255,0.05); transition: background 0.2s;
}
.cycle-card.best {
    background: rgba(16, 185, 129, 0.2); border-color: rgba(16, 185, 129, 0.4);
}
.cycle-time { font-size: 20px; font-weight: 700; margin-bottom: 2px; }
.cycle-info { font-size: 11px; opacity: 0.8; }
.cycle-badge { 
    font-size: 10px; background: rgba(255,255,255,0.2); 
    padding: 2px 6px; border-radius: 4px; margin-bottom: 6px; 
}

.summary-divider { height: 1px; background: rgba(255,255,255,0.15); margin: 24px 0; position: relative; z-index: 2; }

/* --- НОВЫЕ ИНФОРМАЦИОННЫЕ БЛОКИ (Адаптация под Night/Sleep) --- */

.info-wrapper {
    padding: 60px 0 60px 0;
    margin-top: 60px;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-bottom: 20px;
}

.info-wrapper .container {
    max-width: 800px;
    margin: 0 auto;
}

/* Заголовки с иконками */
.icon-heading {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.3;
}

.header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    flex-shrink: 0;
    margin-top: -4px;
}

.header-icon svg { width: 24px; height: 24px; stroke-width: 2px; }

/* Цвета иконок */
.blue-icon svg { color: #3B82F6; }
.purple-icon svg { color: #818CF8; } /* Indigo */
.green-icon svg { color: #10B981; }
.red-icon svg { color: #EF4444; }
.yellow-icon svg { color: #F59E0B; }

/* Маленькие подзаголовки */
.small-heading {
    margin-top: 40px;
    margin-bottom: 16px;
    font-size: 20px;
}
.small-heading .header-icon { width: 40px; height: 40px; }
.small-heading .header-icon svg { width: 20px; height: 20px; }

.intro-text {
    font-size: 16px;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

/* --- Секция Формул --- */
.formulas-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 48px;
}

.formula-card {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    border-radius: 24px; 
    padding: 24px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    display: flex;
    flex-direction: column;
}
.formula-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.08); }

/* Вертикальный хедер (бейдж сверху) */
.formula-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.formula-card h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Бейджи */
.badge-blue {
    background: #3B82F6; color: #fff;
    padding: 6px 12px; border-radius: 99px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    display: inline-block;
}
.badge-green {
    background: #10B981; color: #fff;
    padding: 6px 12px; border-radius: 99px;
    font-size: 11px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.05em;
    display: inline-block;
}

.formula-card p {
    font-size: 14px; color: var(--text-secondary);
    margin: 0; line-height: 1.5; font-weight: 500;
}

.math-expression {
    background: #EEF2FF; /* Indigo Light */
    border: 1px solid #E0E7FF;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    color: var(--accent-night); /* Indigo Accent */
    text-align: center;
    margin-bottom: 16px;
    font-size: 15px;
}

/* Разделитель */
.soft-divider {
    border: none; height: 1px;
    background: linear-gradient(90deg, transparent, #E5E7EB, transparent);
    margin: 48px 0;
}

/* Описание */
.calc-description p {
    font-size: 16px; line-height: 1.7;
    color: var(--text-secondary); margin-bottom: 24px;
}
.calc-description strong { color: var(--text-primary); }

/* FAQ (Новый стиль под Night/Sleep) */
.faq-section .faq-item {
    background: #fff; border: 1px solid #E5E7EB;
    border-radius: 12px; margin-bottom: 12px;
    overflow: hidden; transition: all 0.2s ease;
}

.faq-section .faq-item[open] {
    border-color: var(--accent-night); 
    box-shadow: 0 4px 20px rgba(129, 140, 248, 0.15); /* Indigo Shadow */
}

summary.faq-question {
    padding: 16px 20px; cursor: pointer;
    font-weight: 600; color: var(--text-primary);
    list-style: none; position: relative;
    display: flex; justify-content: space-between;
    align-items: center; transition: background 0.2s;
}

summary.faq-question:hover { background-color: #F9FAFB; }

.faq-section .faq-item[open] summary.faq-question {
    color: var(--accent-night);
    background: #EEF2FF;
}

.faq-question::after {
    content: '+'; font-size: 20px;
    color: var(--text-secondary); font-weight: 400; line-height: 1;
}
.faq-question .icon-plus { display: none; }

.faq-section .faq-item[open] summary.faq-question::after {
    content: '−'; color: var(--accent-night);
}

.faq-answer {
    padding: 20px; color: var(--text-secondary);
    line-height: 1.6; font-size: 15px;
}

/* --- МОБИЛЬНАЯ АДАПТАЦИЯ --- */
@media (max-width: 900px) {
    .formulas-grid { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
    .icon-heading { font-size: 20px; gap: 12px; margin-bottom: 20px; }
    .header-icon { width: 40px; height: 40px; border-radius: 12px; }
    .header-icon svg { width: 20px; height: 20px; }
    
    .formula-card { padding: 24px; text-align: center; align-items: center; }
    .formula-header { align-items: center; width: 100%; }
    .math-expression { width: 100%; max-width: 300px; margin-left: auto; margin-right: auto; }
    
    .info-wrapper { margin-top: 40px; padding-top: 40px; }
}