/* Invitación: una plantilla, 4 estilos por data-estilo (y data-paleta en elegante). Primero celular.
   Contrastes calculados en test/contraste.test.mjs (texto 4.5:1, foco y bordes 3:1). Fuentes del sistema. */
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

.inv {
  --radio: .75rem;
  --fuente-texto: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin: 0; background: var(--fondo); color: var(--tinta);
  font-family: var(--fuente-texto); font-size: 1.0625rem; line-height: 1.55;
}

/* ---------- paletas ---------- */
[data-estilo="infantil"] {
  --fondo: #ffe9bd; --hoja: #fffaf0; --caja: #fff0d1; --tinta: #2a1f3d; --suave: #594a6b; --texto-acento: #a3330c;
  --acento: #b93a0e; --acento-tinta: #ffffff; --linea: #efd9b0; --borde-campo: #8a7a99; --campo: #ffffff; --campo-tinta: #2a1f3d;
  --foco: #1d4ed8; --trazo: #594a6b;
  --d1: #ff6b4a; --d2: #2ab7a9; --d3: #ffc233; --d4: #7c5cff;
  --fuente-titulo: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Varela Round", Nunito, system-ui, sans-serif;
  --radio: 1.25rem;
}
[data-estilo="elegante"], [data-estilo="elegante"][data-paleta="verde"] {
  --fondo: #e9e2d3; --hoja: #f9f6ef; --caja: #f0eadd; --tinta: #1d2a24; --suave: #4c5a53; --texto-acento: #2f4a3e;
  --acento: #2f4a3e; --acento-tinta: #fbf8f1; --linea: #ddd3c0; --borde-campo: #7d8a83; --campo: #fffdf8; --campo-tinta: #1d2a24;
  --foco: #7a2e8f; --trazo: #a38443;
  --d1: #a38443; --d2: #7f9a7a; --d3: #2f4a3e; --d4: #c9b27a;
  --fuente-titulo: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", "URW Palladio L", Georgia, serif;
  --radio: .25rem;
}
[data-estilo="elegante"][data-paleta="rosa"] {
  --fondo: #f1dfe0; --hoja: #fdf7f6; --caja: #f8eaea; --tinta: #3a1f2b; --suave: #6b4b57; --texto-acento: #8a3556;
  --acento: #8a3556; --acento-tinta: #fffafa; --linea: #ecd3d6; --borde-campo: #9a7d88; --campo: #ffffff; --campo-tinta: #3a1f2b;
  --foco: #1d4ed8; --trazo: #b0895a;
  --d1: #b0895a; --d2: #d39aac; --d3: #8a3556; --d4: #e3c3a0;
}
[data-estilo="elegante"][data-paleta="azul"] {
  --fondo: #dfe6ef; --hoja: #f7f9fc; --caja: #ebf0f6; --tinta: #18263a; --suave: #47566b; --texto-acento: #24406b;
  --acento: #24406b; --acento-tinta: #ffffff; --linea: #d3dce8; --borde-campo: #7a889b; --campo: #ffffff; --campo-tinta: #18263a;
  --foco: #a1306f; --trazo: #a38443;
  --d1: #a38443; --d2: #8ba0bf; --d3: #24406b; --d4: #c9b27a;
}
[data-estilo="egresados"] {
  --fondo: #080c22; --hoja: #0d1330; --caja: #18214d; --tinta: #f3f5ff; --suave: #b8c0e6; --texto-acento: #c6ff3d;
  --acento: #c6ff3d; --acento-tinta: #0d1330; --linea: #26306a; --borde-campo: #8d97c8; --campo: #141c45; --campo-tinta: #f3f5ff;
  --foco: #ff7ad9; --trazo: #7cd4ff;
  --d1: #c6ff3d; --d2: #7cd4ff; --d3: #2a3678; --d4: #ff7ad9;
  --fuente-titulo: "Avenir Next Condensed", "Roboto Condensed", "Arial Narrow", "Helvetica Neue", system-ui, sans-serif;
  --radio: .5rem;
}
[data-estilo="empresa"] {
  --fondo: #0f0c09; --hoja: #1b1611; --caja: #2a231b; --tinta: #f6efe2; --suave: #cbbfa9; --texto-acento: #e5bd6a;
  --acento: #e5bd6a; --acento-tinta: #1b1611; --linea: #3b3227; --borde-campo: #9c8f78; --campo: #241e17; --campo-tinta: #f6efe2;
  --foco: #7cc4ff; --trazo: #e5bd6a;
  --d1: #e5bd6a; --d2: #f6efe2; --d3: #8a6d35; --d4: #b88f3e;
  --fuente-titulo: Didot, "Bodoni 72", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --radio: 2rem;
}

