/* Sistema visual del baby shower.
   Gama pastel rosada con lila, durazno y menta como apoyos, y tipografía Inter
   con los pesos altos y el tracking cerrado de AKI Gastos.
   Todos los pares de color están verificados en contraste: el texto chico llega
   a 4.5:1 como mínimo sobre su propio fondo, en los dos temas. */

:root {
  color-scheme: light dark;

  --fondo: #fdf6f8;
  --fondo-2: #f8edf1;
  --superficie: #ffffff;
  --tinta: #2e2430;
  --tinta-suave: #756675;
  --linea: #f2e3e9;
  --linea-fuerte: #e6d2db;

  /* Rosa: el color de las acciones. Pastel en los velos, sólido donde hay que
     poder leer texto blanco encima. */
  --rosa: #c2456f;
  --rosa-hover: #ac3b61;
  --rosa-tinta: #ffffff;
  --rosa-velo: #fce9f0;
  --rosa-texto: #a33a62;

  --lila: #8a66be;
  --lila-velo: #f1ebfa;
  --lila-texto: #6f4fa8;

  --menta: #37705c;
  --menta-velo: #e6f5ee;

  --durazno: #9a5a2e;
  --durazno-velo: #fff1e6;

  --rojo: #b8403b;
  --rojo-velo: #fdecea;

  --texto: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --t-xs: 0.75rem;
  --t-sm: 0.8125rem;
  --t-base: 0.9375rem;
  --t-md: 1rem;
  --t-lg: 1.125rem;
  --t-xl: 1.375rem;
  --t-2xl: 1.75rem;

  --e1: 4px;
  --e2: 8px;
  --e3: 14px;
  --e4: 22px;
  --e5: 34px;
  --e6: 56px;

  --radio: 16px;
  --radio-chico: 11px;
  --sombra: 0 10px 34px rgba(46, 36, 48, .07);
  --sombra-rosa: 0 8px 22px rgba(194, 69, 111, .22);
  --ancho: 760px;
  --toque: 44px;        /* alto mínimo de cualquier cosa que se toque */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fondo: #211a1f;
    --fondo-2: #2a2128;
    --superficie: #2b222a;
    --tinta: #f6edf1;
    --tinta-suave: #c3b2be;
    --linea: #3c313a;
    --linea-fuerte: #4d3f4a;
    --rosa: #f2a3bf;
    --rosa-hover: #f7b9ce;
    --rosa-tinta: #2e2430;
    --rosa-velo: #3b2832;
    --rosa-texto: #f2a3bf;
    --lila: #bda2e8;
    --lila-velo: #322a40;
    --lila-texto: #bda2e8;
    --menta: #7fc3a6;
    --menta-velo: #24332d;
    --durazno: #e3a677;
    --durazno-velo: #37291f;
    --rojo: #e89088;
    --rojo-velo: #3a2524;
    --sombra: 0 10px 34px rgba(0, 0, 0, .35);
    --sombra-rosa: 0 8px 22px rgba(0, 0, 0, .3);
  }
}

:root[data-theme="dark"] {
  --fondo: #211a1f;
  --fondo-2: #2a2128;
  --superficie: #2b222a;
  --tinta: #f6edf1;
  --tinta-suave: #c3b2be;
  --linea: #3c313a;
  --linea-fuerte: #4d3f4a;
  --rosa: #f2a3bf;
  --rosa-hover: #f7b9ce;
  --rosa-tinta: #2e2430;
  --rosa-velo: #3b2832;
  --rosa-texto: #f2a3bf;
  --lila: #bda2e8;
  --lila-velo: #322a40;
  --lila-texto: #bda2e8;
  --menta: #7fc3a6;
  --menta-velo: #24332d;
  --durazno: #e3a677;
  --durazno-velo: #37291f;
  --rojo: #e89088;
  --rojo-velo: #3a2524;
  --sombra: 0 10px 34px rgba(0, 0, 0, .35);
  --sombra-rosa: 0 8px 22px rgba(0, 0, 0, .3);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--fondo);
  color: var(--tinta);
  font-family: var(--texto);
  font-size: var(--t-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.hoja {
  max-width: var(--ancho);
  margin: 0 auto;
  padding-inline: 18px;
  padding-block: 0 var(--e6);
}

h1, h2, h3 {
  margin: 0;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  text-wrap: balance;
}
h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); }

