:root {
  --green-100: #f2f8ee;
  --green-200: #dcefd2;
  --green-300: #bfe0af;
  --green-400: #a8d5a2;
  --green-500: #7cbf6a;
  --green-600: #5fa24d;
  --ink: #33463a;
  --ink-soft: #5c6b5f;
  --cream: #fbfdf7;
  --card-shadow: 0 10px 30px rgba(76, 110, 80, 0.14);
  --radius: 22px;
  font-size: 17px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Nunito", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: linear-gradient(180deg, #cdeac0 0%, #e6f4dd 30%, var(--green-100) 100%);
  min-height: 100dvh;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- Cielo y nubes ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.cloud {
  position: absolute;
  background: #ffffff;
  border-radius: 100px;
  opacity: 0.75;
  filter: blur(1px);
  animation: drift linear infinite;
}
.cloud::before, .cloud::after {
  content: "";
  position: absolute;
  background: #fff;
  border-radius: 50%;
}
.cloud--1 { width: 120px; height: 38px; top: 8%; left: -140px; animation-duration: 55s; }
.cloud--2 { width: 90px; height: 30px; top: 22%; left: -120px; animation-duration: 70s; animation-delay: -20s; }
.cloud--3 { width: 150px; height: 46px; top: 40%; left: -180px; animation-duration: 90s; animation-delay: -45s; }
.cloud::before { width: 55%; height: 160%; top: -55%; left: 12%; }
.cloud::after  { width: 45%; height: 150%; top: -45%; right: 15%; }
@keyframes drift { to { transform: translateX(115vw); } }

.leaves { position: absolute; inset: 0; }
.leaf {
  position: absolute;
  top: -40px;
  font-size: 22px;
  opacity: 0.8;
  animation: fall linear infinite;
}
.leaf:nth-child(1) { left: 8%;  animation-duration: 14s; animation-delay: 0s; }
.leaf:nth-child(2) { left: 24%; animation-duration: 18s; animation-delay: -4s; }
.leaf:nth-child(3) { left: 46%; animation-duration: 16s; animation-delay: -9s; }
.leaf:nth-child(4) { left: 63%; animation-duration: 20s; animation-delay: -2s; }
.leaf:nth-child(5) { left: 80%; animation-duration: 15s; animation-delay: -11s; }
.leaf:nth-child(6) { left: 92%; animation-duration: 19s; animation-delay: -6s; }
@keyframes fall {
  0%   { transform: translateY(-40px) rotate(0deg); opacity: 0; }
  10%  { opacity: 0.8; }
  100% { transform: translateY(105vh) rotate(320deg); opacity: 0; }
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 18px calc(40px + env(safe-area-inset-bottom));
}

/* ---------- Hero ---------- */
.hero { text-align: center; padding-top: 12px; }
.spirit {
  width: min(74vw, 300px);
  margin: 0 auto 2px;
  animation: bob 5s ease-in-out infinite;
}
.spirit__img {
  width: 100%;
  height: auto;
  display: block;
  /* fondo recortado a transparente: los personajes flotan sobre el verde de la página */
  filter: drop-shadow(0 6px 10px rgba(76, 110, 80, 0.18));
}
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

.kicker {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 4px 0 6px;
  font-weight: 600;
}
.baby-name {
  font-family: "Baloo 2", cursive;
  font-weight: 700;
  font-size: clamp(3.2rem, 18vw, 4.6rem);
  line-height: 0.95;
  margin: 0;
  color: var(--green-600);
  text-shadow: 0 2px 0 #fff;
}
.event-type {
  font-family: "Baloo 2", cursive;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  font-size: 1.05rem;
  color: var(--ink);
  margin: 2px 0 14px;
}
.parents {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 6px;
}

/* ---------- Tarjetas ---------- */
.card {
  background: var(--cream);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  padding: 22px 20px;
  margin-top: 22px;
  border: 1px solid rgba(124, 191, 106, 0.18);
}

.details .detail {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
}
.details .detail + .detail { border-top: 1px dashed var(--green-200); }
.detail__icon {
  font-size: 1.7rem;
  line-height: 1;
  flex: 0 0 auto;
  margin-top: 2px;
}
.detail__label {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--green-600);
  font-weight: 700;
}
.detail__value { margin: 2px 0 0; font-weight: 600; }
.map-link {
  display: inline-block;
  margin-top: 8px;
  color: #fff;
  background: var(--green-500);
  padding: 9px 16px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
  min-height: 44px;
  line-height: 26px;
}
.map-link:active { transform: scale(0.97); }

