/* /organismospublicos (docs/organismos-publicos.md). Hoja propia: no pasa por Vite. */

:root {
    --bosque: #0a241c;
    --bosque-2: #0f3527;
    --noche: #0a1830;
    --lima: #b8e23c;
    --celeste: #86cdf6;
    --azul: #1758d6;
    --papel: #f2f6f1;
    --tinta: #10231b;
    --tinta-2: #4a5d54;
    --claro: #eef5f0;
    --claro-2: #a9c2b5;
    --borde: rgba(255, 255, 255, .14);
    --radio: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 1.0625rem/1.6 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    color: var(--claro);
    background: var(--bosque);
    -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4, p, ul, ol, dl, dd, figure, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img { display: block; height: 34px; width: auto; }
.icono { width: 1.5em; height: 1.5em; flex: none; }
.ancho { width: min(1240px, 100% - 2.5rem); margin-inline: auto; }
:focus-visible { outline: 3px solid var(--lima); outline-offset: 3px; border-radius: 8px; }

h1, h2 { font-weight: 300; line-height: 1.08; letter-spacing: -.025em; word-spacing: .08em; text-wrap: balance; }
h1 em, h2 em { font-style: italic; font-weight: 800; color: var(--lima); }
h1 { font-size: clamp(2.5rem, 1.5rem + 4vw, 4.4rem); }
h2 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); }
.bajada { font-size: 1.175rem; max-width: 60ch; margin-top: 1.1rem; color: #d5e4db; }
.chico { font-size: .9rem; color: var(--tinta-2); }

.saltar { position: absolute; left: 1rem; top: -5rem; z-index: 20; background: var(--lima); color: var(--bosque); padding: .7rem 1.1rem; border-radius: 10px; font-weight: 700; }
.saltar:focus { top: 1rem; }

.boton { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: .7rem 1.5rem; border: 1.5px solid var(--lima); border-radius: 999px; background: var(--lima); color: #0c2418; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.boton:hover { background: #cdf05c; border-color: #cdf05c; }
.boton[disabled] { opacity: .6; cursor: progress; }
.boton-linea { background: transparent; color: var(--claro); border-color: rgba(255, 255, 255, .4); }
.boton-linea:hover { background: rgba(255, 255, 255, .1); border-color: var(--claro); }
.boton-chico { min-height: 42px; padding: .4rem 1.1rem; }

/* ── Barra ── */
.barra { position: sticky; top: 0; z-index: 10; background: rgba(8, 28, 24, .97); backdrop-filter: blur(10px); border-bottom: 1px solid var(--borde); }
.barra-interior { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 64px; }
.marca { display: flex; align-items: center; gap: .8rem; color: inherit; text-decoration: none; }
.marca-tesi { padding-left: .8rem; border-left: 1px solid rgba(255, 255, 255, .3); font-weight: 800; letter-spacing: .04em; }
.barra nav { display: flex; align-items: center; gap: 1.6rem; }
.barra nav a:not(.boton) { color: #d5e4db; text-decoration: none; font-weight: 500; padding: .5rem 0; }
.barra nav a:not(.boton):hover { color: #fff; }

/* ── Portada ── */
.portada { position: relative; overflow: hidden; padding: clamp(3rem, 7vw, 6.5rem) 0 2.5rem; background: linear-gradient(118deg, #0c3626 0%, var(--bosque) 40%, var(--noche) 100%); isolation: isolate; }
#calles { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: .85; }
.portada-interior { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.pildora { display: inline-block; padding: .35rem 1rem; margin-bottom: 1.4rem; border: 1px solid var(--lima); border-radius: 999px; color: var(--lima); font-weight: 600; font-size: .95rem; }
.acciones { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 2rem; }

.recorrido { padding: 1.6rem 1.6rem 1.2rem; border: 1px solid var(--borde); border-radius: 24px; background: rgba(6, 20, 26, .68); }
.recorrido ol { position: relative; display: grid; gap: 1.35rem; }
.recorrido ol::before { content: ""; position: absolute; left: 22px; top: 22px; bottom: 22px; width: 2px; background: linear-gradient(var(--lima), var(--celeste)); opacity: .45; }
.recorrido li { display: flex; gap: 1rem; align-items: center; position: relative; }
.recorrido-icono { display: grid; place-items: center; width: 46px; height: 46px; flex: none; border-radius: 50%; border: 1px solid rgba(184, 226, 60, .6); background: #0b2a22; color: var(--lima); }
.recorrido strong { display: block; font-weight: 700; line-height: 1.3; }
.recorrido li div > span { color: var(--claro-2); font-size: .95rem; }
.recorrido .numero { font-variant-numeric: tabular-nums; }
.recorrido figcaption { margin-top: 1.2rem; padding-top: .9rem; border-top: 1px solid var(--borde); font-size: .875rem; color: var(--claro-2); }
@media (prefers-reduced-motion: no-preference) {
    .recorrido-icono { animation: encender 6s infinite both; }
    .recorrido li:nth-child(2) .recorrido-icono { animation-delay: 1.5s; }
    .recorrido li:nth-child(3) .recorrido-icono { animation-delay: 3s; }
    .recorrido li:nth-child(4) .recorrido-icono { animation-delay: 4.5s; }
}
@keyframes encender {
    0%, 30%, 100% { background: #0b2a22; color: var(--lima); box-shadow: none; }
    6%, 22% { background: var(--lima); color: #0b2a22; box-shadow: 0 0 26px rgba(184, 226, 60, .55); }
}

.cifras { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: clamp(2.5rem, 5vw, 4.5rem); border-top: 1px solid var(--borde); }
.cifras div { display: flex; flex-direction: column-reverse; justify-content: flex-end; padding: 1.4rem 1rem 0 0; }
.cifras dd { font-size: clamp(1.9rem, 1.3rem + 1.8vw, 2.8rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.cifras dt { color: #c6d8ce; line-height: 1.35; }
.cifras-nota { margin-top: 1rem; font-size: .9rem; color: var(--claro-2); }

/* ── Módulos ── */
.modulos { padding: clamp(3.5rem, 7vw, 6rem) 0; background: linear-gradient(180deg, #0a1a2b, #09211b 70%); }
.tablero { position: relative; display: grid; gap: 1.9rem; margin-top: 2.4rem; }
.grupo h3 { font-size: 1.15rem; font-weight: 800; line-height: 1.3; margin-bottom: .8rem; }
.grupo h3 span { font-weight: 400; color: var(--claro-2); margin-left: .35rem; font-size: 1rem; }
.grupo-destacado h3 { font-size: 1.5rem; color: var(--lima); }
.fichas { display: grid; gap: .7rem; }
.modulo h4 { font: inherit; }
.ficha { display: flex; align-items: center; gap: .8rem; width: 100%; min-height: 62px; padding: .75rem 1rem; border: 1px solid var(--borde); border-radius: 14px; background: rgba(255, 255, 255, .045); color: var(--claro); font: inherit; font-weight: 600; line-height: 1.25; text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.ficha .icono { color: var(--celeste); font-size: 1.1rem; }
.grupo-destacado .ficha { border-color: rgba(184, 226, 60, .5); background: rgba(184, 226, 60, .08); }
.grupo-destacado .ficha .icono { color: var(--lima); }
.ficha:hover { background: rgba(255, 255, 255, .1); }
.modulo.activo .ficha { background: var(--lima); border-color: var(--lima); color: #0c2418; }
.modulo.activo .ficha .icono { color: #0c2418; }

.detalle { padding: 1.1rem 1.1rem 1.3rem; color: #dbe8e0; }
.detalle-titulo { display: none; }
.detalle-resumen { font-weight: 500; color: #fff; }
.detalle ul { display: grid; gap: .5rem; margin: 1rem 0; }
.detalle li, .lista li { position: relative; padding-left: 1.4rem; line-height: 1.45; }
.detalle li::before, .lista li::before { content: ""; position: absolute; left: 0; top: .5em; width: 9px; height: 9px; border-radius: 50%; background: var(--lima); }
.detalle-necesita { padding-top: .9rem; border-top: 1px solid var(--borde); font-size: .975rem; color: #c6d8ce; }
.viene { display: inline-block; padding: .08rem .7rem; margin-right: .35rem; border-radius: 999px; font-weight: 700; font-size: .875rem; white-space: nowrap; background: var(--lima); color: #0c2418; }
.viene-configurar { background: var(--celeste); color: #08203a; }
.viene-apagado { background: transparent; color: #ffd7a8; box-shadow: inset 0 0 0 1.5px #ffb765; }
.detalle-consultar { display: inline-block; margin-top: 1rem; color: var(--lima); font-weight: 700; text-underline-offset: 4px; }
.modulos-nota { margin-top: 2rem; color: #c6d8ce; max-width: 75ch; }
.modulos-nota a { color: var(--lima); }
.solo-raton { display: none; }

/* Con JavaScript: uno abierto por vez. */
.con-js .modulo:not(.activo) .detalle { display: none; }

@media (max-width: 999px) {
    .modulo.activo .ficha { border-radius: 14px 14px 0 0; }
    .con-js .modulo.activo .detalle, .sin-js .detalle { border: 1px solid var(--borde); border-top: 0; border-radius: 0 0 14px 14px; background: rgba(255, 255, 255, .03); }
    .ficha::after { content: "+"; margin-left: auto; font-size: 1.4rem; font-weight: 400; line-height: 1; }
    .modulo.activo .ficha::after { content: "–"; }
    .sin-js .ficha::after { content: none; }
}

@media (min-width: 1000px) {
    .con-js .solo-raton { display: inline; }
    .con-js .solo-dedo { display: none; }
    .con-js .tablero { padding-right: calc(44% + 2rem); min-height: 690px; align-content: start; }
    .con-js .fichas { grid-template-columns: repeat(2, 1fr); }
    .con-js .grupo-destacado .fichas { grid-template-columns: repeat(3, 1fr); }
    .con-js .grupo-destacado .ficha { flex-direction: column; align-items: flex-start; height: 100%; min-height: 104px; justify-content: space-between; font-weight: 700; }
    .con-js .grupo-destacado .modulo h4 { height: 100%; }
    .con-js .grupo-destacado .ficha .icono { width: 1.7em; height: 1.7em; }
    .con-js .modulo.activo .detalle { position: absolute; top: 0; right: 0; bottom: 0; width: 44%; padding: 1.8rem 2rem 1.6rem; border: 1px solid rgba(184, 226, 60, .45); border-radius: 24px; background: linear-gradient(160deg, #0e3a29, #0a2138); display: flex; flex-direction: column; overflow: auto; }
    .con-js .detalle-titulo { display: block; font-size: 1.85rem; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; margin-bottom: .6rem; color: #fff; }
    .con-js .detalle-resumen { font-size: 1.1rem; font-weight: 400; color: #dcebe2; }
    .con-js .detalle ul { gap: .55rem; margin: 1.1rem 0; }
    .con-js .detalle-necesita { margin-top: auto; }
    .con-js .detalle-consultar { align-self: flex-start; }
}
@media (min-width: 1000px) and (max-width: 1239px) {
    .con-js .tablero { min-height: 840px; padding-right: calc(47% + 1.5rem); }
    .con-js .modulo.activo .detalle { width: 47%; padding: 1.5rem 1.6rem; }
}
@media (min-width: 1000px) {
    .contacto-interior > div { position: sticky; top: 110px; }
}
@media (min-width: 1000px) and (prefers-reduced-motion: no-preference) {
    .con-js .modulo.activo .detalle { animation: aparecer .22s ease-out; }
}
@keyframes aparecer { from { opacity: 0; } }

/* ── Instalar ── */
.instalar { padding: clamp(3.5rem, 7vw, 6rem) 0; background: var(--papel); color: var(--tinta); }
.instalar h2 em { color: #1c6b45; }
.instalar .bajada { color: #33473d; }
.instalar-columnas { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 1.4rem; margin-top: 2.4rem; }
.bloque { padding: 1.8rem; border: 1px solid #d5e0d8; border-radius: var(--radio); background: #fff; }
.bloque h3, .descargas h3 { font-size: 1.35rem; font-weight: 800; line-height: 1.25; margin-bottom: 1rem; }
.bloque .chico { margin-top: 1rem; }
.tabla-ancha { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .975rem; line-height: 1.4; }
th, td { padding: .7rem .9rem .7rem 0; text-align: left; vertical-align: top; border-bottom: 1px solid #e0e8e2; }
thead th { font-weight: 800; color: #1c6b45; }
tbody th { font-weight: 600; color: var(--tinta-2); white-space: nowrap; }
tbody tr:last-child > * { border-bottom: 0; }
.lista { display: grid; gap: .75rem; }
.lista li::before { background: #2c9a63; }

.descargas { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.4rem; margin-top: 1.4rem; padding: 1.8rem; border-radius: var(--radio); background: var(--azul); color: #fff; }
.descargas h3 { grid-column: 1 / -1; margin: 0; }
.descarga { display: flex; align-items: center; gap: 1.1rem; padding: 1.2rem 1.3rem; border-radius: 14px; background: #fff; color: var(--tinta); }
.descarga > .icono { font-size: 1.7rem; color: var(--azul); }
.descarga-texto { flex: 1; display: grid; gap: .15rem; line-height: 1.4; font-size: .95rem; }
.descarga-texto strong { font-size: 1.1rem; }
.descarga-peso { color: var(--tinta-2); font-size: .9rem; }

/* Pedido de los PDF por mail: sobre el fondo azul, como las tarjetas de arriba. */
.pedido { grid-column: 1 / -1; display: grid; gap: 1rem; padding-top: .6rem; border-top: 1px solid rgba(255, 255, 255, .25); }
.pedido-campos { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.2rem; }
/* Los campos heredarían el blanco del recuadro azul: el texto va oscuro, como en el formulario de contacto. */
.pedido .campo input { border-color: #fff; color: var(--tinta); }
.pedido .campo input::placeholder { color: var(--tinta-2); opacity: 1; }
.pedido .campo input:focus { outline: 3px solid var(--lima); outline-offset: 0; border-color: #fff; }
.pedido .con-error input { border-color: #ffb4a9; box-shadow: 0 0 0 2px #ffb4a9; }
.pedido .error { color: #ffe1dc; }
.pedido .aviso { overflow-wrap: anywhere; }
.acepto label { display: flex; align-items: flex-start; gap: .75rem; line-height: 1.45; cursor: pointer; }
.acepto input { flex: none; width: 22px; height: 22px; margin: .1rem 0 0; accent-color: var(--lima); cursor: pointer; }
.pedido .boton { justify-self: start; gap: .55rem; }
.pedido .boton .icono { width: 1.25em; height: 1.25em; }

/* ── Contacto ── */
.contacto { padding: clamp(3.5rem, 7vw, 6rem) 0; background: linear-gradient(118deg, var(--noche), var(--bosque) 60%, #0c3626); }
.contacto-interior { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.contacto-mail { margin-top: 1.6rem; color: #d5e4db; }
.contacto-mail a { color: var(--lima); font-weight: 600; overflow-wrap: anywhere; }
.formulario { display: grid; gap: 1.2rem; padding: clamp(1.3rem, 3vw, 2.2rem); border: 1px solid #d5e0d8; border-radius: 24px; background: #fff; color: var(--tinta); }
.campos { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem 1.2rem; }
.campo-ancho { grid-column: 1 / -1; }
.campo label, .intereses legend { display: block; font-weight: 700; margin-bottom: .35rem; }
.campo label span, .intereses legend span { font-weight: 400; color: var(--tinta-2); }
.campo input, .campo textarea { width: 100%; min-height: 50px; padding: .7rem .9rem; border: 1.5px solid #8fa398; border-radius: 12px; background: #fff; color: inherit; font: inherit; }
.campo textarea { resize: vertical; min-height: 120px; }
.campo input:focus, .campo textarea:focus { outline: 3px solid rgba(28, 107, 69, .28); outline-offset: 0; border-color: #1c6b45; }
.con-error input, .con-error textarea { border-color: #b3261e; }
.error { color: #b3261e; font-size: .925rem; font-weight: 600; }
.error:not(:empty) { margin-top: .3rem; }
.intereses { display: flex; flex-wrap: wrap; gap: .5rem; }
.intereses legend { padding: 0; margin-bottom: .5rem; }
.intereses label { position: relative; cursor: pointer; }
.intereses input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.intereses label span { display: block; padding: .4rem .9rem; border: 1.5px solid #b7c7bd; border-radius: 999px; font-size: .95rem; line-height: 1.35; }
.intereses label:hover span { border-color: #1c6b45; }
.intereses input:checked + span { background: #1c6b45; border-color: #1c6b45; color: #fff; }
.intereses input:focus-visible + span { outline: 3px solid rgba(28, 107, 69, .45); outline-offset: 2px; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.formulario .boton { justify-self: start; background: #17613d; border-color: #17613d; color: #fff; }
.formulario .boton:hover { background: #0f4a2d; border-color: #0f4a2d; }
.formulario :focus-visible { outline-color: #1c6b45; }
.aviso { padding: .9rem 1.1rem; border-radius: 12px; font-weight: 600; background: #e2f4e8; color: #0f4a2d; }
.aviso-mal { background: #fde8e6; color: #8c1d18; }
.aviso[hidden] { display: none; }

/* Enlace de un PDF que venció o no funciona. */
.enlace-vencido { min-height: 100vh; display: grid; align-items: center; padding: 3rem 0; background: linear-gradient(118deg, #0c3626 0%, var(--bosque) 40%, var(--noche) 100%); }
.enlace-vencido img { margin-bottom: 2.4rem; }

.pie { padding: 2.2rem 0; background: #07170f; color: #c6d8ce; }
.pie-interior { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

@media (max-width: 999px) {
    .portada-interior, .instalar-columnas, .contacto-interior { grid-template-columns: minmax(0, 1fr); }
    .descargas { grid-template-columns: minmax(0, 1fr); }
    .descargas h3 { grid-column: auto; }
}
@media (max-width: 640px) {
    .barra nav { gap: .9rem; font-size: .95rem; }
    .marca-tesi { display: none; }
    .cifras { grid-template-columns: 1fr 1fr; row-gap: .6rem; }
    .campos { grid-template-columns: minmax(0, 1fr); }
    .bloque, .descargas { padding: 1.3rem; }
    table { min-width: 560px; }
    .descarga { flex-wrap: wrap; }
    .descarga-texto { flex-basis: calc(100% - 4rem); }
    .pedido-campos { grid-template-columns: minmax(0, 1fr); }
    .acciones .boton, .formulario .boton, .pedido .boton { width: 100%; }
}
@media (max-width: 400px) {
    .barra nav a[href="#instalar"] { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { transition: none !important; }
}