/* Antetítulo: el detalle de AKI Gastos, en el color de acento. */
.etiqueta {
  margin: 0;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--rosa-texto);
}

.cifra { font-variant-numeric: tabular-nums; }

.seccion { margin-block: var(--e5) var(--e3); }
.seccion p { margin: 2px 0 0; color: var(--tinta-suave); font-size: var(--t-sm); }

/* Tarjeta: la superficie base de toda la interfaz. */
.tarjeta {
  background: var(--superficie);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: var(--e4);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--e2);
  min-height: var(--toque);
  border: 0;
  border-radius: var(--radio-chico);
  background: var(--rosa);
  color: var(--rosa-tinta);
  box-shadow: var(--sombra-rosa);
  padding-inline: 20px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.btn:hover { background: var(--rosa-hover); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

/* Secundario: el mismo rosa, en pastel. */
.btn.suave {
  background: var(--rosa-velo);
  color: var(--rosa-texto);
  box-shadow: none;
}
.btn.suave:hover { background: var(--rosa-velo); filter: brightness(.97); }

.btn.linea {
  background: var(--superficie);
  color: var(--tinta);
  border: 1px solid var(--linea-fuerte);
  box-shadow: none;
}
.btn.linea:hover { background: var(--fondo-2); border-color: var(--rosa); color: var(--rosa-texto); }

.btn:disabled, .btn[disabled] {
  background: var(--fondo-2);
  color: var(--tinta-suave);
  box-shadow: none;
  cursor: default;
  transform: none;
}
.btn.chico { min-height: 38px; padding-inline: 14px; font-size: var(--t-sm); }

.acciones { display: flex; gap: var(--e2); flex-wrap: wrap; }

input[type="text"], input[type="password"], input[type="number"], input:not([type]) {
  min-height: var(--toque);
  border: 1px solid var(--linea-fuerte);
  border-radius: var(--radio-chico);
  background: var(--superficie);
  color: var(--tinta);
  padding: 0 14px;
  font: inherit;
  min-width: 0;
}
input::placeholder { color: var(--tinta-suave); }
input:focus { border-color: var(--rosa); }

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--rosa) 35%, transparent);
  outline-offset: 2px;
}

/* Chip de estado: color propio sobre su velo, legible en los dos temas. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 3px 10px;
  font-size: var(--t-xs);
  font-weight: 700;
  white-space: nowrap;
  background: var(--fondo-2);
  color: var(--tinta-suave);
}
.chip.libre { background: var(--rosa-velo); color: var(--rosa-texto); }
.chip.mio { background: var(--menta-velo); color: var(--menta); }
.chip.completo { background: var(--fondo-2); color: var(--tinta-suave); }
.chip.alerta { background: var(--rojo-velo); color: var(--rojo); }

/* Datos en pares etiqueta/valor, con espacio para un icono. */
/* El icono ocupa las dos filas del par, sin envolver dt/dd en otro div:
   dentro de un <dl> solo valen dt, dd y un div que agrupe el par. */
.datos { display: grid; gap: var(--e3); margin: 0; }
.datos > div { display: grid; grid-template-columns: 28px 1fr; column-gap: var(--e3); align-items: center; }
.datos .icono {
  grid-row: span 2;
  align-self: start;
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: var(--rosa-velo);
  color: var(--rosa-texto);
}
.datos .icono svg { width: 15px; height: 15px; display: block; }
.datos.simple > div { grid-template-columns: 1fr; }
.datos dt { font-size: var(--t-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tinta-suave); }
.datos dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.datos dd a { color: var(--rosa-texto); text-underline-offset: 3px; }

