/*
 * Discovirtual: CSS propio y ligero (sin frameworks ni fuentes externas).
 * Paleta de docs/MARCA.md. Contrastes comprobados para WCAG 2.2 AA:
 *   azul noche #0b1f33 / blanco 16:1 · azul #0a6ba8 / blanco 5,6:1 · texto #1b2b3c / blanco 14:1
 *   azul noche / cian #2fb8e6 8,4:1 · azul noche / naranja #f39200 7,5:1 · gris #4a5b6c / blanco 7:1
 */

:root {
    --navy: #0b1f33;
    --navy-2: #12304d;
    --cyan: #2fb8e6;
    --blue: #0a6ba8;
    --blue-dark: #085585;
    --orange: #f39200;
    --orange-dark: #d98200;
    --text: #1b2b3c;
    --muted: #4a5b6c;
    --bg: #ffffff;
    --bg-alt: #f2f7fb;
    --border: #d5e0ea;
    --ok-bg: #e8f6ee;
    --ok-border: #1f8a4c;
    --warn-bg: #fff4de;
    --warn-border: #b36b00;
    --radius: 10px;
    --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
    --max: 72rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.65;
    color: var(--text);
    background: var(--bg);
}
img, svg { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.2; color: var(--navy); margin: 0 0 .6em; }
h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); letter-spacing: -.01em; }
h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); }
h3, .h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
a { color: var(--blue); text-underline-offset: .15em; }
a:hover { color: var(--blue-dark); }
ul, ol { padding-left: 1.3em; }
.mb-0 { margin-bottom: 0; }

/* Foco visible en todo lo interactivo (WCAG 2.4.7 / 2.4.11) */
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 3px; }
.site-footer :focus-visible, .hero :focus-visible, .cta-band :focus-visible, .cookie-banner :focus-visible { outline-color: var(--cyan); }
[tabindex="-1"]:focus { outline: none; }

.visually-hidden {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
    position: absolute; left: .5rem; top: -4rem; z-index: 100; background: var(--navy); color: #fff;
    padding: .6rem 1rem; border-radius: 0 0 var(--radius) var(--radius); text-decoration: none;
}
.skip-link:focus { top: 0; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1rem; }
.container.narrow { max-width: 48rem; }

