/* ---------- Base ---------- */
[hidden] { display: none !important; }
:root {
  --papel: #f4f6f9;
  --blanco: #ffffff;
  --tinta: #16202b;
  --suave: #566273;
  --linea: #d8dee7;
  --azul: #1d3fc4;
  --azul-oscuro: #162f98;
  --rojo: #b3243a;
  --verde: #17694f;
  --fondo-ok: #e5f4ee;
  --fondo-error: #fbe9ec;
  --radio: 8px;
  --fuente-titulo: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --fuente-texto: 'Instrument Sans', 'Segoe UI', system-ui, sans-serif;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--fuente-texto);
  font-size: 1.0625rem;
  line-height: 1.55;
}

h1, h2, h3 {
  font-family: var(--fuente-titulo);
  line-height: 1.1;
  margin: 0 0 .5em;
  letter-spacing: -0.015em;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); font-weight: 800; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1em; }
a { color: var(--azul); text-underline-offset: 2px; }
a:hover { color: var(--azul-oscuro); }

:focus-visible { outline: 3px solid var(--azul); outline-offset: 2px; }

.contenedor { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }
.angosto { width: min(720px, 100% - 2.5rem); margin: 2.5rem auto 4rem; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.saltar { position: absolute; left: -999px; top: 0; background: var(--tinta); color: #fff; padding: .6rem 1rem; z-index: 10; }
.saltar:focus { left: 0; }

/* ---------- Cabecera y pie ---------- */
.sitio-cab { background: var(--blanco); border-bottom: 1px solid var(--linea); }
.sitio-cab-fila { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: .85rem; }
.marca { font-family: var(--fuente-titulo); font-weight: 800; font-size: 1.2rem; color: var(--tinta); text-decoration: none; }
.sitio-cab nav { display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap; font-size: .975rem; }
.sitio-cab nav a { color: var(--tinta); text-decoration: none; }
.sitio-cab nav a:hover { color: var(--azul); text-decoration: underline; }
.sitio-pie { border-top: 1px solid var(--linea); margin-top: 4rem; padding-block: 1.75rem; color: var(--suave); font-size: .925rem; }
.sitio-pie p { margin: 0; max-width: 60ch; }

/* ---------- Botones ---------- */
.boton, button.boton {
  display: inline-block;
  font: 600 1rem/1 var(--fuente-texto);
  background: var(--azul);
  color: #fff;
  border: 2px solid var(--azul);
  border-radius: var(--radio);
  padding: .85rem 1.35rem;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.boton:hover { background: var(--azul-oscuro); border-color: var(--azul-oscuro); color: #fff; }
.boton-claro { background: transparent; color: var(--azul); }
.boton-claro:hover { background: var(--azul); color: #fff; }
.boton-chico { padding: .5rem .85rem; font-size: .9rem; }
.boton-peligro { background: transparent; color: var(--rojo); border-color: var(--rojo); }
.boton-peligro:hover { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.boton-grande { padding: 1rem 2rem; font-size: 1.1rem; }
.boton-inactivo, .boton-inactivo:hover { background: var(--linea); border-color: var(--linea); color: var(--suave); cursor: default; }
.enlace-boton { background: none; border: 0; padding: 0; font: inherit; color: var(--tinta); cursor: pointer; text-decoration: none; }
.enlace-boton:hover { color: var(--azul); text-decoration: underline; }
.en-linea { display: inline; margin: 0; }
.acciones { display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---------- Portada ---------- */
.portada { background: var(--blanco); border-bottom: 1px solid var(--linea); padding-block: clamp(2.5rem, 7vw, 5rem); }
.portada-fila { display: grid; grid-template-columns: 1.3fr 1fr; gap: clamp(1.5rem, 5vw, 4rem); align-items: center; }
.portada-sub { font-size: 1.2rem; color: var(--suave); max-width: 38ch; margin: 0; }

.brazalete {
  margin: 0;
  background: var(--blanco);
  border: 3px solid var(--tinta);
  border-radius: 14px;
  box-shadow: 8px 8px 0 var(--azul);
  padding: 1.25rem 1.5rem;
}
.brazalete-cols { display: flex; justify-content: space-between; gap: 0; }
.brazalete-cols > div { display: flex; flex-direction: column; flex: 1; padding-inline: .9rem; border-left: 2px dashed var(--linea); }
.brazalete-cols > div:first-child { border-left: 0; padding-left: 0; }
.brazalete-cols > div:last-child { padding-right: 0; }
.brazalete-parte { font-family: var(--fuente-titulo); font-weight: 800; font-size: clamp(2.6rem, 6vw, 4rem); line-height: 1; letter-spacing: -0.02em; }
.brazalete-nota { font-size: .85rem; color: var(--suave); margin-top: .5rem; line-height: 1.25; }

.brazalete-num { font-family: var(--fuente-titulo); font-weight: 800; font-size: clamp(3rem, 12vw, 5.5rem); letter-spacing: -0.02em; line-height: 1; text-align: center; }
.brazalete-grande { margin: 1.5rem 0 2rem; max-width: 26rem; padding: 1.75rem 1.5rem; }

/* ---------- Lista de eventos ---------- */
.eventos { padding-top: 3rem; }
.lista-eventos { list-style: none; margin: 1.5rem 0 0; padding: 0; border-top: 3px solid var(--tinta); }
.evento { display: grid; grid-template-columns: 6.5rem 1fr auto; gap: 1.75rem; padding: 1.75rem 0; border-bottom: 1px solid var(--linea); }
.evento-fecha { display: flex; flex-direction: column; line-height: 1; }
.evento-fecha .dia { font-family: var(--fuente-titulo); font-weight: 800; font-size: 3.6rem; letter-spacing: -0.03em; }
.evento-fecha .mes { font-size: .95rem; color: var(--suave); margin-top: .35rem; }
.evento-cuerpo h3 { margin-bottom: .35rem; }
.evento-meta { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; color: var(--suave); font-size: .975rem; margin-bottom: .75rem; }
.evento-desc { max-width: 68ch; }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chips li { font-size: .85rem; background: var(--blanco); border: 1px solid var(--linea); border-radius: 999px; padding: .2rem .7rem; }
.evento-accion { display: flex; flex-direction: column; align-items: stretch; gap: .5rem; min-width: 11rem; }
.nota { font-size: .875rem; color: var(--suave); margin: 0; text-align: center; }
.vacio { background: var(--blanco); border: 1px dashed var(--linea); border-radius: var(--radio); padding: 2rem; margin-top: 1.5rem; }
.vacio p:last-child { margin: 0; color: var(--suave); }

/* ---------- Formularios ---------- */
.migas { margin-bottom: .5rem; font-size: .95rem; }
.resumen-evento { background: var(--blanco); border: 1px solid var(--linea); border-left: 4px solid var(--azul); border-radius: var(--radio); padding: 1rem 1.25rem; margin-bottom: 1.75rem; }
.resumen-evento h2 { margin-bottom: .25rem; font-size: 1.3rem; }
.resumen-evento p { margin: 0; color: var(--suave); }

.formulario fieldset { border: 0; padding: 0; margin: 0 0 2rem; }
.formulario legend { font-family: var(--fuente-titulo); font-weight: 800; font-size: 1.25rem; padding: 0; margin-bottom: 1rem; }
.campo { margin-bottom: 1.15rem; }
.campo-fila { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
label, .etiqueta { display: block; font-weight: 600; margin-bottom: .35rem; }
.opcional { font-weight: 400; color: var(--suave); }
input[type=text], input[type=url], input[type=email], input[type=tel], input[type=password], input[type=date], input[type=search], select, textarea {
  width: 100%;
  font: inherit;
  color: var(--tinta);
  background: var(--blanco);
  border: 1.5px solid #9aa5b4;
  border-radius: var(--radio);
  padding: .7rem .8rem;
}
textarea { min-height: 7rem; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(29, 63, 196, .35); border-color: var(--azul); }
[aria-invalid=true] { border-color: var(--rojo); }
.ayuda { font-size: .9rem; color: var(--suave); margin: .35rem 0 0; }
.campo-error { color: var(--rojo); font-size: .925rem; font-weight: 600; margin: .35rem 0 0; }
.trampa { position: absolute; left: -5000px; }

.niveles { display: grid; gap: .6rem; }
.nivel { display: grid; grid-template-columns: auto 2.6rem 1fr; align-items: center; gap: .75rem; font-weight: 400; margin: 0; background: var(--blanco); border: 1.5px solid #9aa5b4; border-radius: var(--radio); padding: .75rem 1rem; cursor: pointer; }
.nivel:has(input:checked) { border-color: var(--azul); box-shadow: inset 0 0 0 1.5px var(--azul); background: #f0f3fd; }
.nivel input { width: 1.15rem; height: 1.15rem; accent-color: var(--azul); }
.nivel-letra { font-family: var(--fuente-titulo); font-weight: 800; font-size: 1.8rem; line-height: 1; }
.nivel-texto strong { display: block; font-weight: 600; }
.nivel-texto small { color: var(--suave); font-size: .9rem; }

.aviso { border-radius: var(--radio); padding: .85rem 1.1rem; margin-bottom: 1.25rem; font-weight: 500; }
.aviso-ok { background: var(--fondo-ok); color: #0f4d39; border: 1px solid #a9d7c5; }
.aviso-error { background: var(--fondo-error); color: #8a1a2c; border: 1px solid #efb7c0; }

.datos { margin: 0 0 1.5rem; border-top: 1px solid var(--linea); }
.datos > div { display: grid; grid-template-columns: 11rem 1fr; gap: 1rem; padding: .65rem 0; border-bottom: 1px solid var(--linea); }
.datos dt { color: var(--suave); }
.datos dd { margin: 0; font-weight: 600; }

.nivel-ancho { grid-template-columns: auto 1fr auto; }
.nivel-precio { font-family: var(--fuente-titulo); font-weight: 800; font-size: 1.15rem; white-space: nowrap; }
.precios-lista { margin: 0 0 .9rem; display: grid; gap: .15rem; max-width: 44ch; }
.precios-lista > div { display: flex; justify-content: space-between; gap: 1rem; font-size: .975rem; border-bottom: 1px dotted var(--linea); padding-bottom: .15rem; }
.precios-lista dt { color: var(--suave); }
.precios-lista dd { margin: 0; font-weight: 600; white-space: nowrap; }
.campo-fila-3 { grid-template-columns: repeat(3, 1fr); }
.precios { border: 1px solid var(--linea); border-radius: var(--radio); padding: 1rem 1rem .25rem; margin: 0 0 1.15rem; }
.precios legend { font-weight: 600; padding: 0 .4rem; }
.pago-caja { background: var(--blanco); border: 1px solid var(--linea); border-left: 4px solid var(--verde); border-radius: var(--radio); padding: 1rem 1.25rem; margin: 0 0 1.5rem; }
.pago-caja h2 { font-size: 1.2rem; margin-bottom: .35rem; }
.pago-caja p:last-child { margin-bottom: 0; }
.boton-paypal { background: #ffc439; border-color: #ffc439; color: #111; }
.boton-mp { background: #009ee3; border-color: #009ee3; color: #fff; }
.boton-mp:hover { background: #0086c0; border-color: #0086c0; color: #fff; }
.boton-paypal:hover { background: #f2b52e; border-color: #f2b52e; color: #111; }
.etiqueta-estado.estado-pagado { background: var(--fondo-ok); color: #0f4d39; }
.etiqueta-estado.estado-pendiente { background: #fff3d6; color: #6b4e00; }

/* ---------- Administración ---------- */
.admin main { padding-block: 1.5rem 4rem; }
.admin h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.sesion-info { color: var(--suave); font-size: .925rem; margin-bottom: 1.25rem; }
.barra-titulo { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.barra-titulo h1 { margin: 0; }

.tabla-envoltura { overflow-x: auto; background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); margin-bottom: 2rem; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--linea); vertical-align: top; }
th { font-weight: 600; background: #eef1f6; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.catalogo { font-family: var(--fuente-titulo); font-weight: 800; font-size: 1.05rem; white-space: nowrap; }
.fila-cancelada td { color: var(--suave); text-decoration: line-through; }
.fila-cancelada td.sin-tachar { text-decoration: none; }
.etiqueta-estado { display: inline-block; font-size: .8rem; font-weight: 600; border-radius: 999px; padding: .1rem .6rem; background: #e7ebf1; }
.estado-publicado { background: var(--fondo-ok); color: #0f4d39; }
.estado-borrador { background: #fff3d6; color: #6b4e00; }
.estado-cerrado { background: #e7ebf1; color: var(--suave); }
.acciones-fila { display: flex; gap: .4rem; flex-wrap: wrap; }

.panel { background: var(--blanco); border: 1px solid var(--linea); border-radius: var(--radio); padding: 1.5rem; margin-bottom: 2rem; }
.panel h2 { font-size: 1.3rem; }
.checks { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.checks label { display: flex; align-items: center; gap: .5rem; font-weight: 400; margin: 0; }
.checks input { width: 1.1rem; height: 1.1rem; accent-color: var(--azul); }
.filtros { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; margin-bottom: 1rem; }
.filtros .campo { margin: 0; min-width: 10rem; }
.resumen-tabla td, .resumen-tabla th { text-align: center; }
.resumen-tabla th:first-child, .resumen-tabla td:first-child { text-align: left; }

.login { width: min(26rem, 100% - 2.5rem); margin: 4rem auto; }

@media (max-width: 760px) {
  .portada-fila { grid-template-columns: 1fr; }
  .evento { grid-template-columns: 1fr; gap: .75rem; }
  .evento-fecha { flex-direction: row; align-items: baseline; gap: .6rem; }
  .evento-fecha .dia { font-size: 2.4rem; }
  .evento-accion { min-width: 0; }
  .campo-fila, .campo-fila-3 { grid-template-columns: 1fr; }
  .datos > div { grid-template-columns: 1fr; gap: .1rem; }
}

@media print {
  .sitio-cab, .sitio-pie, .filtros, .acciones-fila, .no-imprimir { display: none !important; }
  body { background: #fff; }
}

@media (prefers-reduced-motion: no-preference) {
  .boton, .enlace-boton { transition: background-color .15s, color .15s, border-color .15s; }
}