.aviso {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%) translateY(8px);
  background: var(--tinta);
  color: var(--fondo);
  padding: 13px 20px;
  border-radius: var(--radio-chico);
  box-shadow: 0 12px 30px rgba(46, 36, 48, .25);
  font-weight: 600;
  max-width: calc(100% - 32px);
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
  z-index: 20;
}
.aviso.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.aviso.bien { background: var(--menta); color: #fff; }
.aviso.mal { background: var(--rojo); color: #fff; }

footer {
  margin-top: var(--e5);
  color: var(--tinta-suave);
  font-size: var(--t-sm);
  text-align: center;
}
footer a { color: var(--rosa-texto); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .btn:hover { transform: none; }
}

/* ── Tema niño ────────────────────────────────────────────────────────────
   El servidor marca <html data-tema="nino"> cuando config.json dice que es
   niño. Se reutilizan los mismos nombres de variable (--rosa es "el color de
   las acciones"), así que ninguna página necesita reglas propias.
   Especificidad: el bloque claro (0,2,0) va después de los oscuros base y
   les gana; los bloques oscuros de niño (0,3,0) recuperan el modo oscuro. */
:root[data-tema="nino"] {
  --fondo: #f3f8fd;
  --fondo-2: #e8f1fa;
  --superficie: #ffffff;
  --tinta: #1f2a37;
  --tinta-suave: #5c6b7c;
  --linea: #e1ebf5;
  --linea-fuerte: #cbdcec;
  --rosa: #2f6fb0;
  --rosa-hover: #275e96;
  --rosa-tinta: #ffffff;
  --rosa-velo: #e3effb;
  --rosa-texto: #275e96;
  --lila: #4aa3c7;
  --lila-velo: #e2f3f9;
  --lila-texto: #2a7393;
  --sombra: 0 10px 34px rgba(31, 42, 55, .08);
  --sombra-rosa: 0 8px 22px rgba(47, 111, 176, .24);
}

@media (prefers-color-scheme: dark) {
  :root[data-tema="nino"]:not([data-theme="light"]) {
    --fondo: #161d26;
    --fondo-2: #1d2733;
    --superficie: #1f2a36;
    --tinta: #eaf1f8;
    --tinta-suave: #a9b8c8;
    --linea: #2c3a49;
    --linea-fuerte: #3a4b5d;
    --rosa: #8fc0ef;
    --rosa-hover: #a9d0f5;
    --rosa-tinta: #16202b;
    --rosa-velo: #22344a;
    --rosa-texto: #8fc0ef;
    --lila: #8fd3e8;
    --lila-velo: #1f3440;
    --lila-texto: #8fd3e8;
    --sombra: 0 10px 34px rgba(0, 0, 0, .35);
    --sombra-rosa: 0 8px 22px rgba(0, 0, 0, .3);
    --fondo-dibujos: .14;
    --portada-dibujo: .35;
  }
}

:root[data-tema="nino"][data-theme="dark"] {
  --fondo: #161d26;
  --fondo-2: #1d2733;
  --superficie: #1f2a36;
  --tinta: #eaf1f8;
  --tinta-suave: #a9b8c8;
  --linea: #2c3a49;
  --linea-fuerte: #3a4b5d;
  --rosa: #8fc0ef;
  --rosa-hover: #a9d0f5;
  --rosa-tinta: #16202b;
  --rosa-velo: #22344a;
  --rosa-texto: #8fc0ef;
  --lila: #8fd3e8;
  --lila-velo: #1f3440;
  --lila-texto: #8fd3e8;
  --sombra: 0 10px 34px rgba(0, 0, 0, .35);
  --sombra-rosa: 0 8px 22px rgba(0, 0, 0, .3);
  --fondo-dibujos: .14;
  --portada-dibujo: .35;
}

/* Fondo ambientado: ositos, mamaderas, chupetes, sonajeros y estrellas.
   Capa fija detrás del contenido; las tarjetas tapan el dibujo, así que el
   texto siempre queda sobre superficie lisa. */
:root[data-tema="nino"] body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url("/fondo-nino.svg") 0 0 / 280px 280px repeat;
  opacity: var(--fondo-dibujos, .6);
}

/* Viñeta en la portada: en el celular las tarjetas tapan casi todo el fondo,
   así que el osito va también dentro de la primera tarjeta. */
:root[data-tema="nino"] .portada { isolation: isolate; }
:root[data-tema="nino"] .portada::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: -1;
  width: clamp(80px, 22vw, 168px);
  aspect-ratio: 160 / 140;
  background: url("/portada-nino.svg") center / contain no-repeat;
  opacity: var(--portada-dibujo, .95);
  pointer-events: none;
}

/* La barra de filtros y el check quedan sobre el dibujo: velo translúcido
   para que se lean sin cortar el fondo con una franja lisa. */
:root[data-tema="nino"] nav {
  background: color-mix(in srgb, var(--fondo) 82%, transparent);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
:root[data-tema="nino"] .filtro-disp {
  width: fit-content;
  padding-inline: 10px 14px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--fondo) 88%, transparent);
}

@media print {
  :root[data-tema="nino"] body::before,
  :root[data-tema="nino"] .portada::after { display: none; }
}