/* Cabecera --------------------------------------------------------------------------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: relative; z-index: 20; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.25rem; }
.brand { display: inline-flex; align-items: center; line-height: 0; }
.brand img { display: block; width: 150px; height: 40px; }
.btn.nav-toggle { display: none; }
.nav-list { list-style: none; display: flex; align-items: center; gap: .25rem 1.1rem; margin: 0; padding: 0; flex-wrap: wrap; }
.nav-list > li { position: relative; }
.nav-list a, .nav-more summary { color: var(--navy); text-decoration: none; font-weight: 600; font-size: .98rem; padding: .5rem .15rem; display: inline-block; cursor: pointer; }
.nav-list a:hover, .nav-more summary:hover { color: var(--blue); text-decoration: underline; }
.nav-list a[aria-current="page"] { color: var(--blue); border-bottom: 3px solid var(--orange); }
.nav-more summary { list-style: none; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: ""; display: inline-block; margin-left: .4rem; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.nav-more[data-current] summary { color: var(--blue); border-bottom: 3px solid var(--orange); }
.nav-more ul {
    list-style: none; margin: 0; padding: .5rem; position: absolute; left: 0; top: 100%; min-width: 17rem; z-index: 30;
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 10px 30px rgba(11, 31, 51, .15);
}
.nav-more li a { display: block; padding: .45rem .7rem; border-radius: 6px; font-weight: 500; }
.nav-more li a:hover { background: var(--bg-alt); }

/* Botones ---------------------------------------------------------------------------- */
.btn {
    display: inline-block; font: inherit; font-weight: 700; text-align: center; text-decoration: none; cursor: pointer;
    padding: .6rem 1.1rem; border-radius: 8px; border: 2px solid transparent; line-height: 1.3;
}
.btn-lg { padding: .8rem 1.5rem; font-size: 1.05rem; }
.btn-accent { background: var(--orange); color: var(--navy); border-color: var(--orange); }
.btn-accent:hover { background: var(--orange-dark); border-color: var(--orange-dark); color: var(--navy); }
.btn-primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-outline { background: transparent; color: var(--navy); border-color: var(--navy); }
.btn-outline:hover { background: var(--navy); color: #fff; }
.btn-outline-light { background: transparent; color: #fff; border-color: #fff; }
.btn-outline-light:hover { background: #fff; color: var(--navy); }
.nav-list .btn-accent { color: var(--navy); padding: .5rem 1rem; }
.nav-list .btn-accent:hover { text-decoration: none; color: var(--navy); }

/* Migas ------------------------------------------------------------------------------ */
.crumbs-bar { background: var(--bg-alt); border-bottom: 1px solid var(--border); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .25rem .5rem; margin: 0; padding: .6rem 0; font-size: .92rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: .5rem; color: var(--muted); }
.breadcrumbs a { color: var(--blue); }

/* Cabecera de página (hero) ------------------------------------------------------------ */
.hero { background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%); color: #fff; padding: clamp(2.2rem, 6vw, 4.2rem) 0; }
.hero h1 { color: #fff; max-width: 22ch; }
.hero-home h1 { max-width: 26ch; }
.hero .lead { font-size: clamp(1.1rem, 2.2vw, 1.3rem); max-width: 46rem; color: #e4eef7; }
.hero a:not(.btn) { color: #9fdcf3; }
.hero-price { font-size: 1.15rem; margin: 0 0 1.2rem; }
.hero-price strong { color: var(--cyan); font-size: 1.5rem; margin-right: .4rem; }
.hero-price span { color: #cfe0ee; font-size: .95rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.4rem 0 0; }
.hero-points { list-style: none; padding: 0; margin: 1.8rem 0 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; color: #e4eef7; font-size: .98rem; }
.hero-points li::before { content: "\2713"; color: var(--cyan); font-weight: 700; margin-right: .45rem; }

/* Secciones y rejillas ------------------------------------------------------------------ */
.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section-alt { background: var(--bg-alt); }
.section-lead { font-size: 1.15rem; color: var(--muted); max-width: 46rem; }
.group-title { margin-top: 2rem; color: var(--blue); font-size: 1.1rem; text-transform: uppercase; letter-spacing: .05em; }
.grid { display: grid; gap: 1.25rem; }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; }
.section-alt .card { background: #fff; }
.card h3, .card h4, .card h2 { margin-bottom: .4em; }
.card h3 a, .card h4 a, .card h2 a { color: var(--navy); text-decoration: none; }
.card h3 a:hover, .card h4 a:hover, .card h2 a:hover { color: var(--blue); text-decoration: underline; }
.card p { margin-bottom: .6em; color: var(--muted); }
.card-price { color: var(--blue) !important; font-weight: 700; margin-top: auto; margin-bottom: 0 !important; }
.card-price small { font-weight: 400; color: var(--muted); }
.checklist { list-style: none; padding: 0; }
.checklist li { position: relative; padding-left: 1.7rem; margin-bottom: .6rem; }
.checklist li::before { content: "\2713"; position: absolute; left: 0; color: var(--blue); font-weight: 800; }

.steps { list-style: none; counter-reset: paso; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.steps li { counter-increment: paso; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.1rem 1.1rem 3.6rem; position: relative; display: flex; flex-direction: column; gap: .25rem; }
.steps li::before { content: counter(paso); position: absolute; left: 1rem; top: 1rem; width: 2rem; height: 2rem; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: grid; place-items: center; }
.steps strong { color: var(--navy); }
.timing { margin-top: 1.2rem; }

.faq details { border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: .7rem; background: #fff; }
.faq summary { cursor: pointer; font-weight: 700; color: var(--navy); padding: .9rem 1.1rem; list-style: none; position: relative; padding-right: 2.6rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 1.1rem; top: .7rem; font-size: 1.4rem; line-height: 1; color: var(--blue); }
.faq details[open] summary::after { content: "\2212"; }
.faq details p { padding: 0 1.1rem 1rem; margin: 0; }

/* Tablas ------------------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; margin: 1rem 0; }
table { border-collapse: collapse; width: 100%; font-size: .98rem; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--border); vertical-align: top; }
thead th { background: var(--navy); color: #fff; }
.price-table tbody th { font-weight: 600; color: var(--navy); }
.price-table td { white-space: nowrap; }
.note-small { font-size: .92rem; color: var(--muted); }

/* Llamada a la acción -------------------------------------------------------------------- */
.cta-band { background: var(--navy); color: #fff; padding: clamp(2rem, 5vw, 3rem) 0; }
.cta-band h2 { color: #fff; margin-bottom: .3em; }
.cta-band p { color: #dbe8f3; margin: 0; }
.cta-inner { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; justify-content: space-between; }
.cta-actions { display: flex; flex-wrap: wrap; gap: .75rem; }

/* Listas de enlaces, avisos, etiquetas ----------------------------------------------------- */
.link-list { list-style: none; padding: 0; }
.link-list li { padding: .75rem 0; border-bottom: 1px solid var(--border); }
.link-list span { color: var(--muted); font-size: .95rem; }
.notice { border-left: 5px solid var(--blue); background: var(--bg-alt); padding: .9rem 1.1rem; border-radius: 6px; margin: 1rem 0; }
.notice p { margin: 0 0 .4em; }
.notice p:last-child { margin: 0; }
.notice-ok { background: var(--ok-bg); border-color: var(--ok-border); }
.notice-draft { background: var(--warn-bg); border-color: var(--warn-border); }
mark.pending { background: #ffe08a; color: #3b2a00; padding: 0 .25em; border-radius: 3px; font-weight: 700; }
.tag { display: inline-block; background: var(--bg-alt); color: var(--blue-dark); border: 1px solid var(--border); border-radius: 999px; padding: .05rem .65rem; font-size: .85rem; font-weight: 600; }
.post-meta { color: var(--muted); font-size: .95rem; margin-bottom: .7rem; }

/* Blog y textos largos ------------------------------------------------------------------- */
.post { padding-top: 2rem; padding-bottom: 2rem; }
.page-body { padding-top: 2rem; padding-bottom: 3rem; }
.prose { font-size: 1.08rem; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose pre, .prose code { font-family: Consolas, "Courier New", monospace; font-size: .92em; }
.prose code { background: var(--bg-alt); padding: .1em .35em; border-radius: 4px; }
.prose pre { background: var(--navy); color: #e4eef7; padding: 1rem; border-radius: var(--radius); overflow-x: auto; }
.prose blockquote { margin: 1.2em 0; padding: .2em 1em; border-left: 4px solid var(--cyan); color: var(--muted); }
.post-figure { margin: 1.4rem 0; }
.post-figure img { display: block; width: 100%; height: auto; border-radius: var(--radius); }
.post-figure figcaption { font-size: .9rem; color: var(--muted); margin-top: .4rem; }
.post-card img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin-bottom: .7rem; }
.legal-text .prose h2 { font-size: 1.35rem; }

/* Formularios ------------------------------------------------------------------------- */
.contact-layout { display: grid; gap: 2rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
.form-box { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; }
form p { margin-bottom: 1.1rem; }
label { display: block; font-weight: 600; margin-bottom: .3rem; color: var(--navy); }
input[type="text"], input[type="email"], input[type="tel"], select, textarea {
    width: 100%; font: inherit; color: var(--text); background: #fff; border: 2px solid #7f94a8; border-radius: 8px; padding: .65rem .8rem;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
.check label { font-weight: 400; display: flex; gap: .6rem; align-items: flex-start; }
.check input { width: 1.25rem; height: 1.25rem; margin-top: .25rem; flex: none; }
.field-error { color: #a31616; font-weight: 600; margin: .3rem 0 0; }
[aria-invalid="true"] { border-color: #a31616 !important; }
.hp-field { position: absolute; left: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.contact-side { background: var(--bg-alt); border-radius: var(--radius); padding: 1.25rem; }
.plain { list-style: none; padding: 0; }
.plain li { margin-bottom: .9rem; }

/* Pie --------------------------------------------------------------------------------- */
.site-footer { background: var(--navy); color: #cfe0ee; padding: 2.5rem 0 1.5rem; margin-top: 0; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--cyan); }
.site-footer h2 { color: #fff; font-size: 1.05rem; margin-bottom: .6rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .4rem; font-size: .96rem; }
.footer-brand { margin-bottom: 1.8rem; max-width: 36rem; }
.footer-brand p { margin: .8rem 0 0; font-size: .96rem; }
.legal-nav { border-top: 1px solid #2a4560; margin-top: 1.8rem; padding-top: 1.1rem; }
.legal-nav ul { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.legal { font-size: .88rem; color: #b6cadb; margin: 1rem 0 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: #fff; text-decoration: underline; cursor: pointer; }

/* Banner de cookies -------------------------------------------------------------------- */
.cookie-banner { position: fixed; inset: auto 0 0 0; z-index: 90; background: var(--navy); color: #fff; box-shadow: 0 -6px 24px rgba(0, 0, 0, .3); padding: 1rem; }
.cookie-banner[hidden] { display: none; }
.cookie-banner .inner { max-width: var(--max); margin: 0 auto; }
.cookie-banner h2 { color: #fff; font-size: 1.1rem; }
.cookie-banner p { margin: 0 0 .8rem; font-size: .95rem; }
.cookie-banner a { color: #9fdcf3; }
.cookie-banner .actions, .cookie-banner .btn-group { display: flex; flex-wrap: wrap; gap: .6rem; }
.cookie-banner .btn-outline { color: #fff; border-color: #fff; }
.cookie-banner .btn-outline:hover { background: #fff; color: var(--navy); }
.cookie-settings { margin: .5rem 0 1rem; }
.cookie-settings label { color: #fff; font-weight: 400; display: flex; gap: .6rem; }

/* Móvil -------------------------------------------------------------------------------- */
@media (max-width: 62rem) {
    .contact-layout { grid-template-columns: 1fr; }
}
@media (max-width: 56rem) {
    .js .btn.nav-toggle { display: inline-block; }
    .js .site-nav { display: none; width: 100%; }
    .js .site-nav.is-open { display: block; }
    .header-inner { flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; }
    .nav-list { flex-direction: column; align-items: stretch; gap: 0; padding-bottom: .8rem; }
    .nav-list a, .nav-more summary { display: block; padding: .7rem .2rem; }
    .nav-more ul { position: static; box-shadow: none; border: 0; padding: 0 0 0 .8rem; min-width: 0; }
    .nav-list .btn-accent { margin-top: .5rem; text-align: center; }
    .nav-list > li { border-bottom: 1px solid var(--border); }
    .nav-list > li:last-child { border-bottom: 0; }
    .hero h1 { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation: none !important; transition: none !important; }
}
@media print {
    .site-header, .site-footer, .cta-band, .cookie-banner, .skip-link { display: none !important; }
    .hero { background: none; color: #000; padding: 0; }
    .hero h1 { color: #000; }
}

/* Comparativa de planes y fichas de proyecto */
.compare-table td { white-space: normal; }
.compare-table thead th { text-align: left; }
.facts { margin: 1rem 0; }
.facts dt { font-weight: 600; color: var(--navy); margin-top: .75rem; }
.facts dd { margin: .15rem 0 0; }

/* Precios: sin IVA y, debajo, con IVA */
.vat-net { font-weight: 400; font-size: .9em; }
.vat-gross { display: block; font-weight: 400; color: var(--muted); font-size: .8rem; margin-top: .1rem; }
.hero-price .vat-gross { color: #cfe0ee; }
.hero-price strong + .vat-net { color: #cfe0ee; }
.vat-gross-cell { color: var(--muted); }

/* Proyectos (D-21): tarjetas fijas con captura */
.projects { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.project img { width: calc(100% + 2.5rem); max-width: none; height: auto; margin: -1.25rem -1.25rem 1rem; border-bottom: 1px solid var(--border); border-radius: var(--radius) var(--radius) 0 0; }
.project { scroll-margin-top: 6rem; }
.project-link { margin: auto 0 0; font-weight: 700; }

/* Botones del panel y del área de cliente ------------------------------------------------- */
.btn-sm { padding: .3rem .7rem; font-size: .88rem; border-width: 1px; font-weight: 600; white-space: nowrap; }
.btn-soft { background: #e8f2fa; color: var(--blue-dark); border-color: #b9d6ec; }
.btn-soft:hover, .btn-soft:focus-visible { background: var(--blue); border-color: var(--blue); color: #fff; text-decoration: none; }
.btn-danger { background: #fdecec; color: #a3231c; border-color: #efb4b0; }
.btn-danger:hover, .btn-danger:focus-visible { background: #a3231c; border-color: #a3231c; color: #fff; }
.btn-row { display: inline-flex; flex-wrap: wrap; gap: .35rem; margin-left: .5rem; vertical-align: middle; }
.btn:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
.doc-logo { display: block; margin: 0 0 1rem; max-width: 100%; height: auto; }

/* Vídeo de presentación */
.video-figure { margin: 1.2rem 0 0; }
.video-figure video { display: block; width: 100%; height: auto; border-radius: var(--radius); background: var(--navy); box-shadow: 0 10px 30px rgba(11, 31, 51, .18); }
.video-figure figcaption { margin-top: .5rem; font-size: .92rem; color: var(--muted); }
