/* --- Стили для Электричества (Electric Theme) --- */
:root {
    --accent-electric: #EAB308; /* Yellow 500 */
    --accent-electric-dark: #CA8A04;
    --gradient-electric-card: linear-gradient(135deg, #FACC15 0%, #EAB308 100%);
    --accent-electric-light: #FEFCE8; /* Добавлено для фонов */
}

.calc-header { margin-bottom: 32px; }
.subtitle { color: var(--text-secondary); margin-top: 8px; }

/* Сетка */
.calc-grid { display: grid; grid-template-columns: 1fr; gap: 40px; align-items: start; }
@media (min-width: 900px) { .calc-grid { grid-template-columns: 1.3fr 0.7fr; } }

/* Inputs */
.calc-inputs { gap: 16px; /* Уменьшили общий гап */ }

/* Уменьшили отступ снизу для групп */
.input-group { margin-bottom: 12px; } 

.input-group label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text-primary); }

/* FIX: Убираем стандартные стрелки у input type="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;
}

.input-wrapper { position: relative; display: flex; align-items: center; }

.input-wrapper input {
    width: 100%; 
    padding: 14px 16px; 
    padding-right: 50px; 
    font-size: 16px; font-weight: 500;
    border: 1px solid #E5E7EB; border-radius: 12px;
    outline: none; transition: border 0.2s;
    font-family: var(--font-main);
}
.input-wrapper input:focus { border-color: var(--accent-electric); box-shadow: 0 0 0 3px rgba(234, 179, 8, 0.15); }

.currency, .suffix { 
    position: absolute; right: 16px; color: var(--text-secondary); 
    pointer-events: none; font-size: 14px; 
}
.helper-text { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }

/* Уменьшили отступы разделителя */
.divider { border-top: 1px solid #E5E7EB; margin: 16px 0; }

.group-label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 12px; }

/* Пресеты (Scroll) */
.presets-scroll {
    display: flex; gap: 8px; overflow-x: auto; padding-bottom: 8px; margin-bottom: 16px;
    scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
/* Скрываем скроллбар для эстетики (но скролл работает) */
.presets-scroll::-webkit-scrollbar { display: none; }

.preset-pill {
    padding: 8px 12px; border: 1px solid #E5E7EB; border-radius: 99px;
    background: #F9FAFB; font-size: 13px; font-weight: 600; color: var(--text-primary);
    white-space: nowrap; cursor: pointer; transition: all 0.2s;
}
.preset-pill:hover { border-color: var(--accent-electric); background: #FEFCE8; }

/* Форма добавления */
.add-box { background: #F9FAFB; padding: 16px; border-radius: 16px; border: 1px solid #E5E7EB; }
.row-2-col { display: grid; grid-template-columns: 1.5fr 1fr; gap: 12px; margin-bottom: 12px; }
.add-row-bottom { display: grid; grid-template-columns: 1fr auto; gap: 12px; }

.btn--add {
    padding: 0 20px; border-radius: 12px; height: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--accent-electric); border: none; color: #fff; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 6px rgba(234, 179, 8, 0.2); transition: transform 0.1s;
}
.btn--add:hover { background: var(--accent-electric-dark); transform: translateY(-1px); }
.btn--add:active { transform: translateY(1px); }

/* --- ЧЕК (Receipt) --- */
.receipt-container { 
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.08)); 
    position: sticky; top: 24px;
}

.receipt-paper {
    background: #fff; width: 100%; min-height: 300px;
    position: relative; padding: 24px; 
    clip-path: polygon(
        0% 0%, 100% 0%, 100% 100%, 
        98% 99%, 96% 100%, 94% 99%, 92% 100%, 90% 99%, 
        88% 100%, 86% 99%, 84% 100%, 82% 99%, 80% 100%,
        78% 99%, 76% 100%, 74% 99%, 72% 100%, 70% 99%,
        68% 100%, 66% 99%, 64% 100%, 62% 99%, 60% 100%,
        58% 99%, 56% 100%, 54% 99%, 52% 100%, 50% 99%,
        48% 100%, 46% 99%, 44% 100%, 42% 99%, 40% 100%,
        38% 99%, 36% 100%, 34% 99%, 32% 100%, 30% 99%,
        28% 100%, 26% 99%, 24% 100%, 22% 99%, 20% 100%,
        18% 99%, 16% 100%, 14% 99%, 12% 100%, 10% 99%,
        8% 100%, 6% 99%, 4% 100%, 2% 99%, 0% 100%
    );
    padding-bottom: 30px;
    background-image: radial-gradient(#F3F4F6 1px, transparent 0);
    background-size: 20px 20px;
}

.receipt-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin-bottom: 16px; 
}

