/* site.css — marca NGE (crema, tinta y rojo) con la estructura nueva */

:root {
    --bg: #F7F3EC;            /* crema cálido */
    --bg-alt: #EFE9DD;        /* crema un punto más oscuro */
    --surface: #FFFFFF;
    --ink: #14110D;           /* tinta casi negra */
    --muted: #5C5447;         /* gris cálido */
    --line: rgba(20, 17, 13, 0.14);
    --brand: #E63946;         /* rojo NGE: barras, puntos y cifras grandes */
    --accent: #C42531;        /* rojo NGE accesible: botones y enlaces (AA) */
    --accent-dark: #A51D29;
    --accent-light: #F8DDDF;
    --accent-faint: #FCEFF0;
    --ok: #1F7A4D;
    --check: #9A5B00;

    --font-head: 'Outfit', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
    --wrap: 1180px;
    --gutter: 32px;
    --section: 96px;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(20, 17, 13, 0.05), 0 8px 24px -10px rgba(20, 17, 13, 0.18);
    --shadow-lg: 0 18px 40px -14px rgba(20, 17, 13, 0.28);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--muted);
    font-family: var(--font-body);
    font-size: 17px;
    line-height: 1.65;
}

h1, h2, h3 {
    font-family: var(--font-head);
    color: var(--ink);
    letter-spacing: -0.02em;
    line-height: 1.12;
    margin: 0 0 0.6em;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.8rem); font-weight: 800; max-width: 18ch; }
h2 { font-size: clamp(1.8rem, 3.2vw, 2.5rem); font-weight: 700; }
h3 { font-size: 1.2rem; font-weight: 600; }

p, ul, ol, dl { margin: 0 0 1em; }
p, li { max-width: 70ch; }
strong { color: var(--ink); }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }

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

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.visually-hidden {
    position: absolute; width: 1px; height: 1px; overflow: hidden;
    clip: rect(0 0 0 0); white-space: nowrap;
}

.skip-link {
    position: absolute; left: var(--gutter); top: -60px;
    background: var(--ink); color: #fff; padding: 10px 16px; z-index: 1001; border-radius: 6px;
}
.skip-link:focus { top: 12px; color: #fff; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.muted { color: var(--muted); }
.lead { font-size: 1.2rem; color: var(--muted); max-width: 58ch; }
.small { font-size: 0.9rem; }
.text-accent { color: var(--brand); }

/* Hueco pendiente de dato real */
.todo { background: #FFF3CD; outline: 1px dashed var(--check); padding: 0 4px; }

/* Etiqueta tipo píldora */
.badge {
    display: inline-block; padding: 6px 14px; margin-bottom: 20px;
    background: var(--accent-light); color: var(--accent-dark);
    border-radius: 999px; font-size: 0.85rem; font-weight: 600;
}

/* ---------- Cabecera ---------- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(247, 243, 236, 0.86);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.logo {
    font-family: var(--font-head); font-weight: 800; font-size: 1.5rem;
    color: var(--ink); text-decoration: none; letter-spacing: -0.04em;
}
.logo::after { content: "."; color: var(--brand); }
.site-nav ul { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: var(--muted); text-decoration: none; font-size: 0.95rem; font-weight: 500; transition: color 0.2s ease; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav .lang a {
    border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
    font-size: 0.8rem; font-weight: 600; color: var(--ink);
}

/* ---------- Secciones ---------- */
.section { padding: var(--section) 0; }
main > .section:nth-of-type(even) { background: var(--bg-alt); }

.section-intro { max-width: 680px; margin-bottom: 48px; }
.section-intro p { font-size: 1.1rem; }

.hero { position: relative; padding: 88px 0 80px; overflow: hidden; }
.hero::before {
    content: ""; position: absolute; z-index: -1; top: -120px; right: -160px;
    width: 620px; height: 620px; border-radius: 50%;
    background: radial-gradient(circle, rgba(230, 57, 70, 0.14) 0%, rgba(230, 57, 70, 0) 68%);
}
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 56px; align-items: center; }
.hero .lead { margin-bottom: 32px; }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 18px; }

