@font-face {
    font-family: Montserrat;
    src: url("../fonts/montserrat-latin-wght-normal.woff2") format("woff2");
    font-weight: 100 900;
    font-display: swap;
}

:root {
    --noche: #0c2430;
    --monte: #12413f;
    --verde: #2c7a4b;
    --amarillo: #f2d21b;
    --rojo: #c8202c;
    --vino: #7b0f2b;
    --texto: #17282d;
    --suave: #52646a;
    --linea: #cfd9d8;
    --fondo: #f1f5f3;
    --radio: 14px;
}

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

[hidden] { display: none !important; }

html { scroll-behavior: smooth; scroll-padding-top: 96px; }

body {
    margin: 0;
    background: var(--fondo);
    color: var(--texto);
    font: 450 1rem/1.6 Montserrat, "Segoe UI", system-ui, sans-serif;
}

h1, h2, h3 { margin: 0 0 .6em; line-height: 1.15; text-wrap: balance; }
h1 { font-weight: 800; font-size: clamp(2rem, 4.6vw, 3.5rem); letter-spacing: -.02em; }
h2 { font-weight: 800; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.01em; }
h3 { font-weight: 700; font-size: 1.25rem; }
p { margin: 0 0 1em; }
a { color: inherit; }
img { max-width: 100%; }

.ancho { width: min(1140px, 100% - 2.5rem); margin-inline: auto; }
.bloque { padding-block: clamp(3rem, 7vw, 5rem); }
.dos { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }

