:root {
    --navy: #0b1d3a;
    --navy-soft: #132a4d;
    --green: #00a86b;
    --green-dark: #007e51;
    --charcoal: #2f3742;
    --muted: #5d6673;
    --light: #f3f5f7;
    --line: #e3e7ec;
    --white: #ffffff;
    --red: #c0392b;
    --amber: #d99a00;
    --heading: "Manrope", "Aptos", Arial, sans-serif;
    --body: "Manrope", "Aptos", Arial, sans-serif;
    --radius-button: 8px;
    --radius-card: 12px;
    --shadow-soft: 0 18px 50px rgba(11, 29, 58, 0.08);
}

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    color: var(--charcoal);
    background: var(--white);
    font-family: var(--body);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

/* Mismos valores de foco que styles.css (contraste 3:1 en blanco y navy). */
:focus-visible {
    outline: 3px solid var(--green-dark);
    outline-offset: 3px;
}

.skip-link {
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 100;
    padding: 10px 14px;
    transform: translateY(-150%);
    border-radius: var(--radius-button);
    color: var(--white);
    background: var(--navy);
    font-weight: 600;
    text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

.container {
    width: min(1040px, calc(100% - 32px));
    margin-inline: auto;
}

.print-only { display: none; }

h1, h2, h3 {
    margin-top: 0;
    color: var(--navy);
    font-family: var(--heading);
    line-height: 1.15;
}

/* Botones */
.btn {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-button);
    font-family: var(--heading);
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 180ms ease, transform 180ms ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-primary { color: var(--white); background: var(--navy); }
.btn-primary:hover { background: var(--navy-soft); }
.btn-secondary { color: var(--navy); background: transparent; border-color: var(--navy); }
.btn-secondary:hover { background: var(--light); }
/* Texto navy sobre verde: el blanco pequeño sobre verde no cumple contraste (manual de marca §14). */
.btn-accent { color: var(--navy); background: var(--green); }
.btn-accent:hover { background: #12b97b; }

/* Header y footer */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--white);
    border-bottom: 1px solid var(--line);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 72px;
}
.brand { display: flex; align-items: center; }
.brand-logo { height: 34px; width: auto; }
.header-back { color: var(--navy); font-weight: 600; font-size: 0.92rem; text-decoration: none; white-space: nowrap; }
.header-back:hover { text-decoration: underline; }

.site-footer { color: rgba(255, 255, 255, 0.72); background: var(--navy); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding-block: 22px;
    font-size: 0.86rem;
}
.footer-bottom p { margin: 0; }
.footer-bottom a { text-decoration: none; }
.footer-bottom a:hover { color: var(--white); }

/* Introducción */
.eyebrow {
    margin: 0 0 12px;
    color: var(--green-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.eyebrow-light { color: var(--green); }

.plan-intro { padding: 56px 0 32px; }
.plan-intro-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 48px;
    align-items: center;
}
.plan-intro h1 {
    margin-bottom: 18px;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
    font-weight: 700;
    letter-spacing: -0.045em;
}
.plan-lead { margin: 0 0 14px; font-size: 1.1rem; }
.plan-privacy { margin: 0; color: var(--muted); font-size: 0.92rem; }

.plan-steps {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.plan-steps li {
    display: flex;
    gap: 14px;
    align-items: baseline;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--light);
    color: var(--navy);
    font-weight: 600;
}
.plan-steps span { color: var(--green-dark); font-size: 0.8rem; font-weight: 700; }

/* Hoja */
.plan-sheet {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 56px;
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--white);
    box-shadow: var(--shadow-soft);
}

.sheet-head,
.sheet-foot,
.sheet-actions,
.span-2 { grid-column: 1 / -1; }

.sheet-head {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    align-items: flex-end;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--navy);
}
.sheet-title { margin: 0; font-size: 1.5rem; letter-spacing: -0.02em; }
.sheet-meta {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1.2fr;
    gap: 12px;
    flex: 1 1 520px;
}

.block {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--white);
}
.block h3 {
    display: flex;
    gap: 10px;
    align-items: center;
    margin: 0 0 6px;
    font-size: 1.08rem;
}
.block h3 span {
    display: inline-grid;
    flex: none;
    width: 26px;
    height: 26px;
    place-items: center;
    border-radius: 50%;
    color: var(--white);
    background: var(--navy);
    font-size: 0.8rem;
}

.hint { margin: 0 0 12px; color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.block .hint:last-child { margin-bottom: 0; margin-top: 10px; }

label { display: block; color: var(--navy); font-size: 0.86rem; font-weight: 600; }
label small, legend small { color: var(--muted); font-weight: 500; }

input[type="text"],
input[type="number"],
input[type="date"],
textarea {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid #cdd3db;
    border-radius: 6px;
    color: var(--charcoal);
    background: var(--white);
    font: 500 0.95rem/1.35 var(--body);
}
textarea { resize: vertical; }
input:focus, textarea:focus { border-color: var(--navy); }

fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; color: var(--charcoal); font-size: 0.9rem; }
legend strong { color: var(--navy); }