.btn {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: #fff;
    padding: 14px 26px; border-radius: 999px; border: 0;
    font: 600 1rem/1.2 var(--font-body); text-decoration: none; cursor: pointer;
    box-shadow: 0 6px 18px -6px rgba(196, 37, 49, 0.55);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.btn:hover { background: var(--accent-dark); color: #fff; transform: translateY(-2px); }
.btn[disabled] { opacity: 0.7; cursor: progress; transform: none; }
.btn-ghost { background: var(--accent-light); color: var(--accent-dark); box-shadow: none; }
.btn-ghost:hover { background: var(--accent-faint); color: var(--accent-dark); }
.btn-light { background: #fff; color: var(--ink); box-shadow: none; }
.btn-light:hover { background: var(--accent-faint); color: var(--ink); }

.link { font-weight: 600; }

/* ---------- Gráfico del hero (terminal) ---------- */
.hero-graphic { position: relative; }
.terminal {
    background: rgba(20, 17, 13, 0.94); color: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius); padding: 20px 22px 22px; box-shadow: var(--shadow-lg);
    font: 0.86rem/1.7 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.terminal pre { margin: 0; white-space: pre-wrap; font: inherit; }
.terminal-dots { display: flex; gap: 6px; margin-bottom: 14px; }
.terminal-dots span { width: 11px; height: 11px; border-radius: 50%; background: #FF5F57; }
.terminal-dots span:nth-child(2) { background: #FEBC2E; }
.terminal-dots span:nth-child(3) { background: #28C840; }
.t-method { color: #93C5FD; font-weight: 600; }
.t-path { color: #FF8A93; }
.t-ok { color: #4ADE80; }
.t-key { color: #7DD3FC; }
.t-str { color: #86EFAC; }
.t-warn { color: #FCD34D; }
.t-dim { color: rgba(255, 255, 255, 0.5); }
.hero-chip {
    position: absolute; left: -28px; bottom: -26px;
    background: var(--surface); color: var(--ink); border-radius: 999px;
    padding: 10px 18px; box-shadow: var(--shadow-lg);
    font: 600 0.92rem/1.2 var(--font-head); display: flex; align-items: center; gap: 10px;
}
.hero-chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }

/* ---------- Cifras ---------- */
.stats { background: var(--ink); color: rgba(255, 255, 255, 0.75); padding: 40px 0; }
.stats ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.stats li { max-width: none; border-left: 3px solid var(--brand); padding-left: 16px; font-size: 0.95rem; line-height: 1.4; }
.stats strong { display: block; color: #fff; font: 800 1.9rem/1.1 var(--font-head); margin-bottom: 4px; letter-spacing: -0.02em; }

/* ---------- Tarjetas ---------- */
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 28px; box-shadow: var(--shadow);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card > :last-child { margin-bottom: 0; }
.card-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.card-grid > li { max-width: none; display: flex; flex-direction: column; }
.card-grid .meta { color: var(--accent); font-size: 0.8rem; font-weight: 600; margin: 0 0 10px; }
.card-grid h3 { margin-bottom: 0.5em; }

/* Listas con reglas (timeline, datos) */
.rules { list-style: none; padding: 0; margin: 0; }
.rules > li { border-top: 1px solid var(--line); padding: 20px 0; max-width: none; }
.rules > li:last-child { border-bottom: 1px solid var(--line); }
.rules > li > :last-child { margin-bottom: 0; }
.rules-2col > li { display: grid; grid-template-columns: 240px 1fr; gap: 8px 32px; }
.rules h3 { margin: 0 0 0.3em; }
.rules .meta { color: var(--muted); font-size: 0.9rem; margin: 0; }

/* Trayectoria como línea de tiempo */
.timeline { list-style: none; margin: 0; padding: 0 0 0 28px; position: relative; }
.timeline::before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--accent-light); }
.timeline > li { position: relative; padding: 0 0 32px; max-width: none; }
.timeline > li:last-child { padding-bottom: 0; }
.timeline > li::before {
    content: ""; position: absolute; left: -28px; top: 6px; width: 14px; height: 14px;
    border-radius: 50%; background: var(--surface); border: 3px solid var(--brand);
}
.timeline .meta { color: var(--accent); font-size: 0.85rem; font-weight: 600; margin: 0 0 2px; }
.timeline h3 { margin: 0 0 0.3em; }
.timeline p:last-child { margin-bottom: 0; }

.check-list { list-style: none; padding: 0; }
.check-list li { padding-left: 1.8em; position: relative; margin-bottom: 0.6em; }
.check-list li::before {
    content: "✓"; position: absolute; left: 0; top: 0.15em;
    width: 1.3em; height: 1.3em; border-radius: 50%; display: grid; place-items: center;
    background: var(--accent-light); color: var(--accent-dark); font-size: 0.75em; font-weight: 700;
}
.check-list.no li::before { content: "–"; background: var(--bg-alt); color: var(--muted); }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }

/* Pasos numerados con precio */
.steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; counter-reset: step; }
.steps > li {
    counter-increment: step; max-width: none; background: var(--surface);
    border: 1px solid var(--line); border-top: 4px solid var(--brand);
    border-radius: var(--radius); padding: 28px; box-shadow: var(--shadow);
}
.steps > li::before {
    content: "0" counter(step); display: block;
    font: 800 2rem/1 var(--font-head); color: var(--brand); margin-bottom: 14px;
}
.price { font: 800 1.6rem/1.2 var(--font-head); color: var(--ink); margin: 0 0 0.5em; }
.price small { font: 500 0.9rem var(--font-body); color: var(--muted); }

/* Preguntas frecuentes */
.faq { max-width: 820px; display: grid; gap: 12px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 24px; }
.faq summary {
    cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
    font: 600 1.05rem/1.4 var(--font-head); color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
    content: "+"; position: absolute; right: 0; top: 16px;
    font: 400 1.6rem/1 var(--font-body); color: var(--accent);
    transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { margin: 0 0 20px; }

/* Bloque de cierre */
.closing { background: var(--ink); color: rgba(255, 255, 255, 0.78); padding: 80px 0; position: relative; overflow: hidden; }
.closing::after {
    content: ""; position: absolute; right: -120px; top: -120px; width: 380px; height: 380px; border-radius: 50%;
    background: radial-gradient(circle, rgba(230, 57, 70, 0.35) 0%, rgba(230, 57, 70, 0) 70%);
}
.closing .wrap { position: relative; z-index: 1; }
.closing h2 { color: #fff; max-width: 22ch; }
.closing p { font-size: 1.1rem; }
.closing a:not(.btn) { color: #fff; }

/* Fotos */
.photo { border-radius: var(--radius); box-shadow: var(--shadow); background: var(--surface); }
.about-grid { display: grid; grid-template-columns: 320px 1fr; gap: 56px; align-items: start; }
.photo-frame { position: relative; z-index: 0; }
.photo-frame::before {
    content: ""; position: absolute; inset: 16px -16px -16px 16px;
    border: 2px solid var(--brand); border-radius: var(--radius); z-index: -1;
}
.medal {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 28px;
    background: var(--surface); border-radius: 999px; padding: 10px 18px; box-shadow: var(--shadow);
    font: 600 0.92rem/1.2 var(--font-head); color: var(--ink);
}
.medal::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: #B8732E; }

/* ---------- Del documento a la fila (servicios) ---------- */
.transform {
    display: grid; grid-template-columns: 320px minmax(0, 1fr);
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow-lg); overflow: hidden;
}
.doc {
    padding: 28px; border-right: 1px solid var(--line); background-color: var(--bg-alt);
    background-image:
        linear-gradient(rgba(20, 17, 13, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 17, 13, 0.05) 1px, transparent 1px);
    background-size: 22px 22px;
    font-size: 0.92rem;
}
.doc-sheet { background: var(--surface); border-radius: 6px; padding: 20px; box-shadow: var(--shadow); transform: rotate(-1.2deg); }
.doc-title { font: 700 1.05rem/1.2 var(--font-head); color: var(--ink); margin: 0 0 14px; }
.doc dl { display: grid; grid-template-columns: auto 1fr; gap: 7px 12px; margin: 0; }
.doc dt { color: var(--muted); }
.doc dd { margin: 0; color: var(--ink); font-variant-numeric: tabular-nums; }
.mark {
    display: inline-grid; place-items: center; width: 1.4em; height: 1.4em;
    background: var(--accent); color: #fff; border-radius: 50%;
    font: 700 0.7rem/1 var(--font-body); margin-right: 6px; vertical-align: 0.1em;
}
.rows { padding: 28px; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.rows-caption { margin: 0 0 12px; font-weight: 600; color: var(--ink); }
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; font-variant-numeric: tabular-nums; color: var(--ink); }
.data-table th, .data-table td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table th { color: var(--muted); font-weight: 600; background: var(--bg); }
.data-table tr:last-child td { border-bottom: 0; }
.status { font-weight: 600; white-space: normal !important; min-width: 120px; }
.status-ok { color: var(--ok); }
.status-check { color: var(--check); }
.transform-note { margin: 12px 0 0; }

/* ---------- Dos caminos (home) ---------- */
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 56px; }
.path {
    position: relative; padding: 36px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
    display: flex; flex-direction: column; overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.path:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.path::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 5px; background: var(--brand); }
.path p { flex: 1; }
.path-kicker { font: 600 0.85rem/1 var(--font-body); color: var(--accent); margin: 0 0 12px; }
.path-primary { background: var(--ink); border-color: var(--ink); color: rgba(255, 255, 255, 0.78); }
.path-primary h2 { color: #fff; }
.path-primary .path-kicker { color: #FF8A93; }
.path h2 { font-size: 1.7rem; }

/* ---------- Formulario ---------- */
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 44px; }
.form { display: grid; gap: 18px; }
.form label { display: block; font-weight: 600; color: var(--ink); margin-bottom: 6px; font-size: 0.95rem; }
.form input, .form select, .form textarea {
    width: 100%; padding: 12px 14px; font: inherit; color: var(--ink);
    background: var(--bg); border: 1px solid rgba(20, 17, 13, 0.3); border-radius: 8px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-light);
}
.form .btn { justify-self: start; }
.form-status { min-height: 1.6em; margin: 0; font-weight: 600; }
.form-status.is-ok { color: var(--ok); }
.form-status.is-error { color: var(--accent-dark); }
.hp { display: none; }
.contact-list { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
.contact-list a { font-weight: 600; }

/* ---------- Pie ---------- */
.site-footer { background: var(--ink); color: rgba(255, 255, 255, 0.6); padding: 32px 0; font-size: 0.92rem; border-top: 1px solid rgba(255, 255, 255, 0.1); }
.footer-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0; padding: 0; }
.site-footer a { color: rgba(255, 255, 255, 0.8); }
.site-footer a:hover { color: #fff; }

/* ---------- CV ---------- */
.cv { padding: 56px 0 var(--section); }
.cv-head { display: grid; grid-template-columns: 140px 1fr; gap: 32px; align-items: center; padding-bottom: 36px; border-bottom: 4px solid var(--brand); }
.cv-head .photo { border-radius: 50%; border: 4px solid var(--surface); }
.cv-head h1 { margin-bottom: 0.2em; }
.cv-head .lead { margin-bottom: 18px; }
.cv-head .actions { margin: 0; }
.cv-grid { display: grid; grid-template-columns: 280px 1fr; gap: 48px; padding-top: 40px; }
.cv-side { background: var(--ink); color: rgba(255, 255, 255, 0.75); border-radius: var(--radius); padding: 28px; align-self: start; }
.cv-side h2 { color: #fff; font-size: 1.05rem; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--brand); }
.cv-side h2:not(:first-child) { margin-top: 28px; }
.cv-side a { color: #fff; }
.cv-side p, .cv-side li { font-size: 0.93rem; }
.cv-main h2 { font-size: 1.4rem; margin: 0 0 16px; }
.cv-main section + section { margin-top: 44px; }
.plain { list-style: none; padding: 0; margin: 0; }
.plain li { margin-bottom: 4px; }
.cv .rules-2col > li { grid-template-columns: 170px 1fr; }
.cv .rules .meta { color: var(--accent); font-weight: 600; }

/* ---------- Aparición al hacer scroll (solo con JS y sin reduced-motion) ---------- */
.js-reveal .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.16, 1, 0.3, 1); }
.js-reveal .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    :root { --section: 72px; }
    .hero-grid, .two-col, .about-grid, .transform, .paths, .steps, .card-grid { grid-template-columns: 1fr; }
    .stats ul { grid-template-columns: 1fr 1fr; }
    .rules-2col > li { grid-template-columns: 1fr; }
    .doc { border-right: 0; border-bottom: 1px solid var(--line); }
    .about-grid .photo-frame { max-width: 260px; }
    .hero-graphic { max-width: 520px; }
    .hero-chip { left: 12px; }
    .cv-grid, .cv .rules-2col > li { grid-template-columns: 1fr; }
    .cv-grid { gap: 32px; }
}
@media (max-width: 640px) {
    :root { --gutter: 18px; --section: 60px; }
    .hero { padding: 48px 0 56px; }
    .site-nav .hide-sm { display: none; }
    .header-in { gap: 8px; }
    .logo { font-size: 1.3rem; }
    .site-nav ul { gap: 4px 12px; flex-wrap: nowrap; }
    .site-nav a { font-size: 0.85rem; }
    .site-nav .lang a { padding: 3px 8px; }
    .path, .doc, .rows, .card, .steps > li, .contact-card { padding: 22px; }
    .stats ul { gap: 20px 16px; }
    .stats strong { font-size: 1.5rem; }
    .cv-head { grid-template-columns: 84px 1fr; gap: 16px; }
    .terminal { font-size: 0.78rem; }
    /* En móvil cada fila de la tabla pasa a ficha para que el estado se vea sin desplazar */
    .table-scroll { overflow: visible; border: 0; }
    .data-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .data-table tr { display: block; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; }
    .data-table td { display: grid; grid-template-columns: 100px 1fr; gap: 8px; white-space: normal; padding: 8px 12px; }
    .data-table td::before { content: attr(data-label); color: var(--muted); }
    .data-table tr td:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
    html { scroll-behavior: auto; }
    .js-reveal .reveal { opacity: 1; transform: none; }
}

@media print {
    @page { size: A4; margin: 14mm; }
    .site-header, .site-footer, .closing, .skip-link, [data-print] { display: none; }
    body { background: #fff; font-size: 10pt; line-height: 1.45; }
    a { color: var(--ink); text-decoration: none; }
    .cv { padding: 0; }
    .cv-head { grid-template-columns: 80px 1fr; padding-bottom: 14px; }
    .cv-grid { grid-template-columns: 180px 1fr; gap: 24px; padding-top: 16px; }
    .cv-side { background: none; color: var(--muted); padding: 0; }
    .cv-side h2 { color: var(--ink); }
    .cv-side a { color: var(--ink); }
    .cv .rules-2col > li { grid-template-columns: 120px 1fr; padding: 8px 0; break-inside: avoid; }
    .js-reveal .reveal { opacity: 1; transform: none; }
    h1 { font-size: 22pt; }
}
