/*
 * Estilos propios del test. Bootstrap cubre la base; aqui solo se define identidad.
 */

:root {
    --brand: #11845b;
    --brand-dark: #0d5f43;
    --ink: #1d252c;
    --muted: #64707d;
    --surface: #f5f7f4;
    --line: #dfe7df;
}

body {
    color: var(--ink);
    background: #ffffff;
}

.navbar {
    min-height: 88px;
}

.hero {
    background:
        linear-gradient(90deg, rgba(245, 247, 244, 0.98), rgba(245, 247, 244, 0.76)),
        url("../../../assets/img/hero-wellness-revelatest.png") center/cover;
    border-bottom: 1px solid var(--line);
}

.pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #ffffff;
    color: var(--brand-dark);
    font-size: 0.9rem;
    font-weight: 600;
}

.metric-panel,
.test-shell,
.result-card,
.share-card,
.premium-preview,
.checkout-box,
.report-panel,
.report-stat {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 16px 50px rgba(29, 37, 44, 0.08);
}

.metric-panel {
    padding: 32px;
}

.metric-panel strong {
    display: block;
    color: var(--brand-dark);
    font-size: clamp(2.4rem, 6vw, 4.8rem);
    line-height: 1;
    margin: 8px 0 16px;
}

.metric-label {
    color: var(--muted);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0;
}

.test-shell {
    padding: clamp(20px, 4vw, 40px);
}

.form-section + .form-section {
    margin-top: 32px;
    padding-top: 28px;
    border-top: 1px solid var(--line);
}

.question-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.question {
    min-height: 150px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    transition:
        border-color 0.2s ease,
        background-color 0.2s ease,
        box-shadow 0.2s ease;
}

.question.is-answered {
    border-color: rgba(17, 132, 91, 0.38);
    background: #edf8f3;
    box-shadow: inset 0 0 0 1px rgba(17, 132, 91, 0.06);
}

.question-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: -2px -6px 12px 0;
}

.question-heading .form-label {
    flex: 1;
}

.question-heading strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Reserva el espacio de "Sin responder" para evitar saltos al contestar. */
    min-width: 13ch;
    flex-shrink: 0;
    height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #e6f5ef;
    color: var(--brand-dark);
    font-weight: 800;
}

.form-actions {
    margin-top: 28px;
}

.progress {
    height: 10px;
    border-radius: 999px;
    background: #e7ece8;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--brand), var(--brand-dark));
    border-radius: inherit;
    transition: width 0.2s ease;
}

.btn-success:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.form-range::-webkit-slider-thumb {
    background: var(--brand);
}

.form-range::-moz-range-thumb {
    background: var(--brand);
}

.btn-success {
    --bs-btn-bg: var(--brand);
    --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-dark);
    --bs-btn-hover-border-color: var(--brand-dark);
}

.result-card,
.share-card,
.premium-preview,
.checkout-box {
    padding: clamp(22px, 4vw, 34px);
}

.age-number {
    display: flex;
    align-items: baseline;
    gap: 18px;
    color: var(--brand-dark);
    font-size: clamp(6rem, 16vw, 8.4rem);
    font-weight: 800;
    line-height: 0.95;
    margin: 16px 0;
}

.age-number span {
    color: var(--brand-dark);
    font-size: clamp(1.45rem, 4vw, 2.2rem);
    font-weight: 800;
}

.delta {
    display: inline-flex;
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 700;
}

.delta-good {
    background: #e6f5ef;
    color: #0d5f43;
}

.delta-warn {
    background: #fff1d9;
    color: #8a4c00;
}

.price {
    color: var(--brand-dark);
    font-size: 1.7rem;
    font-weight: 800;
    white-space: nowrap;
}

.premium-age {
    display: flex;
    align-items: baseline;
    gap: 8px;
    color: var(--ink);
    font-size: 2.5rem;
    line-height: 1;
    margin-top: 8px;
}

.premium-age span {
    font-size: 1.1rem;
    font-weight: 800;
}

.price-stack {
    align-self: flex-start;
    margin-top: 22px;
    text-align: right;
}

.price-stack span,
.price-stack strong {
    display: block;
}

.price-stack span {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.price-stack strong {
    color: var(--brand-dark);
    font-size: 1.9rem;
    line-height: 1.1;
}

.locked-grid,
.feature-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.locked-grid div,
.feature-list div {
    min-height: 94px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.locked-grid span,
.feature-list span {
    display: block;
    color: var(--muted);
    margin-top: 4px;
}

.report-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.report-meta-line {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    color: var(--muted);
    font-size: 0.92rem;
    margin-top: 14px;
}

.executive-panel {
    display: grid;
    grid-template-columns: 0.8fr 1fr 1.4fr;
    gap: 14px;
}

.executive-panel div {
    min-height: 118px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.executive-panel span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 10px;
}

.executive-panel strong {
    display: block;
    color: var(--ink);
    font-size: clamp(1.1rem, 2vw, 1.45rem);
    line-height: 1.25;
}

.report-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.report-stat,
.report-panel {
    padding: 20px;
}

.report-panel {
    display: flex;
    flex-direction: column;
    min-height: 400px;
}

.report-panel h2 {
    margin-bottom: 2rem;
}

.report-panel canvas {
    width: 100% !important;
}

.report-stat span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
}

.report-stat strong {
    display: block;
    color: var(--ink);
    font-size: 2.4rem;
    line-height: 1;
    margin-top: 8px;
}

.report-stat.accent strong {
    color: var(--brand-dark);
}

.impact-list {
    margin: 0;
    padding-left: 20px;
}

.impact-list li {
    margin: 10px 0;
    font-weight: 700;
}

.priority-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}

