/* ─────────────────────────────────────────────────────────────
   BASE: colores, letras y piezas que comparten la invitación
   y el panel (botones, campos de formulario, avisos).
   ───────────────────────────────────────────────────────────── */

/* ── Colores y letras ── */
:root {
  /* Papel y texto */
  --crema: #fbf7ef;
  --petalo: #f4e6de;
  --petalo-2: #ecd8cc;
  --tinta: #2b2a22;
  --tinta-suave: #615d4e;
  --linea: #ecd6d4;      /* rubor de pétalo: marcos y líneas finas */

  /* Jardín */
  --hoja: #4a6741;
  --hoja-oscura: #33482d;
  --rosa: #a84b6f;       /* rosa cerezo oscuro */
  --cerezo: #f4afc3;     /* pétalo */
  --cerezo-claro: #fad5dd;
  --oro: #a47c2f;

  /* Fondo detrás del video y texto encima del video */
  --noche: #2c2019;
  --sobre-video: #fffaf0;

  /* Estados de confirmación */
  --si: #4a6741;
  --no: #9a3d36;
  --pendiente: #a47c2f;

  /* Letras */
  --letra-titulos: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --letra-texto: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  /* Movimiento suave para entradas y botones */
  --suave: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

/* ── Reinicio ── */
* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

/* Reglas que pide Lenis (scroll suave, ver js/animaciones.js).
   Mientras Lenis está activo, él hace el deslizamiento: el del navegador se apaga. */
html.lenis,
html.lenis body {
  height: auto;
}

.lenis.lenis-smooth {
  scroll-behavior: auto !important;
}

.lenis.lenis-smooth [data-lenis-prevent] {
  overscroll-behavior: contain;
}

.lenis.lenis-stopped {
  overflow: clip;
}

body {
  margin: 0;
  background: var(--noche);
  color: var(--tinta);
  font: 400 17px/1.65 var(--letra-texto);
  -webkit-text-size-adjust: 100%;
}

h1, h2, h3, p {
  margin: 0;
}

img {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: var(--hoja);
}

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

/* Enlace para saltar directo al contenido con el teclado */
.saltar {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  background: var(--crema);
  padding: 10px 14px;
  border-radius: 999px;
  text-decoration: none;
}

.saltar:focus {
  top: 12px;
}

/* Dato que falta llenar en config.js: se ve como [Nombre] */
.falta {
  font-family: var(--letra-texto);
  font-size: .82em;
  color: var(--rosa);
  background: rgba(169, 84, 95, .08);
  border-bottom: 1px dashed var(--rosa);
  padding: 0 .25em;
  white-space: nowrap;
}

/* Etiqueta pequeña en mayúsculas sobre los títulos */
.etiqueta {
  display: block;
  font: 600 12.5px/1.3 var(--letra-texto);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--rosa);
}

.nota {
  font-size: 15.5px;
  color: var(--tinta-suave);
}

.error {
  color: var(--no);
  font-size: 16px;
}

/* ── Botones ── */
.botones {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.boton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 22px;
  border: 1px solid var(--hoja);
  border-radius: 999px;
  background: transparent;
  color: var(--hoja);
  font: 500 16px/1.2 var(--letra-texto);
  text-decoration: none;
  cursor: pointer;
  transition: background .18s, color .18s, transform .18s var(--suave), box-shadow .18s;
}

.boton:hover {
  background: var(--hoja);
  color: var(--crema);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px -10px rgba(51, 72, 45, .7);
}

.boton:active {
  transform: translateY(0) scale(.98);
  box-shadow: none;
}

.boton.lleno {
  background: var(--hoja);
  color: var(--crema);
}

.boton.lleno:hover {
  background: var(--hoja-oscura);
}

.boton[aria-disabled="true"],
.boton:disabled {
  opacity: .45;
  cursor: not-allowed;
  background: transparent;
  color: var(--hoja);
  transform: none;
  box-shadow: none;
}

.boton.chico {
  min-height: 40px;
  padding: 6px 14px;
  font-size: 14.5px;
}

.boton.peligro {
  border-color: var(--no);
  color: var(--no);
}

.boton.peligro:hover {
  background: var(--no);
  color: var(--crema);
}

/* ── Campos de formulario ── */
fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

legend {
  padding: 0;
  margin-bottom: 10px;
  font-weight: 600;
}

.campo {
  display: grid;
  gap: 4px;
}

.campo label {
  font: 500 14px/1.3 var(--letra-texto);
  color: var(--tinta-suave);
}

.campo input,
.campo textarea,
.campo select {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px;
  border: 1px solid #cbbfa7;
  border-radius: 12px;
  background: #fff;
  font-size: 17px;
}

.campo textarea {
  min-height: 120px;
  font: 400 15.5px/1.5 var(--letra-texto);
}

.campo input:focus,
.campo textarea:focus,
.campo select:focus {
  border-color: var(--hoja);
  outline: none;
  box-shadow: 0 0 0 3px rgba(74, 103, 65, .2);
}

.campo input[aria-invalid="true"] {
  border-color: var(--no);
  border-width: 2px;
}

/* ── Aviso flotante ("Link copiado") ── */
.aviso {
  position: fixed;
  left: 50%;
  bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  transform: translateX(-50%);
  background: var(--tinta);
  color: var(--crema);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 15px;
  max-width: calc(100vw - 32px);
}

/* ── Barra de vista previa (solo sin Firebase) ── */
.barra-demo {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 7px 10px;
  padding: 7px max(10px, env(safe-area-inset-right, 0px)) calc(7px + env(safe-area-inset-bottom, 0px)) max(10px, env(safe-area-inset-left, 0px));
  background: #231a14;
  color: #f4ead6;
  font: 500 13.5px/1.2 var(--letra-texto);
}

.barra-demo select,
.barra-demo button {
  min-height: 36px;
  min-width: 0;
  max-width: 190px;
  flex: 0 1 auto;
  padding: 3px 10px;
  border: 1px solid #92816a;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.barra-demo select option {
  color: #222;
  background: #fff;
}

.barra-demo button {
  margin-left: auto;
}

.barra-demo label,
.barra-demo > span {
  white-space: nowrap;
}

body.con-barra-demo .portada {
  padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

body.con-barra-demo .aviso {
  bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}