.yesno {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
}
.yesno legend { float: left; width: 100%; margin-bottom: 4px; }
.yesno label,
.choice label {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    font-weight: 500;
    cursor: pointer;
}
input[type="radio"] { width: 18px; height: 18px; margin: 0; accent-color: var(--navy); }

.choice { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 12px; }
.choice legend { float: left; width: 100%; margin-bottom: 4px; font-weight: 600; color: var(--navy); font-size: 0.86rem; }
.stack + .choice, .choice + .stack { margin-top: 12px; }

.result {
    margin: 12px 0 0;
    padding: 10px 12px;
    border-left: 3px solid var(--green);
    border-radius: 0 6px 6px 0;
    color: var(--navy);
    background: var(--light);
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.45;
}

.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pair label, .trio label { display: flex; flex-direction: column; justify-content: space-between; }
.trio { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

.x-title {
    margin: 16px 0 8px;
    padding-top: 12px;
    border-top: 1px dashed var(--line);
    color: var(--navy);
    font-size: 0.9rem;
    font-weight: 700;
}

.grid-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.grid-table th {
    padding: 0 6px 6px 0;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 600;
    text-align: left;
}
.grid-table td { padding: 0 6px 6px 0; }
.grid-table td:last-child, .grid-table th:last-child { padding-right: 0; }
.grid-table input { margin: 0; }
.b-prioridades th:nth-child(1) { width: 34%; }
.b-prioridades th:nth-child(2) { width: 18%; }
.b-prioridades th:nth-child(3) { width: 16%; }

/* Número crítico: el bloque con más peso visual de la hoja. */
.b-critico { border: 2px solid var(--navy); }
.semaforo {
    display: grid;
    grid-template-columns: repeat(3, 22px) 1fr;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
}
.semaforo .result { margin: 0 0 0 6px; }
.luz { width: 22px; height: 22px; border: 2px solid var(--line); border-radius: 50%; background: var(--white); }
.semaforo[data-estado="rojo"] .luz-rojo { border-color: var(--red); background: var(--red); }
.semaforo[data-estado="amarillo"] .luz-amarillo { border-color: var(--amber); background: var(--amber); }
.semaforo[data-estado="verde"] .luz-verde { border-color: var(--green); background: var(--green); }
.semaforo[data-estado="rojo"] .result { border-left-color: var(--red); }
.semaforo[data-estado="amarillo"] .result { border-left-color: var(--amber); }

.rhythm { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rhythm label { font-weight: 500; color: var(--charcoal); }
.rhythm strong { display: block; color: var(--navy); }

.sheet-foot { margin: 0; color: var(--muted); font-size: 0.8rem; }

.sheet-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.save-status { margin: 0; color: var(--muted); font-size: 0.86rem; }

.semaforo-link {
    display: inline-block;
    margin-top: 10px;
    color: var(--navy);
    font-size: 0.9rem;
    font-weight: 700;
}
.semaforo-link[hidden] { display: none; }

/* Solicitud de revisión (captura de leads). Ojo: .plan-lead es el párrafo de la introducción. */
.plan-revision {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 56px;
    padding: 32px;
    border-radius: var(--radius-card);
    background: var(--light);
    scroll-margin-top: 96px;
}
.plan-revision h2 { margin-bottom: 12px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; }
.lead-copy p { margin: 0 0 12px; }
.lead-points { margin: 0; padding-left: 18px; color: var(--navy); font-weight: 600; }
.lead-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius-card);
    background: var(--white);
}
.lead-form .check,
.lead-form button,
.lead-status,
.lead-privacy { grid-column: 1 / -1; }
.lead-form input[type="email"],
.lead-form input[type="tel"] {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 8px 10px;
    border: 1px solid #cdd3db;
    border-radius: 6px;
    font: 500 0.95rem/1.35 var(--body);
}
.lead-form .check { display: flex; gap: 8px; align-items: flex-start; font-weight: 500; color: var(--charcoal); }
.lead-form .check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--navy); }
.lead-form button { justify-self: start; }
.lead-form button:disabled { opacity: 0.6; cursor: wait; }
.lead-status { margin: 0; font-size: 0.9rem; font-weight: 600; }
.lead-status.success { color: var(--green-dark); }
.lead-status.error { color: var(--red); }
.lead-privacy { margin: 0; color: var(--muted); font-size: 0.8rem; line-height: 1.45; }
.lead-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Llamado final */
.plan-cta { padding: 48px 0; color: rgba(255, 255, 255, 0.82); background: var(--navy); }
.plan-cta-inner { display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.plan-cta-inner > div { max-width: 640px; }
.plan-cta h2 { margin-bottom: 10px; color: var(--white); font-size: clamp(1.5rem, 3vw, 2rem); }
.plan-cta p { margin: 0; }

@media (max-width: 860px) {
    .plan-intro-grid { grid-template-columns: 1fr; gap: 28px; }
    .plan-sheet { grid-template-columns: 1fr; padding: 16px; }
    .sheet-meta { grid-template-columns: 1fr; flex-basis: 100%; }
    .rhythm { grid-template-columns: 1fr; }
    .plan-revision { grid-template-columns: 1fr; gap: 20px; padding: 20px; }
}

@media (max-width: 560px) {
    .lead-form { grid-template-columns: 1fr; padding: 16px; }
}

@media (max-width: 560px) {
    .pair, .trio { grid-template-columns: 1fr; }
    .block { padding: 14px; }
    /* Las tablas pasan a filas apiladas: en un teléfono, cuatro columnas no caben. */
    .grid-table thead { display: none; }
    .grid-table, .grid-table tbody, .grid-table tr, .grid-table td { display: block; width: 100%; }
    .grid-table tr { padding: 8px 0; border-bottom: 1px solid var(--line); }
    .grid-table td { padding: 0 0 6px; }
    .grid-table td input::placeholder { color: var(--muted); }
    .footer-bottom { flex-direction: column; }
}

/* Impresión: una hoja A4 que se pega en la pared o se revisa en la reunión semanal. */
@page { size: A4; margin: 8mm; }

@media print {
    .no-print { display: none !important; }
    .print-only { display: initial; }

    html, body { background: var(--white); }
    body { font-size: 8.4pt; line-height: 1.3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    .container { width: 100%; }

    /* Una A4 mide ~718 px de ancho útil: sin esto se aplicarían las reglas de celular. */
    .plan-sheet {
        grid-template-columns: 1fr 1fr;
        gap: 2mm;
        margin: 0;
        padding: 0;
        border: 0;
        box-shadow: none;
    }
    .sheet-head { flex-wrap: nowrap; padding-bottom: 2mm; gap: 2mm 6mm; align-items: center; }
    .sheet-logo { display: block; height: 6mm; width: auto; flex: none; }
    .sheet-title { flex: none; font-size: 12pt; }
    .sheet-meta { grid-template-columns: 1.8fr 1fr 1fr; flex: 1 1 auto; gap: 3mm; }
    .rhythm { grid-template-columns: repeat(3, 1fr); }
    .rhythm label { font-size: 7.4pt; }
    .rhythm strong { display: inline; margin-right: 1mm; }
    .b-ritmo .hint, .b-meta .hint { display: none; }
    .choice legend { font-size: 7.8pt; }
    .yesno legend { margin-bottom: 0.2mm; }

    .block { padding: 2mm 3mm; border-radius: 2mm; break-inside: avoid; }
    .block h3 { margin-bottom: 1mm; font-size: 9.6pt; gap: 2mm; }
    .block h3 span { width: 4.6mm; height: 4.6mm; font-size: 7pt; }
    .hint { margin-bottom: 1.4mm; font-size: 7.2pt; }
    .block .hint:last-child { margin-top: 1.4mm; }

    label, legend, .x-title { font-size: 7.8pt; }
    input[type="text"], input[type="number"], input[type="date"], textarea {
        margin-top: 0.6mm;
        padding: 0.7mm 1.6mm;
        border-color: #b8c0ca;
        border-radius: 1mm;
        font-size: 8.2pt;
    }
    textarea { resize: none; height: 11mm; overflow: hidden; }
    input[type="radio"] { width: 3mm; height: 3mm; }

    .yesno { padding: 0.8mm 0; gap: 0.5mm 4mm; }
    .yesno legend, .choice legend { margin-bottom: 0.4mm; }
    .choice { margin-top: 1.6mm; gap: 0.5mm 4mm; }
    .stack + .choice, .choice + .stack { margin-top: 1.6mm; }
    .result { margin-top: 1.6mm; padding: 1.2mm 2mm; font-size: 7.6pt; }
    .pair, .trio, .rhythm { gap: 2.4mm; }
    .x-title { margin: 1.6mm 0 0.8mm; padding-top: 1.2mm; }

    .grid-table th { padding: 0 1.4mm 0.8mm 0; font-size: 7pt; }
    .grid-table td { padding: 0 1.4mm 1mm 0; }

    .semaforo { grid-template-columns: repeat(3, 4mm) 1fr; gap: 1.6mm; margin-top: 1.6mm; }
    .luz { width: 4mm; height: 4mm; }

    .sheet-foot { font-size: 6.8pt; }
    .sheet-foot .print-only { float: right; color: var(--navy); font-weight: 700; }
}