.priority-list li:last-child {
    border-bottom: 0;
}

.priority {
    display: inline-flex;
    align-items: center;
    min-width: 68px;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 0.82rem;
}

.priority-alta {
    background: #fff1d9;
    color: #8a4c00;
}

.priority-media {
    background: #e6eef7;
    color: #294d78;
}

.priority-baja {
    background: #e6f5ef;
    color: #0d5f43;
}

.advice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.advice-grid article {
    min-height: 112px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.advice-grid span {
    display: block;
    color: var(--muted);
    margin-top: 14px;
}

.advice-grid small {
    display: block;
    color: var(--brand-dark);
    font-weight: 700;
    margin-top: 12px;
}

.report-note {
    min-height: 0;
}

.references-panel {
    min-height: 0;
}

.references-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.references-grid article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.references-grid span,
.references-grid p,
.references-grid a {
    display: block;
    color: var(--muted);
    margin-top: 6px;
}

.references-grid a {
    color: var(--brand-dark);
    overflow-wrap: anywhere;
    font-size: 0.9rem;
}

.timeline-grid {
    display: grid;
    gap: 12px;
}

.timeline-grid article {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.timeline-grid strong,
.timeline-grid span {
    display: block;
}

.timeline-grid strong {
    color: var(--brand-dark);
    margin-bottom: 8px;
}

.timeline-grid span,
.confidence-panel p,
.limitations-panel li {
    color: var(--muted);
}

.confidence-level {
    color: var(--brand-dark);
    font-size: 3rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 18px;
}

.limitations-panel {
    min-height: 0;
}

.limitations-panel ul {
    margin: 0;
    padding-left: 20px;
}

.limitations-panel li {
    margin: 8px 0;
}

.confidential-footer {
    color: var(--muted);
    font-size: 0.9rem;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
    text-align: center;
}

@media print {
    @page {
        margin: 10mm;
    }

    nav,
    footer,
    .btn {
        display: none !important;
    }

    body {
        font-size: 11px;
        background: #ffffff;
    }

    .report {
        margin-top: 0 !important;
        margin-bottom: 14mm !important;
        max-width: 100% !important;
        padding-bottom: 12mm;
    }

    .report-hero {
        padding-bottom: 8px;
        margin-bottom: 10px !important;
    }

    .report-hero h1 {
        font-size: 22px;
        margin-bottom: 2px !important;
    }

    .report-hero p,
    .report-panel p,
    .advice-grid span,
    .references-grid p,
    .references-grid a {
        font-size: 10.5px;
        line-height: 1.35;
    }

    .report-grid,
    .executive-panel {
        gap: 8px;
        margin-bottom: 10px !important;
    }

    .report-stat,
    .report-panel {
        box-shadow: none;
        padding: 10px;
    }

    .report-stat strong {
        font-size: 24px;
        margin-top: 4px;
    }

    .report-meta-line {
        gap: 4px 10px;
        font-size: 9.5px;
        margin-top: 6px;
    }

    .executive-panel div {
        min-height: 0;
        padding: 8px;
    }

    .executive-panel span {
        font-size: 9.5px;
        margin-bottom: 4px;
    }

    .executive-panel strong {
        font-size: 12px;
    }

    .report-panel {
        min-height: 0;
        height: auto !important;
        page-break-inside: auto;
        break-inside: auto;
        overflow: visible;
    }

    .report .h-100 {
        height: auto !important;
    }

    .report .row > [class*="col-"] {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
    }

    .priority-panel,
    .print-next-page {
        break-before: page;
        page-break-before: always;
    }

    .report-panel h2 {
        font-size: 16px;
        margin-bottom: 10px;
    }

    .row.g-4,
    .row.g-4.mt-1 {
        --bs-gutter-x: 10px;
        --bs-gutter-y: 10px;
    }

    .report-panel canvas {
        display: block !important;
        width: 100% !important;
        height: 145px !important;
        max-height: 145px !important;
        margin-bottom: 0;
    }

    #futureChart {
        height: 125px !important;
        max-height: 125px !important;
    }

    #comparisonChart {
        height: 150px !important;
        max-height: 150px !important;
    }

    .impact-list {
        padding-left: 16px;
    }

    .impact-list li {
        margin: 5px 0;
    }

    .advice-grid,
    .timeline-grid,
    .references-grid {
        gap: 8px;
    }

    .advice-grid article,
    .timeline-grid article,
    .references-grid article {
        min-height: 0;
        padding: 10px;
    }

    .advice-grid small {
        margin-top: 6px;
        font-size: 9.5px;
    }

    .report-panel.mt-4 {
        margin-top: 10px !important;
    }

    .confidence-level {
        font-size: 24px;
        margin-bottom: 8px;
    }

    .confidential-footer {
        display: block;
        font-size: 9px;
        position: fixed;
        right: 10mm;
        bottom: 7mm;
        left: 10mm;
        margin-top: 0;
        padding-top: 8px;
        width: 100%;
        background: #ffffff;
    }

    .report-panel + .report-panel,
    .advice-grid {
        clear: both;
    }
}

@media (max-width: 991.98px) {
    .question-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .report-grid,
    .executive-panel {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 575.98px) {
    .question-grid,
    .locked-grid,
    .feature-list,
    .report-grid,
    .executive-panel,
    .advice-grid,
    .references-grid {
        grid-template-columns: 1fr;
    }

    .report-hero {
        flex-direction: column;
    }
}
