/* --- Стили для Калькулятора Возраста (Indigo Theme) --- */
:root {
    --accent-indigo: #4338CA;
    --accent-indigo-light: #EEF2FF;
    --gradient-indigo-card: linear-gradient(135deg, #6366F1 0%, #4338CA 100%);
}

.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: 1.2fr 0.8fr; 
    } 
}

/* --- Поля ввода (Обновленный стиль) --- */
.dob-wrapper {
    display: flex; 
    gap: 12px;
    width: 100%; /* Гарантируем ширину */
}

/* Стандартизация под общие инпуты (высота 54px) */
.input-date, .select-date {
    padding: 0 16px; 
    height: 54px;
    border: 1px solid #E5E7EB; 
    border-radius: 12px;
    font-size: 18px; 
    font-weight: 500;
    font-family: inherit; 
    outline: none;
    transition: border 0.2s, box-shadow 0.2s;
    background: #fff;
    box-sizing: border-box;
}

.input-date {
    text-align: center; 
    width: 80px; 
    flex-shrink: 0; /* Запрещаем сжимать день */
}

.input-year { 
    width: 110px; 
    flex-grow: 1; 
}

.select-date {
    flex-grow: 2; 
    cursor: pointer; 
    appearance: none; 
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
    padding-right: 2.5rem;
    min-width: 0; /* Критично для Flexbox, чтобы текст обрезался, а не распирал блок */
    white-space: nowrap;
    text-overflow: ellipsis;
}

.input-date:focus, .select-date:focus { 
    border-color: var(--accent-indigo); 
    box-shadow: 0 0 0 3px rgba(67, 56, 202, 0.15); 
}

/* Убираем стрелки у input number */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

.full-width { 
    width: 100%; 
    margin-top: 16px; 
}
.error-text { 
    color: #EF4444; 
    margin-top: 8px; 
    font-size: 13px; 
}

/* --- АДАПТИВ ДЛЯ МОБИЛЬНЫХ (FIX) --- */
@media (max-width: 480px) {
    .dob-wrapper {
        gap: 8px; /* Уменьшаем отступ между полями */
    }
    
    .input-date {
        width: 60px; /* Делаем поле дня уже */
        padding: 0 4px; /* Уменьшаем внутренние отступы */
        font-size: 16px; /* Чуть меньше шрифт, чтобы влезло */
    }
    
    .input-year {
        width: 80px; /* Делаем поле года уже */
        flex-grow: 0; /* Не даем году растягиваться, отдаем место месяцу */
        font-size: 16px;
        padding: 0 4px;
    }
    
    .select-date {
        padding-right: 20px; /* Уменьшаем отступ стрелки */
        padding-left: 8px;
        background-position: right 4px center; /* Сдвигаем стрелку */
        font-size: 16px;
    }
}

/* --- Блок с фактами --- */
.facts-container {
    margin-top: 32px; 
    padding-top: 24px; 
    border-top: 1px solid #F3F4F6;
    animation: fadeIn 0.5s ease;
}
.facts-container h3 { 
    font-size: 16px; 
    margin-bottom: 16px; 
    color: var(--text-primary); 
}
.fact-row {
    display: flex; 
    align-items: center; 
    gap: 16px; 
    margin-bottom: 16px;
}
.fact-icon {
    width: 40px; 
    height: 40px; 
    background: #EEF2FF; 
    border-radius: 10px;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 20px;
    flex-shrink: 0;
}
.fact-info { 
    display: flex; 
    flex-direction: column; 
}
.fact-val { 
    font-weight: 700; 
    font-size: 16px; 
    color: var(--text-primary); 
}
.fact-label { 
    font-size: 12px; 
    color: var(--text-secondary); 
}
.hidden { 
    display: none; 
}

/* --- Карточка результата (Indigo) --- */
.card--indigo { 
    background: var(--gradient-indigo-card); 
    color: #fff; 
    text-align: center; 
    border: none; 
}
.card--indigo h2 { 
    color: rgba(255,255,255,0.8); 
    font-size: 14px; 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    margin-bottom: 12px; 
}

.age-main { 
    font-size: 72px; 
    font-weight: 800; 
    line-height: 1; 
    margin-bottom: 4px; 
}
@media (max-width: 480px) {
    .age-main { font-size: 56px; }
}

.age-main small { 
    font-size: 24px; 
    font-weight: 500; 
    opacity: 0.8; 
}
.age-details { 
    font-size: 18px; 
    opacity: 0.9; 
    font-weight: 500; 
    margin-bottom: 24px; 
}

.summary-divider { 
    height: 1px; 
    background: rgba(255,255,255,0.2); 
    margin: 0 auto 24px; 
    width: 80%; 
}

/* --- Живой таймер (Ticker) --- */
.live-ticker {
    display: flex; 
    justify-content: center; 
    align-items: center; 
    gap: 8px;
    background: rgba(0,0,0,0.2); 
    padding: 16px; 
    border-radius: 16px;
    margin-bottom: 24px;
}
.ticker-item { 
    display: flex; 
    flex-direction: column; 
    width: 44px; 
}
.ticker-item span { 
    font-size: 24px; 
    font-weight: 700; 
    font-variant-numeric: tabular-nums; 
}
.ticker-item label { 
    font-size: 10px; 
    opacity: 0.7; 
    text-transform: uppercase; 
}
.colon { 
    font-size: 24px; 
    font-weight: 700; 
    padding-bottom: 12px; 
    opacity: 0.5; 
}
.highlight span { 
    color: #A5B4FC; /* Светлый индиго для секунд */
}

.next-bday-block {
    background: rgba(255,255,255,0.1); 
    padding: 12px; 
    border-radius: 12px;
    font-size: 14px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
    margin-bottom: 16px;
}
.planet-age {
    font-size: 12px; 
    opacity: 0.7; 
    font-style: italic;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- НОВЫЕ ИНФОРМАЦИОННЫЕ БЛОКИ (Age/Indigo Style) --- */

.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: 12px;
    background: #fff; box-shadow: 0 4px 12px rgba(0,0,0,0.04);
    flex-shrink: 0; margin-top: -4px;
    color: var(--accent-indigo);
}

.header-icon svg { width: 24px; height: 24px; stroke-width: 2px; }

/* Цвета иконок */
.blue-icon svg { color: #3B82F6; }
.green-icon svg { color: #10B981; }
.red-icon svg { color: #EF4444; }

.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: 16px; 
    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(67, 56, 202, 0.15); border-color: var(--accent-indigo-light); }

.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: #DBEAFE; color: #2563EB;
    padding: 6px 12px; border-radius: 99px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}
.badge-green {
    background: #D1FAE5; color: #059669;
    padding: 6px 12px; border-radius: 99px;
    font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
}

.formula-card p {
    font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; font-weight: 500;
}

.math-expression {
    background: #EEF2FF; /* Indigo Lightest */
    border: 1px solid #C7D2FE;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    color: var(--accent-indigo);
    text-align: center;
    margin-bottom: 16px;
    font-size: 15px;
    font-family: monospace;
}

/* Разделитель */
.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 Секция (Indigo Style) --- */
.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-indigo); 
    box-shadow: 0 4px 20px rgba(67, 56, 202, 0.15);
}

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-indigo);
    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-indigo);
}

.faq-answer, .faq-item div[itemprop="text"] {
    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; }
}