/* ============================================================
   HUMAN LIFE VALUE CALCULATOR — Step-wise Design
   Color theme: Red (matches website)
   ============================================================ */

body .section .container:has(> .hlv-shell) {
    max-width: 100% !important;
    padding-left: 24px !important;
    padding-right: 24px !important;
    overflow-x: hidden;
}
body:has(.hlv-shell) { overflow-x: hidden; }

.hlv-shell { max-width: 1280px; margin: 0 auto; }

/* ─── 2-Column Layout: Sidebar + Main ─── */
.hlv-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 0;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
    border: 1px solid #f1f5f9;
    min-height: 700px;
}

/* ─── SIDEBAR ─── */
.hlv-sidebar {
    background: linear-gradient(180deg, #dc2626 0%, #b91c1c 100%);
    color: #fff;
    padding: 32px 26px;
}
.hlv-sidebar h3 {
    color: #fff;
    font-size: 1.1rem;
    margin: 0 0 24px;
    line-height: 1.3;
    font-weight: 700;
}
.hlv-sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.hlv-sidebar li {
    display: flex;
    gap: 14px;
    align-items: flex-start;
}
.hlv-sb-icon {
    width: 38px;
    height: 38px;
    background: rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
    flex-shrink: 0;
}
.hlv-sidebar li strong {
    display: block;
    font-size: 0.92rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.3;
}
.hlv-sidebar li span {
    display: block;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.5;
}

/* ─── MAIN ─── */
.hlv-main { padding: 28px 32px; }

/* ─── Tabs ─── */
.hlv-tabs {
    display: flex;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 24px;
    gap: 8px;
}
.hlv-tab {
    background: none;
    border: none;
    padding: 12px 20px;
    font-size: 0.92rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}
.hlv-tab:hover { color: #dc2626; }
.hlv-tab.active {
    color: #dc2626;
    border-bottom-color: #dc2626;
}
.hlv-tab i { font-size: 14px; }
.hlv-tab-panel { display: none; }
.hlv-tab-panel.active { display: block; animation: hlvFadeIn 0.4s ease; }
@keyframes hlvFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ─── PROGRESS BAR ─── */
.hlv-progress {
    margin-bottom: 32px;
    position: relative;
}
.hlv-progress-bar {
    background: #e2e8f0;
    height: 4px;
    border-radius: 99px;
    position: absolute;
    top: 17px;
    left: 12.5%;
    right: 12.5%;
    overflow: hidden;
    z-index: 1;
}
.hlv-progress-fill {
    background: linear-gradient(90deg, #dc2626, #ef4444);
    height: 100%;
    border-radius: 99px;
    transition: width 0.4s ease;
}
.hlv-progress-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    position: relative;
    z-index: 2;
}
.hlv-progress-step {
    text-align: center;
    font-size: 0.76rem;
    color: #94a3b8;
    font-weight: 600;
    padding-top: 6px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    line-height: 1.3;
    transition: color 0.3s ease;
}
.hlv-progress-step span {
    display: inline-flex;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #e2e8f0;
    color: #94a3b8;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 0.78rem;
    position: relative;
    z-index: 2;
}
.hlv-progress-step.active { color: #dc2626; }
.hlv-progress-step.active span {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.hlv-progress-step.completed span {
    background: #16a34a;
    color: #fff;
    border-color: #16a34a;
}

/* ─── STEP CONTAINER ─── */
.hlv-step { display: none; }
.hlv-step.active { display: block; animation: hlvFadeIn 0.4s ease; }

/* Step header with icon */
.hlv-step-header {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 0 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid #f1f5f9;
}
.hlv-step-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.15);
}
.hlv-icon-blue   { background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%); }
.hlv-icon-red    { background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%); }
.hlv-icon-orange { background: linear-gradient(135deg, #f97316 0%, #ea580c 100%); }
.hlv-icon-green  { background: linear-gradient(135deg, #16a34a 0%, #15803d 100%); }
.hlv-icon-purple { background: linear-gradient(135deg, #9333ea 0%, #7e22ce 100%); }

.hlv-step-header h3 {
    font-size: 1.1rem;
    color: #0f172a;
    margin: 0 0 4px;
    font-weight: 700;
}
.hlv-step-header p {
    color: #64748b;
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

/* ─── Input Grid ─── */
.hlv-input-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 20px;
    margin-bottom: 18px;
}
.hlv-input-wide { grid-column: 1 / -1; }

.hlv-input-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.hlv-input-field label {
    font-size: 0.88rem;
    color: #334155;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}
.hlv-input-field label small {
    color: #94a3b8;
    font-weight: 500;
    margin-left: 4px;
}
.hlv-req { color: #dc2626; }

/* ─── Amount Input ─── */
.hlv-amount-input {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}
.hlv-amount-input:focus-within {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.hlv-amount-prefix {
    background: #f8fafc;
    color: #475569;
    padding: 0 14px;
    font-weight: 700;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    border-right: 1px solid #e2e8f0;
}
.hlv-amount-input input {
    border: none;
    flex: 1;
    padding: 11px 12px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: inherit;
}
.hlv-amount-input input:focus { outline: none; }
.hlv-amount-input input::-webkit-outer-spin-button,
.hlv-amount-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.hlv-amount-input input[type="number"] {
    -moz-appearance: textfield;
}
.hlv-amount-words {
    font-size: 0.74rem;
    color: #94a3b8;
    font-weight: 600;
    padding-left: 2px;
    font-style: italic;
}

/* ─── Age input (number with "years" suffix) ─── */
.hlv-age-input {
    display: flex;
    align-items: stretch;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}
.hlv-age-input:focus-within {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}
.hlv-age-input input {
    border: none;
    flex: 1;
    padding: 11px 14px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #0f172a;
    background: transparent;
    outline: none;
    width: 100%;
    font-family: inherit;
}
.hlv-age-input input::-webkit-outer-spin-button,
.hlv-age-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.hlv-age-input input[type="number"] {
    -moz-appearance: textfield;
}
.hlv-age-suffix {
    background: #f8fafc;
    color: #475569;
    padding: 0 14px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    border-left: 1px solid #e2e8f0;
}
.hlv-input-hint {
    font-size: 0.74rem;
    color: #94a3b8;
    font-weight: 500;
    padding-left: 2px;
}

/* ─── Slider input ─── */
.hlv-slider-input { gap: 8px; }
.hlv-slider-display {
    background: linear-gradient(135deg, #fef2f2 0%, #ffe4e6 100%);
    color: #b91c1c;
    border: 1.5px solid #fecaca;
    border-radius: 10px;
    padding: 9px 14px;
    font-weight: 700;
    font-size: 0.95rem;
    text-align: center;
}
.hlv-slider-input input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: linear-gradient(to right, #dc2626 0%, #dc2626 var(--fillPct, 0%), #e2e8f0 var(--fillPct, 0%), #e2e8f0 100%);
    border-radius: 99px;
    outline: none;
    cursor: pointer;
    margin: 0;
}
.hlv-slider-input input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid #dc2626;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
    transition: transform 0.15s ease;
}
.hlv-slider-input input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}
.hlv-slider-input input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #fff;
    border: 3px solid #dc2626;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.3);
}
.hlv-slider-range {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
}

/* ─── Section subtotal ─── */
.hlv-section-subtotal {
    margin-top: 8px;
    padding: 12px 16px;
    background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
    border: 1.5px dashed #fecaca;
    border-radius: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}
.hlv-section-subtotal span {
    color: #b91c1c;
    font-weight: 700;
}
.hlv-section-subtotal strong {
    color: #dc2626;
    font-weight: 800;
    font-size: 1.05rem;
}

/* ─── Summary card (Step 4) ─── */
.hlv-summary-card {
    background: linear-gradient(135deg, #fef2f2 0%, #ffe4e6 100%);
    border: 2px solid #fecaca;
    border-radius: 14px;
    padding: 24px 26px;
}
.hlv-summary-card h4 {
    font-size: 1.05rem;
    color: #b91c1c;
    margin: 0 0 18px;
    font-weight: 700;
}
.hlv-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 18px;
}
.hlv-summary-item {
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.hlv-summary-item span {
    color: #475569;
    font-size: 0.85rem;
    font-weight: 600;
}
.hlv-summary-item strong {
    color: #b91c1c;
    font-size: 1.02rem;
    font-weight: 800;
}

/* ─── Consent ─── */
.hlv-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: #fff;
    border: 1px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    color: #334155;
}
.hlv-consent:has(input:checked) {
    background: #fef2f2;
    border-color: #dc2626;
}
.hlv-consent input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #dc2626;
    cursor: pointer;
    margin-top: 1px;
    flex-shrink: 0;
}

/* ─── Nav buttons ─── */
.hlv-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid #f1f5f9;
    gap: 12px;
}
.hlv-nav .btn {
    padding: 12px 28px;
    font-size: 0.95rem;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.hlv-nav .btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}
.hlv-nav .btn-primary:hover { transform: translateY(-1px); }
.hlv-nav .btn-outline-dark {
    background: #fff;
    border: 1.5px solid #cbd5e1;
    color: #334155;
}

/* ─── EMPTY STATE ─── */
.hlv-empty-state {
    text-align: center;
    padding: 60px 30px;
    color: #94a3b8;
}
.hlv-empty-state i {
    font-size: 48px;
    color: #fecaca;
    margin-bottom: 14px;
    display: block;
}
.hlv-empty-state p {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0;
}

/* ─── RESULTS PAGE ─── */
.hlv-result-hero {
    text-align: center;
    padding: 32px 24px;
    background: linear-gradient(135deg, #fef2f2 0%, #ffe4e6 100%);
    border-radius: 14px;
    margin-bottom: 24px;
}
.hlv-result-icon-big {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    margin-bottom: 16px;
}
.hlv-result-label {
    font-size: 0.92rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 6px;
}
.hlv-result-big {
    font-size: 2.6rem;
    color: #b91c1c;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 6px;
    word-break: break-all;
}
.hlv-result-words {
    font-size: 1rem;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 16px;
    font-style: italic;
}
.hlv-result-badge {
    display: inline-block;
    color: #fff;
    padding: 7px 22px;
    border-radius: 99px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 12px;
}
.hlv-result-msg {
    color: #475569;
    font-size: 0.92rem;
    margin: 0;
    line-height: 1.5;
}

.hlv-result-breakdown {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px 26px;
    margin-bottom: 24px;
}
.hlv-result-breakdown h4 {
    font-size: 1.05rem;
    color: #0f172a;
    margin: 0 0 18px;
    font-weight: 700;
}
.hlv-result-section { margin-bottom: 20px; }
.hlv-result-section:last-child { margin-bottom: 0; }
.hlv-result-section-h {
    font-size: 0.9rem;
    color: #b91c1c;
    font-weight: 700;
    margin-bottom: 8px;
    padding: 6px 12px;
    background: #fef2f2;
    border-left: 3px solid #dc2626;
    border-radius: 6px;
    display: inline-block;
}
.hlv-result-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 0.88rem;
    color: #475569;
    border-bottom: 1px solid #f1f5f9;
}
.hlv-result-row:last-child { border-bottom: none; }
.hlv-result-row span { font-weight: 500; }
.hlv-result-row strong {
    font-weight: 700;
    color: #0f172a;
}
.hlv-result-row.positive strong { color: #dc2626; }
.hlv-result-row.negative strong { color: #16a34a; }
.hlv-result-row.total {
    margin-top: 12px;
    padding: 14px 16px;
    background: #fef2f2;
    border: 2px solid #fecaca;
    border-radius: 10px;
    border-bottom: 2px solid #fecaca;
}
.hlv-result-row.total strong {
    color: #b91c1c;
    font-size: 1.05rem;
}
.hlv-result-row.final {
    margin-top: 10px;
    padding: 16px 18px;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border-radius: 10px;
    border-bottom: none;
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.3);
}
.hlv-result-row.final strong {
    color: #fff;
    font-size: 1.1rem;
}

.hlv-result-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}
.hlv-result-foot .btn {
    padding: 12px 26px;
    border-radius: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.hlv-result-foot .btn-primary {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: none;
    color: #fff;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.3);
}
.hlv-result-foot .btn-outline-dark {
    background: #fff;
    border: 1.5px solid #cbd5e1;
    color: #334155;
}

/* ─── Responsive ─── */
@media (max-width: 900px) {
    .hlv-layout { grid-template-columns: 1fr; }
    .hlv-sidebar { padding: 24px 22px; }
    .hlv-sidebar ul {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 14px;
    }
    .hlv-sidebar li { flex: 1 1 calc(50% - 7px); min-width: 200px; }
    .hlv-input-grid { grid-template-columns: 1fr; }
    .hlv-summary-grid { grid-template-columns: 1fr; }

    /* Compact progress bar with bg pill — applies tablet & mobile */
    .hlv-progress {
        padding: 8px;
        background: #f8fafc;
        border-radius: 12px;
        margin-bottom: 22px;
        position: relative;
    }
    .hlv-progress-steps {
        gap: 4px;
        align-items: start;
    }
    .hlv-progress-step {
        padding-top: 6px;
        font-size: 0.7rem;
        line-height: 1.25;
        gap: 5px;
    }
    .hlv-progress-step span {
        width: 28px;
        height: 28px;
        font-size: 0.82rem;
        background: #fff;
        border: 2px solid #e2e8f0;
    }
    .hlv-progress-bar {
        /* Exact math: padding 8 + step pad 6 + half circle 14 = 28 (circle center)
           Minus half bar 1.5 = 26.5 (bar top for visual center) */
        top: 26.5px;
        height: 3px;
        left: 12.5%;
        right: 12.5%;
    }
    /* Remove box-shadow on active circle to avoid optical center-shift */
    .hlv-progress-step.active span {
        box-shadow: none;
    }
}
@media (max-width: 768px) {
    /* Active/inactive opacity treatment (sizing inherited from 900px breakpoint) */
    .hlv-progress-step {
        opacity: 0.55;
        transition: opacity 0.3s ease;
        word-break: keep-all;
        hyphens: auto;
    }
    .hlv-progress-step.active,
    .hlv-progress-step.completed {
        opacity: 1;
    }
    .hlv-progress-step.active span {
        box-shadow: none;
    }
}
@media (max-width: 600px) {
    .hlv-main { padding: 20px 18px; }
    .hlv-result-big { font-size: 2rem; }
    .hlv-step-header { flex-direction: column; align-items: flex-start; text-align: left; }
    .hlv-nav { flex-direction: column-reverse; }
    .hlv-nav .btn { width: 100%; justify-content: center; }
    .hlv-result-foot { flex-direction: column; }
    .hlv-result-foot .btn { width: 100%; justify-content: center; }
}
@media (max-width: 768px) {
    body .section .container:has(> .hlv-shell) {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .hlv-shell, .hlv-layout, .hlv-main {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .hlv-main { padding: 18px 14px !important; }

    /* Tabs — equal split fit on mobile */
    .hlv-tabs {
        gap: 0;
        margin-bottom: 20px;
    }
    .hlv-tab {
        flex: 1;
        min-width: 0;
        padding: 12px 6px;
        font-size: 0.8rem;
        gap: 5px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .hlv-tab i { font-size: 12px; flex-shrink: 0; }
    .hlv-step-header { padding: 0 0 14px; }
    .hlv-step-header h3 { font-size: 1.02rem; }
    .hlv-step-header p { font-size: 0.82rem; }
    .hlv-input-grid {
        padding: 0;
        gap: 14px;
        width: 100%;
        box-sizing: border-box;
    }
    .hlv-input-field { width: 100%; box-sizing: border-box; min-width: 0; }
    .hlv-amount-input, .hlv-age-input {
        width: 100%;
        box-sizing: border-box;
    }
    .hlv-amount-input input, .hlv-age-input input {
        width: 100%;
        min-width: 0;
        font-size: 16px; /* prevents iOS auto-zoom */
        box-sizing: border-box;
    }
}

@media (max-width: 420px) {
    /* Very small phones: hide tab icons */
    .hlv-tab i { display: none; }
    .hlv-tab {
        font-size: 0.78rem;
        padding: 11px 4px;
        gap: 0;
    }
}

@media (max-width: 400px) {
    .hlv-progress-steps { gap: 2px; }
    .hlv-progress-step { font-size: 0.62rem; }
    .hlv-progress-step span {
        width: 24px;
        height: 24px;
        font-size: 0.72rem;
    }
    /* Smaller circle (24px) → center at 14 + 12 = 26px → bar top 24.5 */
    .hlv-progress-bar { top: 25px; }
}