.saltar { position: absolute; left: -999px; z-index: 20; padding: .7rem 1rem; background: #fff; }
.saltar:focus { left: .5rem; top: .5rem; }

:focus-visible { outline: 3px solid #1769aa; outline-offset: 2px; }

/* Encabezado */
.barra { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--linea); }
.barra__fila { display: flex; align-items: center; gap: 1.25rem; min-height: 80px; }
.barra__logo { flex: none; line-height: 0; }
.barra__logo img { height: 56px; width: auto; }
.barra__dependencia { margin: 0; padding-left: 1.25rem; border-left: 1px solid var(--linea); font-size: .875rem; color: var(--suave); }
.barra__musical { height: 56px; width: auto; margin-left: auto; }

/* Portada */
.portada { position: relative; isolation: isolate; min-height: 620px; overflow: hidden; background: #0a1d29; color: #fff; }
.paisaje { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; object-fit: cover; object-position: 78% 100%; }
.portada__texto { padding-block: clamp(3rem, 7vw, 5.5rem) 16rem; }
.portada__texto > * { max-width: 680px; }
.portada__ruta { font-weight: 700; color: var(--amarillo); margin-bottom: .8rem; }
.portada__intro { font-size: 1.125rem; max-width: 560px; margin-bottom: 1.75rem; }

.boton {
    display: inline-block; padding: .9rem 1.7rem; border: 0; border-radius: 999px; cursor: pointer;
    background: var(--amarillo); color: var(--noche); font: inherit; font-weight: 700; text-decoration: none;
    transition: background .15s;
}
.boton:hover { background: #ffe34d; }
.boton:disabled { opacity: .65; cursor: progress; }
.boton--grande { width: 100%; padding: 1.1rem; font-size: 1.1rem; background: var(--vino); color: #fff; }
.boton--grande:hover { background: #95163a; }

/* Datos del viaje */
.datos { position: relative; margin-top: -4.5rem; }
.datos dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); margin: 0; background: #fff; border-radius: var(--radio); overflow: hidden; box-shadow: 0 12px 34px rgb(12 36 48 / .16); }
.datos dl > div { padding: 1.4rem 1.5rem; }
.datos dt { font-size: .875rem; color: var(--suave); }
.datos dd { margin: .2rem 0 0; font-weight: 700; line-height: 1.35; }

.marco { color: var(--suave); font-size: .9375rem; }
.incluye ul { margin: 0; padding: 0; list-style: none; }
.incluye li { padding: .65rem 0; border-bottom: 1px solid var(--linea); font-weight: 600; }
.incluye li:last-child { border: 0; }

/* Roles */
.roles { padding-block: clamp(3rem, 6vw, 4.5rem); background: var(--monte); color: #fff; }
.roles__intro { color: #cfe3df; }
.rol { padding: 1.8rem; border-radius: var(--radio); color: var(--texto); }
.rol--cmj { background: #f8e682; }
.rol--pmj { background: #cfe7a6; }
.rol__sigla { margin: 0 0 .3rem; font-size: 2.6rem; font-weight: 900; line-height: 1; }
.rol p:last-child { margin: 0; }

/* Formulario */
.bajada { max-width: 75ch; margin-bottom: 2.25rem; }
.inscripcion { display: grid; gap: 2.5rem; align-items: start; }
.pasos { display: none; }
.formulario { display: grid; gap: 1.5rem; min-width: 0; }
.formulario { counter-reset: seccion; }
.tarjeta { min-width: 0; padding: clamp(1.25rem, 3.5vw, 2.25rem); background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); }
.formulario .tarjeta { counter-increment: seccion; }
.formulario .tarjeta h3::before { content: counter(seccion) ". "; color: var(--vino); }
.tarjeta__nota { margin-top: -.5rem; color: var(--suave); }
.rejilla { display: grid; gap: 1.4rem 1.25rem; }
.campo { min-width: 0; margin: 0; padding: 0; border: 0; }
.campo > label:not(.opcion), .campo > legend, .enunciado { display: block; padding: 0; margin: 0 0 .4rem; font-weight: 600; line-height: 1.4; }
.enunciado { margin-bottom: .6rem; }
.opcional { font-weight: 450; color: var(--suave); }
.ayuda { margin: -.15rem 0 .5rem; font-size: .875rem; line-height: 1.5; color: var(--suave); }

.campo input:not([type=radio], [type=checkbox], [type=file]), .campo select, .campo textarea, .salida {
    display: block; width: 100%; min-height: 50px; padding: .7rem .9rem;
    border: 1px solid #8fa1a3; border-radius: 9px; background: #fff; color: inherit; font: inherit;
}
.campo textarea { resize: vertical; }
.salida { background: var(--fondo); border-style: dashed; color: var(--suave); }
.salida[data-lista] { color: var(--texto); font-weight: 600; }

.opciones { display: grid; gap: .7rem; }
.opcion { display: flex; gap: .8rem; padding: .9rem 1rem; border: 1px solid var(--linea); border-radius: 10px; cursor: pointer; }
.opcion:hover { border-color: var(--verde); }
.opcion:has(:checked) { border-color: var(--verde); background: #edf6ee; }
.opcion input { flex: none; width: 20px; height: 20px; margin: .15rem 0 0; accent-color: var(--verde); }
.opcion strong { display: block; }

.carga { padding: 1.1rem; border: 2px dashed #8fa1a3; border-radius: 10px; background: var(--fondo); }
.carga input { width: 100%; font: inherit; }
.carga input::file-selector-button { margin-right: .9rem; padding: .6rem 1rem; border: 0; border-radius: 8px; background: var(--monte); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.archivos { margin: 0; padding: 0; list-style: none; font-size: .875rem; overflow-wrap: anywhere; }
.archivos li { margin-top: .5rem; }

.error { margin: .4rem 0 0; color: var(--rojo); font-size: .875rem; font-weight: 600; }
.error:empty { display: none; }
[aria-invalid=true], .campo:has(> .error:not(:empty)) .opcion, .campo:has(> .error:not(:empty)) .carga { border-color: var(--rojo) !important; }
.resumen { padding: 1rem 1.25rem; border-left: 5px solid var(--rojo); border-radius: 8px; background: #fdecec; font-weight: 600; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Confirmación y errores */
.mensaje { text-align: center; min-height: 60vh; }
.mensaje > p { max-width: 560px; margin-inline: auto; }
.codigo { font-size: clamp(1.8rem, 6vw, 2.8rem); font-weight: 800; letter-spacing: .04em; color: var(--vino); }
.mensaje img { margin-bottom: 2rem; }

/* Pie */
.pie { background: var(--noche); color: #d5e2e4; font-size: .9375rem; }
.franja { height: 6px; background: linear-gradient(90deg, var(--amarillo) 0 33.3%, #8bbf3f 33.3% 66.6%, #d8232f 66.6%); }
.pie__fila { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); padding-block: 2.5rem; }
.pie strong { color: #fff; }
.pie p { margin: .4rem 0 0; }

@media (min-width: 640px) {
    .rejilla { grid-template-columns: 1fr 1fr; align-items: end; }
    .rejilla > .campo:has(> .error:not(:empty)) { align-self: start; }
    .campo--ancho { grid-column: 1 / -1; }
    .opciones--dos { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 980px) {
    .inscripcion { grid-template-columns: 210px minmax(0, 1fr); }
    .pasos { display: block; position: sticky; top: 110px; font-size: .9375rem; }
    .pasos ol { margin: 0 0 1.25rem; padding-left: 1.4rem; }
    .pasos li { padding: .3rem 0; }
    .pasos a { font-weight: 600; text-decoration: none; }
    .pasos a:hover { text-decoration: underline; }
    .pasos p { color: var(--suave); font-size: .875rem; }
}

@media (max-width: 640px) {
    .barra__fila { min-height: 64px; }
    .barra__logo img, .barra__musical { height: 44px; }
    .barra__dependencia { display: none; }
    .paisaje { inset: auto 0 0; height: 440px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .boton { transition: none; }
}

/* Panel de administración */
.boton-secundario {
    display: inline-block; min-height: 44px; padding: .55rem 1.1rem; border: 1px solid var(--monte); border-radius: 999px;
    background: #fff; color: var(--monte); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
.boton-secundario:hover { background: #e6f0ee; }
.oculto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.ingreso { display: grid; gap: 1.25rem; max-width: 440px; margin-inline: auto; }
.ingreso__titulo { font-size: 1.75rem; margin: 0; }
.ingreso .tarjeta__nota { margin: 0; }
.aviso { margin: 0; padding: .9rem 1.1rem; border-left: 5px solid var(--verde); border-radius: 8px; background: #edf6ee; font-weight: 600; }
.ingreso .resumen { margin: 0; }

.admin__barra { background: var(--monte); color: #fff; }
.admin__barra-fila { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding-block: .6rem; }
.admin__marca { margin-right: auto; }
.admin__enlace { padding: .4rem .2rem; color: #d5e8e4; font-weight: 600; text-decoration: none; border-bottom: 3px solid transparent; }
.admin__enlace:hover, .admin__enlace--activo { color: #fff; border-color: var(--amarillo); }
.admin__usuario { font-size: .875rem; color: #d5e8e4; }
.admin__barra .boton-secundario { min-height: 38px; padding: .35rem .9rem; border-color: #fff; background: transparent; color: #fff; }
.admin__barra .boton-secundario:hover { background: rgb(255 255 255 / .12); }
.admin__contenido { padding-block: 2rem 4rem; }
.admin__cabecera { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.admin__cabecera h1 { font-size: clamp(1.6rem, 3.5vw, 2.3rem); margin-bottom: .3rem; overflow-wrap: anywhere; }
.admin__resumen { margin: 0; color: var(--suave); }
.admin__nota { margin-top: 2rem; font-size: .875rem; color: var(--suave); }
.admin__limpiar { align-self: center; font-weight: 600; }

.filtros { display: flex; flex-wrap: wrap; align-items: end; gap: 1rem; margin-bottom: 1.5rem; }
.filtros .campo:first-child { flex: 1 1 320px; }
.filtros .campo:nth-child(2) { flex: 0 1 160px; }
.filtros .boton-secundario { min-height: 50px; }
.vacio { text-align: center; color: var(--suave); }

.tabla-contenedor { overflow-x: auto; background: #fff; border: 1px solid var(--linea); border-radius: var(--radio); }
.tabla { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.tabla th, .tabla td { padding: .85rem 1rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--linea); }
.tabla th { background: var(--fondo); font-size: .8125rem; text-transform: uppercase; letter-spacing: .04em; color: var(--suave); white-space: nowrap; }
.tabla tbody tr:last-child td { border-bottom: 0; }
.tabla tbody tr:hover { background: #f7faf9; }
.tabla td:nth-child(2), .tabla td:last-child { white-space: nowrap; }
.tabla a { font-weight: 700; color: var(--monte); }
.tabla__sub { display: block; font-size: .8125rem; color: var(--suave); }
.etiqueta { display: inline-block; padding: .1rem .6rem; border-radius: 999px; font-size: .8125rem; font-weight: 700; }
.etiqueta--cmj { background: #f8e682; }
.etiqueta--pmj { background: #cfe7a6; }

.paginas { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 1.5rem; margin-top: 1.5rem; }
.paginas a { font-weight: 700; color: var(--monte); }
.paginas [aria-disabled] { color: #9aa8ab; }

.detalle { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); align-items: start; }
.detalle__titulo { font-size: 1.15rem; color: var(--vino); }
.detalle__datos { display: grid; gap: .9rem; margin: 0; }
.detalle__datos dt { font-size: .8125rem; color: var(--suave); }
.detalle__datos dd { margin: .1rem 0 0; font-weight: 600; overflow-wrap: anywhere; white-space: pre-line; }
.documentos { display: grid; gap: .8rem; margin: 0; padding: 0; list-style: none; }
.documentos li { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.25rem; padding: .8rem 1rem; border: 1px solid var(--linea); border-radius: 10px; }
.documentos span { margin-right: auto; }
.documentos a { font-weight: 700; color: var(--monte); }