/* ---------- hoja ---------- */
.hoja { max-width: 34rem; margin: 0 auto; background: var(--hoja); min-height: 100vh; padding: 0 1.25rem 2rem; overflow: hidden; }
@media (min-width: 48rem) {
  .inv { padding: 2.5rem 1rem; }
  .hoja { min-height: 0; border-radius: 1.5rem; padding: 0 2.25rem 2.25rem; box-shadow: 0 1.25rem 3rem rgba(0, 0, 0, .18); }
}
a { color: var(--texto-acento); text-underline-offset: .15em; }
.arte { display: block; width: 100%; height: auto; }
.arte-arriba { margin: 0 -1.25rem; }
@media (min-width: 48rem) { .arte-arriba { margin: 0 -2.25rem; } }

.portada { text-align: center; padding-top: .25rem; }
.kicker { margin: 1rem 0 .25rem; color: var(--texto-acento); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: .95rem; }
.nombres { margin: .25rem 0 .5rem; font-family: var(--fuente-titulo); font-weight: 700; font-size: clamp(2.1rem, 9vw, 3.3rem); line-height: 1.08; overflow-wrap: anywhere; hyphens: auto; }
.subtitulo { margin: 0 auto .5rem; max-width: 26rem; color: var(--suave); font-size: 1.1rem; overflow-wrap: anywhere; }
.sello .arte { width: min(12.5rem, 62%); margin: 1rem auto; }
.foto { display: block; width: 100%; height: auto; max-height: 30rem; object-fit: cover; margin: 1.25rem auto; border-radius: var(--radio); }
.fecha-grande { margin: .75rem 0 0; font-size: 1.3rem; font-weight: 700; overflow-wrap: anywhere; }
.fecha-grande .nw { white-space: nowrap; }

.cuenta { margin: 1.75rem 0 1.5rem; text-align: center; }
.cuenta-t { margin: 0 0 .5rem; font-size: .95rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--suave); font-family: var(--fuente-texto); }
.cuenta-n { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; }
.cuenta-n p { margin: 0; background: var(--caja); border-radius: var(--radio); padding: .6rem .2rem; }
.cuenta-n span { display: block; font-size: 1.85rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; font-family: var(--fuente-titulo); }
.cuenta-n small { display: block; font-size: .8rem; color: var(--suave); }
.cuenta-fin { margin: 0; font-family: var(--fuente-titulo); font-size: 1.5rem; font-weight: 700; color: var(--texto-acento); }

.bloque { border-top: 1px solid var(--linea); padding: 1.75rem 0; }
.kicker, .nombres, .subtitulo, .fecha-grande, .bloque h2 { text-wrap: balance; }
.bloque h2 { margin: 0 0 .75rem; text-align: center; font-family: var(--fuente-titulo); font-size: 1.55rem; line-height: 1.2; color: var(--texto-acento); }
.bloque > p { text-align: center; overflow-wrap: anywhere; }
.datos { margin: 0; display: grid; gap: .75rem; }
.datos div { display: grid; grid-template-columns: 4.75rem minmax(0, 1fr); gap: .5rem; }
.datos dt { color: var(--suave); font-size: .95rem; }
.datos dd { margin: 0; overflow-wrap: anywhere; }
.botones { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.25rem; }
.botones .btn { flex: 1 1 100%; }
@media (min-width: 30rem) { .botones .btn { flex: 1 1 auto; } }
.destacado { font-size: 1.2rem; font-weight: 600; }
.chico { font-size: .9rem; color: var(--suave); }
.etq { display: block; color: var(--suave); font-size: .9rem; }
.dato-copiar { margin: .5rem 0; }
.dato-copiar code { display: inline-block; max-width: 100%; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 1.15rem; font-weight: 700; background: var(--caja); padding: .3rem .7rem; border-radius: .4rem; overflow-wrap: anywhere; }
.regalo { text-align: center; }
.regalo .btn { margin: .25rem auto .75rem; }
.estado-copiar, .rsvp-estado { min-height: 1.5em; font-weight: 700; margin: .5rem 0 0; }