.receipt-header-info { text-align: left; }

.receipt-header h3 { 
    font-family: 'Courier New', monospace; 
    font-size: 18px; font-weight: 700; margin: 0; 
    text-transform: uppercase; letter-spacing: 1px; 
}
.receipt-date { 
    font-family: 'Courier New', monospace; 
    font-size: 12px; color: var(--text-secondary); 
}

/* Кнопка сброса (Мусорка) */
.btn-reset {
    background: none; border: none; cursor: pointer;
    font-size: 18px; color: #9CA3AF; transition: color 0.2s;
    padding: 4px; display: flex; align-items: center;
}
.btn-reset:hover { color: #EF4444; }

.receipt-divider-dashed { border-top: 1px dashed #D1D5DB; margin: 12px 0; }
.receipt-divider-bold { border-top: 2px solid #111827; margin: 16px 0; }

.receipt-body { font-family: 'Courier New', monospace; font-size: 13px; min-height: 100px; }
.empty-receipt { text-align: center; color: #9CA3AF; margin-top: 40px; font-style: italic; }

.r-item { 
    display: flex; justify-content: space-between; 
    margin-bottom: 10px; align-items: flex-start; 
}
.r-name-row { display: flex; justify-content: space-between; font-weight: 700; }
.r-sub-row { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-secondary); }

/* Крестик удаления (FIX: Всегда виден) */
.r-del { 
    cursor: pointer; 
    color: #EF4444; /* Красный */
    margin-left: 10px; 
    font-weight: bold; 
    font-size: 20px; 
    line-height: 1;
    opacity: 1; 
    padding: 0 4px; 
}

.receipt-total { font-family: 'Courier New', monospace; }
.total-row { display: flex; justify-content: space-between; margin-bottom: 4px; font-size: 14px; }
.big-total { font-size: 18px; font-weight: 800; margin-top: 8px; }

/* --- Кастомное Модальное Окно --- */
.custom-modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(17, 24, 39, 0.4); 
    backdrop-filter: blur(4px); 
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
    opacity: 0; visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-modal-overlay.active {
    opacity: 1; visibility: visible;
}

.custom-modal {
    background: #fff; width: 90%; max-width: 320px;
    padding: 24px; border-radius: 20px;
    text-align: center;
    transform: translateY(20px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); 
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.custom-modal-overlay.active .custom-modal {
    transform: translateY(0) scale(1);
}

.modal-icon {
    font-size: 32px; margin-bottom: 12px;
    background: #FEE2E2; width: 64px; height: 64px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}

.custom-modal h3 {
    font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--text-primary);
}

.custom-modal p {
    font-size: 13px; color: var(--text-secondary); margin-bottom: 24px; line-height: 1.5;
}

.modal-actions { display: flex; gap: 12px; }

.btn-modal {
    flex: 1; padding: 12px; border-radius: 12px; font-weight: 600; font-size: 14px;
    cursor: pointer; border: none; transition: background 0.2s;
}

.btn-cancel { background: #F3F4F6; color: var(--text-primary); }
.btn-cancel:hover { background: #E5E7EB; }

.btn-confirm {
    background: #EF4444; color: #fff;
    box-shadow: 0 4px 6px rgba(239, 68, 68, 0.2);
}
.btn-confirm:hover { background: #DC2626; }

/* --- НОВЫЕ ИНФОРМАЦИОННЫЕ БЛОКИ (Адаптация под Electric/Yellow) --- */

.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: #2563EB; }
.orange-icon svg { color: #F59E0B; }
.green-icon svg { color: #10B981; }
.red-icon svg { color: #EF4444; }
.yellow-icon svg { color: #EAB308; } /* Electric */

/* Маленькие подзаголовки */
.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: #2563EB; 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: #F9FAFB;
    border: 1px solid #E5E7EB;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    color: var(--accent-electric); /* Accent Color */
    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 (Новый стиль под Electric) */
.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-electric); 
    box-shadow: 0 4px 20px rgba(234, 179, 8, 0.15); /* Accent 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-electric-dark);
    background: var(--accent-electric-light);
}

.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-electric);
}

.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; }
}