/* ---------- Mesa de regalos ---------- */
.registry { text-align: center; }
.registry__icon { font-size: 2.4rem; line-height: 1; display: block; }
.registry__title {
  font-family: "Baloo 2", cursive;
  color: var(--green-600);
  font-size: 1.6rem;
  margin: 6px 0 6px;
}
.registry__text {
  color: var(--ink-soft);
  font-weight: 600;
  margin: 0 auto 16px;
  max-width: 30ch;
}
.registry__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 52px;
  padding: 12px 26px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ec4d9c, #d81b7a); /* rosa Liverpool */
  color: #fff;
  text-decoration: none;
  font-family: "Baloo 2", cursive;
  font-size: 1.1rem;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(216, 27, 122, 0.32);
}
.registry__btn:active { transform: translateY(1px) scale(0.99); }
.registry__code {
  margin: 12px 0 0;
  font-size: 0.9rem;
  color: var(--ink-soft);
  font-weight: 700;
  letter-spacing: 0.02em;
}
.registry__note {
  margin: 14px 0 0;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- RSVP ---------- */
.rsvp__title {
  font-family: "Baloo 2", cursive;
  color: var(--green-600);
  text-align: center;
  font-size: 1.7rem;
  margin: 0 0 2px;
}
.rsvp__deadline {
  text-align: center;
  color: var(--ink-soft);
  font-size: 0.92rem;
  margin: 0 0 18px;
}

.field { display: block; margin-bottom: 18px; }
.field__label {
  display: block;
  font-weight: 700;
  margin-bottom: 7px;
  color: var(--ink);
}
.field__opt { font-weight: 600; color: var(--ink-soft); font-size: 0.85rem; }
.field__hint { margin: 6px 0 0; font-size: 0.82rem; color: var(--ink-soft); }

input[type="text"],
textarea {
  width: 100%;
  font: inherit;
  padding: 14px 15px;
  border: 2px solid var(--green-200);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s;
}
input[type="text"]:focus,
textarea:focus {
  outline: none;
  border-color: var(--green-500);
}
textarea { resize: vertical; min-height: 84px; }

/* toggle sí/no */
.field--attend { border: none; padding: 0; margin: 0 0 18px; }
.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.toggle__opt {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 54px;
  padding: 8px 6px;
  border: 2px solid var(--green-200);
  border-radius: 14px;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}
.toggle__opt input { position: absolute; opacity: 0; }
.toggle__opt:has(input:checked) {
  border-color: var(--green-500);
  background: var(--green-200);
  color: var(--green-600);
}

/* stepper de acompañantes */
.field--guests { margin-bottom: 18px; }
.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 220px;
}
.stepper__btn {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border: none;
  border-radius: 50%;
  background: var(--green-500);
  color: #fff;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.stepper__btn:active { transform: scale(0.92); }
.stepper input {
  width: 60px;
  text-align: center;
  font: inherit;
  font-weight: 700;
  font-size: 1.3rem;
  border: 2px solid var(--green-200);
  border-radius: 14px;
  padding: 10px 0;
  background: #fff;
  color: var(--ink);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* honeypot oculto */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.submit {
  width: 100%;
  min-height: 56px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--green-500), var(--green-600));
  color: #fff;
  font-family: "Baloo 2", cursive;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(95, 162, 77, 0.35);
  margin-top: 4px;
}
.submit:active { transform: translateY(1px) scale(0.99); }
.submit:disabled { opacity: 0.6; cursor: default; }

.form-error {
  color: #c0392b;
  font-weight: 700;
  text-align: center;
  margin: 12px 0 0;
  min-height: 1.2em;
}

/* estado gracias */
.thanks { text-align: center; padding: 14px 0; animation: pop 0.4s ease; }
.thanks__spirit { font-size: 3.4rem; margin-bottom: 6px; }
.thanks h2 { font-family: "Baloo 2", cursive; color: var(--green-600); font-size: 1.9rem; margin: 0 0 6px; }
.thanks p { color: var(--ink-soft); font-weight: 600; margin: 0; }
@keyframes pop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.footer {
  text-align: center;
  margin-top: 26px;
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.95rem;
}
.footer__org {
  margin-top: 8px;
  font-weight: 600;
  font-size: 0.85rem;
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .spirit, .cloud, .leaf { animation: none; }
}