/* ---------- botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.875rem; padding: .7rem 1.25rem;
  border: 2px solid var(--acento); border-radius: var(--radio); background: var(--acento); color: var(--acento-tinta);
  font: inherit; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.08); }
.btn-2 { background: transparent; color: var(--texto-acento); }
.btn-wa { background: #25d366; border-color: #25d366; color: #0a2a17; width: 100%; }
:focus-visible { outline: 3px solid var(--foco); outline-offset: 2px; }
@media (forced-colors: active) { :focus-visible { outline-color: Highlight; } .btn { border-color: ButtonText; } }

/* ---------- formulario ---------- */
.rsvp > p { margin-top: 0; }
.rsvp-form { margin-top: 1rem; }
.campo { margin: 0 0 1.1rem; }
.campo > label, .opciones legend { display: block; font-weight: 600; margin-bottom: .35rem; }
.campo input:not([type="radio"]), .campo select, .campo textarea {
  display: block; width: 100%; min-height: 2.875rem; padding: .6rem .75rem; border: 2px solid var(--borde-campo); border-radius: .6rem;
  background: var(--campo); color: var(--campo-tinta); font: inherit;
}
.campo textarea { resize: vertical; }
.ayuda { display: block; margin-top: .3rem; font-size: .9rem; color: var(--suave); }
.opciones { border: 0; padding: 0; margin-left: 0; margin-right: 0; }
.opciones label { display: inline-flex; align-items: center; gap: .5rem; min-height: 2.75rem; margin-right: 1.25rem; cursor: pointer; }
.opciones input { width: 1.3rem; height: 1.3rem; accent-color: var(--acento); margin: 0; }
.rsvp-form .btn { width: 100%; }
.trampa { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.o { text-align: center; color: var(--suave); margin: 1.25rem 0 .5rem; }
.rsvp-cerrado { text-align: center; font-weight: 700; }
.nota-demo { font-size: .9rem; color: var(--suave); text-align: center; margin: .6rem 0 0; }

.pie-inv { text-align: center; font-size: .875rem; color: var(--suave); padding-top: .5rem; }
.pie-inv a { color: inherit; }
.arte-abajo .arte { width: 100%; max-width: 22rem; margin: 0 auto .5rem; }

/* ---------- aviso de demo ---------- */
.demo-aviso { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .25rem 1rem; padding: .4rem 1rem; background: #16131c; color: #ffffff; font-size: .95rem; text-align: center; }
.demo-aviso p { margin: 0; display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; justify-content: center; }
.demo-aviso a { color: #ffffff; min-height: 2.75rem; display: inline-flex; align-items: center; }
.demo-aviso .btn-demo { background: #ffffff; color: #16131c; padding: 0 1rem; border-radius: 999px; font-weight: 700; text-decoration: none; }
.demo-aviso :focus-visible { outline-color: #ffd23f; }
@media (min-width: 48rem) { .inv .demo-aviso { margin: -2.5rem -1rem 2rem; } }

/* ---------- toques por estilo ---------- */
[data-estilo="elegante"] .nombres { font-style: italic; font-weight: 400; font-size: clamp(2.3rem, 10vw, 3.6rem); }
[data-estilo="elegante"] .kicker { font-weight: 600; letter-spacing: .25em; font-size: .85rem; }
[data-estilo="elegante"] .bloque h2 { font-weight: 400; font-style: italic; font-size: 1.75rem; }
[data-estilo="egresados"] .nombres { text-transform: uppercase; font-weight: 800; letter-spacing: .02em; font-stretch: condensed; }
[data-estilo="egresados"] .bloque h2 { text-transform: uppercase; letter-spacing: .04em; }
[data-estilo="egresados"] .cuenta-n p { border: 1px solid var(--linea); }
[data-estilo="infantil"] .nombres { font-weight: 800; color: var(--texto-acento); }
[data-estilo="infantil"] .cuenta-n p { border: 2px dashed var(--linea); }
[data-estilo="empresa"] .nombres { font-weight: 400; letter-spacing: .02em; }
[data-estilo="empresa"] .kicker { letter-spacing: .3em; font-size: .85rem; }

/* ---------- ilustraciones (colores por clase: la CSP no permite style="") ---------- */
.arte .c1 { fill: var(--d1); } .arte .c2 { fill: var(--d2); } .arte .c3 { fill: var(--d3); } .arte .c4 { fill: var(--d4); }
.arte .cuerda { fill: none; stroke: var(--trazo); stroke-width: 1.5; }
.arte .plato { fill: var(--linea); } .arte .crema { fill: #ffffff; } .arte .vela { fill: var(--d4); } .arte .llama { fill: var(--d3); }
.arte .trazo { fill: none; stroke: var(--trazo); stroke-width: 1.6; stroke-linecap: round; }
.arte .hj { fill: var(--d2); } .arte .punto { fill: var(--trazo); }
.arte .aro { fill: none; stroke: var(--trazo); stroke-width: 1.6; } .arte .aro.fino { stroke-width: .8; }
.arte .ini { font-family: var(--fuente-titulo); font-style: italic; font-size: 46px; fill: var(--texto-acento); }
.arte .oscuro { fill: var(--d3); } .arte .borla { fill: none; stroke: var(--d1); stroke-width: 3; }
.arte .rayo { fill: none; stroke-width: 3; stroke-linecap: round; } .arte .rayo.c1 { stroke: var(--d1); } .arte .rayo.c2 { stroke: var(--d2); }
.arte .vidrio { fill: none; stroke: var(--d2); stroke-width: 2.5; stroke-linejoin: round; } .arte .bebida { fill: var(--d1); opacity: .8; }
[data-estilo="empresa"] .arte .trazo { stroke: var(--d2); stroke-width: 2.5; }

@media (prefers-reduced-motion: no-preference) {
  .cuenta-n span { transition: opacity .2s; }
}
@media print { .demo-aviso, .rsvp-form, .btn-wa { display: none; } }
