/* ============================================================
   INVITACIÓN — Hero tipo tarjeta, sobre 3D, barra inferior y música
   Inspirado en la invitación de referencia: dusty blue + crema + dorado
   ============================================================ */

:root {
  --font-elegant: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  --ink: #2F4560;
  --linen: #EDE8DF;
  --seal-blue: #5D7FA4;
  --seal-blue-deep: #3E5C7E;
  --nav-height: 68px;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

body {
  padding-bottom: calc(var(--nav-height) + 18px);
}

/* Bloquear scroll mientras el sobre está cerrado */
.intro-pending body {
  overflow: hidden;
}

/* ============================================================
   SELLO DE CERA (compartido por sobre y tarjeta)
   ============================================================ */
.wax-seal {
  --size: 86px;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  position: relative;
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.45) 0%, transparent 32%),
    radial-gradient(circle at 50% 50%, var(--seal-blue) 0%, var(--seal-blue) 52%, var(--seal-blue-deep) 100%);
  box-shadow:
    0 6px 18px rgba(46, 70, 100, 0.35),
    inset 0 -4px 8px rgba(30, 50, 75, 0.45),
    inset 0 3px 6px rgba(255, 255, 255, 0.25);
  /* borde irregular de cera */
  clip-path: polygon(50% 0%, 61% 3%, 71% 2%, 79% 9%, 89% 12%, 93% 22%, 99% 31%, 97% 42%, 100% 52%, 96% 62%, 97% 72%, 90% 80%, 85% 90%, 75% 94%, 65% 99%, 54% 97%, 44% 100%, 34% 96%, 24% 96%, 16% 88%, 8% 82%, 5% 71%, 0% 61%, 3% 50%, 0% 39%, 5% 29%, 8% 19%, 17% 12%, 25% 4%, 36% 4%);
}

.wax-seal::before {
  content: '';
  position: absolute;
  inset: 13%;
  border-radius: 50%;
  border: 1.5px solid rgba(232, 200, 120, 0.85);
  box-shadow: inset 0 0 0 4px rgba(46, 70, 100, 0.25), 0 0 8px rgba(255, 241, 196, 0.35);
}

.wax-seal span {
  position: relative;
  font-family: var(--font-elegant);
  font-size: calc(var(--size) * 0.27);
  font-weight: 600;
  letter-spacing: 0.06em;
  background: var(--gold-gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: goldShimmer 4s linear infinite;
}

/* ============================================================
   INTRO — SOBRE 3D
   ============================================================ */
.intro {
  display: none;
}

.js-enabled .intro {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.8rem;
  padding: 24px 16px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(255,255,255,0.9) 0%, transparent 60%),
    linear-gradient(160deg, #F6F2EA 0%, #E9EEF4 55%, #D6E1EC 100%);
  overflow: hidden;
  perspective: 1200px;
  transition: opacity 0.9s ease, transform 0.9s ease, visibility 0s linear 0.9s;
}

.intro-glow {
  position: absolute;
  width: 520px;
  height: 520px;
  max-width: 130vw;
  max-height: 130vw;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 200, 120, 0.35) 0%, rgba(232, 200, 120, 0.08) 40%, transparent 70%);
  animation: sealGlow 4s ease-in-out infinite;
  pointer-events: none;
}

.intro-floral {
  position: absolute;
  width: min(60vw, 340px);
  height: min(45vw, 255px);
  pointer-events: none;
  opacity: 0.95;
}

.intro-floral-tl { top: -30px; left: -40px; transform: rotate(160deg); }
.intro-floral-br { bottom: -30px; right: -40px; transform: rotate(-20deg); }

.intro-pretitle {
  position: relative;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--ink);
  text-align: center;
  animation: fadeInUp 1s ease-out both;
}

.envelope {
  --w: min(82vw, 360px);
  position: relative;
  width: var(--w);
  height: calc(var(--w) * 0.66);
  /* sin preserve-3d: así z-index decide qué capa queda delante */
  perspective: 900px;
  animation: envelopeFloat 4.5s ease-in-out infinite;
}

@keyframes envelopeFloat {
  0%, 100% { transform: translateY(0) rotateX(8deg) rotateY(-6deg); }
  50% { transform: translateY(-10px) rotateX(4deg) rotateY(6deg); }
}

.env-back,
.env-pocket,
.env-flap {
  position: absolute;
  inset: 0;
  border-radius: 6px;
}

.env-back {
  background: linear-gradient(160deg, #5F7FA3 0%, #46668B 100%);
  box-shadow: 0 24px 50px rgba(46, 70, 100, 0.35);
  outline: 1.5px solid rgba(232, 200, 120, 0.7);
  outline-offset: -6px;
}

.env-letter {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 8%;
  height: 84%;
  background: linear-gradient(180deg, #FFFFFF 0%, #F8F5EF 100%);
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(46, 70, 100, 0.15);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: 10%;
  gap: 0.3rem;
  z-index: 2;
  transition: transform 1s cubic-bezier(.2, .8, .2, 1) 0.9s;
}

.env-letter-names {
  font-family: var(--font-elegant);
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
}

.env-letter-names em {
  font-family: var(--font-script);
  text-transform: none;
  font-style: normal;
  color: var(--gold);
  font-size: 1.3em;
}

.env-letter-date {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  color: var(--gold-deep);
}

.env-pocket {
  z-index: 3;
  background: linear-gradient(180deg, #8AA6C4 0%, #6886AA 100%);
  clip-path: polygon(0 0, 50% 54%, 100% 0, 100% 100%, 0 100%);
}

/* Línea dorada de la solapa (envoltorio con filtro para que el brillo no se recorte) */
.env-flap-wrap {
  position: absolute;
  inset: 0;
  z-index: 4;
  transform-origin: 50% 0;
  filter: drop-shadow(0 3px 0 rgba(232, 200, 120, 0.9)) drop-shadow(0 6px 10px rgba(46, 70, 100, 0.3));
  transition: transform 1s cubic-bezier(.5, 0, .3, 1) 0.35s, z-index 0s linear 0.85s;
}

.env-flap {
  background: linear-gradient(180deg, #96B0CC 0%, #7393B6 100%);
  clip-path: polygon(0 0, 100% 0, 50% 58%);
  backface-visibility: visible;
}

.env-seal {
  --size: 78px;
  position: absolute;
  left: 50%;
  top: 58%;
  z-index: 5;
  transform: translate(-50%, -50%);
  transition: transform 0.6s cubic-bezier(.5, -0.4, .5, 1), opacity 0.5s ease;
}

.intro-open {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 2.2rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(135deg, var(--seal-blue-deep) 0%, var(--seal-blue) 100%);
  border: none;
  border-radius: 40px;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(46, 70, 100, 0.35), 0 0 0 1.5px rgba(232, 200, 120, 0.9);
  animation: fadeInUp 1s ease-out 0.3s both, pulseGlow 2.4s ease-in-out 1.3s infinite;
}

.intro-hint {
  position: relative;
  font-size: 0.75rem;
  color: var(--gray-text);
  animation: fadeInUp 1s ease-out 0.5s both;
}

/* Secuencia de apertura */
.intro.is-opening .env-seal {
  transform: translate(-50%, -50%) scale(1.4) rotate(25deg);
  opacity: 0;
}

.intro.is-opening .env-flap-wrap {
  transform: rotateX(180deg);
  z-index: 1;
}

.intro.is-opening .env-letter {
  transform: translateY(-62%);
}

.intro.is-opening .envelope {
  animation: none;
  transform: rotateX(0) rotateY(0);
  transition: transform 0.6s ease;
}

.intro.is-opening .intro-open,
.intro.is-opening .intro-hint,
.intro.is-opening .intro-pretitle {
  opacity: 0;
  transform: translateY(16px);
  transition: all 0.4s ease;
  animation: none;
}

.intro.is-done {
  opacity: 0;
  transform: scale(1.15);
  visibility: hidden;
  pointer-events: none;
}

/* ============================================================
   HERO — TARJETA DE INVITACIÓN
   ============================================================ */
.hero-invite {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 16px 40px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 20% 15%, rgba(255,255,255,0.8) 0%, transparent 50%),
    radial-gradient(ellipse at 85% 90%, rgba(169, 191, 214, 0.55) 0%, transparent 55%),
    repeating-linear-gradient(45deg, rgba(255,255,255,0.05) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, #F4F0E8 0%, #E7EDF3 60%, #D3DFEB 100%);
  perspective: 1400px;
}

.hero-floral {
  position: absolute;
  width: min(70vw, 420px);
  height: min(52vw, 315px);
  pointer-events: none;
  z-index: 1;
}

.hero-floral-tr { top: -40px; right: -60px; transform: rotate(200deg); }
.hero-floral-bl { bottom: -40px; left: -60px; transform: rotate(20deg); }

/* Aros dorados girando en 3D detrás de la tarjeta */
.hero-rings {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(120vw, 820px);
  height: min(120vw, 820px);
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  pointer-events: none;
  z-index: 0;
}

.hero-rings span {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 163, 82, 0.55);
  box-shadow: 0 0 24px rgba(232, 200, 120, 0.35), inset 0 0 24px rgba(232, 200, 120, 0.25);
  animation: ringSpinA 18s linear infinite;
}

.hero-rings span:nth-child(2) {
  inset: 8%;
  border-color: rgba(110, 141, 176, 0.45);
  animation: ringSpinB 24s linear infinite;
}

@keyframes ringSpinA {
  from { transform: rotateX(70deg) rotateZ(0deg); }
  to { transform: rotateX(70deg) rotateZ(360deg); }
}

@keyframes ringSpinB {
  from { transform: rotateY(68deg) rotateZ(0deg); }
  to { transform: rotateY(68deg) rotateZ(-360deg); }
}

.invite-stage {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 440px;
  perspective: 1400px;
}

.js-enabled .invite-stage {
  opacity: 0;
  transform: translateY(60px) rotateX(28deg) scale(0.92);
  transform-origin: 50% 100%;
}

.intro-done .invite-stage {
  opacity: 1;
  transform: none;
  transition: opacity 1.2s ease, transform 1.4s cubic-bezier(.2, .8, .2, 1);
}

.invite-float {
  animation: cardFloat 7s ease-in-out infinite;
  transform-style: preserve-3d;
}

@keyframes cardFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.invite-card {
  position: relative;
  background: linear-gradient(180deg, #FFFFFF 0%, #FBF9F5 60%, #F6F3EE 100%);
  border-radius: 10px;
  box-shadow:
    0 30px 60px rgba(46, 70, 100, 0.25),
    0 8px 18px rgba(46, 70, 100, 0.12);
  overflow: hidden;
  transform-style: preserve-3d;
  transform: rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transition: transform 0.25s ease-out;
}

/* Marco dorado fino interior, como en una invitación impresa */
.invite-card::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(201, 163, 82, 0.55);
  border-radius: 6px;
  pointer-events: none;
  z-index: 3;
}

.invite-photo {
  position: relative;
  height: 290px;
  overflow: hidden;
}

.invite-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 30%;
  transform: scale(1.08);
  animation: kenBurns 18s ease-in-out infinite alternate;
}

@keyframes kenBurns {
  from { transform: scale(1.08) translate(0, 0); }
  to { transform: scale(1.18) translate(-2%, -2%); }
}

/* Desvanecido de la foto hacia el papel */
.invite-photo::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 45%;
  background: linear-gradient(180deg, transparent 0%, rgba(255,255,255,0.75) 70%, #FFFFFF 100%);
}

.invite-photo-floral {
  position: absolute;
  top: -28px;
  left: -46px;
  width: 210px;
  height: 158px;
  z-index: 2;
  transform: rotate(150deg);
  pointer-events: none;
}

.invite-photo-floral-r {
  top: auto;
  left: auto;
  bottom: -30px;
  right: -40px;
  transform: rotate(-15deg);
}

.invite-seal {
  --size: 92px;
  position: relative;
  z-index: 4;
  margin: -58px auto 0;
}

.invite-body {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 1rem 1.6rem 1.4rem;
}

.invite-pretitle,
.invite-sub,
.invite-city {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink);
  font-weight: 400;
}

.invite-pretitle {
  margin-bottom: 0.8rem;
}

.invite-names {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  margin-bottom: 0.9rem;
}

.invite-name {
  font-family: var(--font-elegant);
  font-weight: 500;
  font-size: clamp(2.5rem, 11vw, 3.3rem);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
}

.invite-and {
  font-family: var(--font-script);
  font-size: 2.1rem;
  line-height: 1.1;
  background: var(--gold-gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 4px rgba(201, 163, 82, 0.45));
  animation: goldShimmer 4s linear infinite;
}

/* Entrada de nombres en 3D tras abrir el sobre */
.js-enabled .invite-name,
.js-enabled .invite-and {
  opacity: 0;
  transform: rotateX(90deg) translateY(20px);
}

.intro-done .invite-name,
.intro-done .invite-and {
  opacity: 1;
  transform: none;
  transition: opacity 1s ease, transform 1.2s cubic-bezier(.2, .8, .2, 1);
}

.intro-done .invite-name:nth-child(1) { transition-delay: 0.6s; }
.intro-done .invite-and { transition-delay: 0.85s; }
.intro-done .invite-name:nth-child(3) { transition-delay: 1.1s; }

.invite-sub {
  line-height: 1.9;
}

.invite-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.8rem auto;
  max-width: 180px;
}

.invite-ornament span {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.invite-ornament i {
  font-style: normal;
  font-size: 0.7rem;
  color: var(--seal-blue);
}

.invite-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  margin-bottom: 0.9rem;
}

.invite-weekday,
.invite-hour {
  font-family: var(--font-sans);
  font-size: 0.66rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--ink);
}

.invite-date-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  max-width: 300px;
}

.invite-date-side {
  font-family: var(--font-sans);
  font-size: 0.64rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink);
  padding: 0.35rem 0;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}

.invite-date-day {
  font-family: var(--font-elegant);
  font-size: 3rem;
  font-weight: 500;
  line-height: 1;
  background: var(--gold-gradient);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 6px rgba(201, 163, 82, 0.4));
  animation: goldShimmer 5s linear infinite;
}

.invite-venue {
  font-family: var(--font-script);
  font-size: 1.7rem;
  color: var(--seal-blue-deep);
  line-height: 1.2;
}

.invite-city {
  font-size: 0.6rem;
  margin-bottom: 1.4rem;
}

/* Botones circulares */
.invite-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.4rem;
  margin-bottom: 1.2rem;
}

.circle-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  -webkit-tap-highlight-color: transparent;
}

.circle-icon {
  position: relative;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #8AA6C4 0%, var(--seal-blue) 55%, var(--seal-blue-deep) 100%);
  box-shadow: 0 6px 16px rgba(46, 70, 100, 0.3), inset 0 2px 4px rgba(255,255,255,0.25);
  transition: transform 0.4s cubic-bezier(.3, 1.6, .5, 1), box-shadow 0.4s ease;
  overflow: hidden;
}

/* Aro dorado giratorio alrededor de cada botón */
.circle-icon::before {
  content: '';
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from var(--spin, 0deg), #9C7A2E, #E8C878, #FFF6D8, #E8C878, #9C7A2E, #C9A352, #9C7A2E);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spinAngle 4s linear infinite;
}

/* Destello que cruza el botón */
.circle-icon::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.55) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: sweep 3.6s ease-in-out infinite;
}

.circle-btn:nth-child(2) .circle-icon::after { animation-delay: 0.3s; }
.circle-btn:nth-child(3) .circle-icon::after { animation-delay: 0.6s; }
.circle-btn:nth-child(4) .circle-icon::after { animation-delay: 0.9s; }

.circle-icon svg {
  position: relative;
  z-index: 1;
  width: 26px;
  height: 26px;
}

.circle-btn:hover .circle-icon,
.circle-btn:focus-visible .circle-icon {
  transform: translateY(-6px) scale(1.08) rotateY(360deg);
  transition: transform 0.9s cubic-bezier(.3, 1.3, .5, 1), box-shadow 0.4s ease;
  box-shadow: 0 14px 26px rgba(46, 70, 100, 0.35), 0 0 18px rgba(232, 200, 120, 0.7);
}

.circle-btn:active .circle-icon {
  transform: scale(0.92);
}

.circle-label {
  font-family: var(--font-sans);
  font-size: 0.56rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.4;
}

/* Aparición escalonada de los botones */
.js-enabled .circle-btn {
  opacity: 0;
  transform: translateY(20px) scale(0.6);
}

.intro-done .circle-btn {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.8s cubic-bezier(.3, 1.6, .5, 1);
}

.intro-done .circle-btn:nth-child(1) { transition-delay: 1.4s; }
.intro-done .circle-btn:nth-child(2) { transition-delay: 1.55s; }
.intro-done .circle-btn:nth-child(3) { transition-delay: 1.7s; }
.intro-done .circle-btn:nth-child(4) { transition-delay: 1.85s; }

.invite-closing {
  font-family: var(--font-script);
  font-size: 1.35rem;
  color: var(--seal-blue-deep);
}

.invite-heart {
  display: inline-block;
  color: var(--seal-blue);
  font-size: 0.8rem;
  animation: heartbeat 1.6s ease-in-out infinite;
}

/* Acuarela azul al pie de la tarjeta */
.invite-wash {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42%;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 100%, rgba(169, 191, 214, 0.55) 0%, transparent 70%),
    radial-gradient(ellipse 55% 45% at 80% 100%, rgba(143, 169, 196, 0.45) 0%, transparent 70%),
    radial-gradient(ellipse 80% 35% at 50% 105%, rgba(110, 141, 176, 0.35) 0%, transparent 70%);
}

.hero-invite .hero-scroll {
  position: relative;
  z-index: 2;
  margin-top: 1.4rem;
  color: var(--seal-blue);
}

/* ============================================================
   BARRA DE NAVEGACIÓN INFERIOR
   ============================================================ */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 12px;
  z-index: 900;
  width: calc(100% - 24px);
  max-width: 520px;
  height: var(--nav-height);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  backdrop-filter: blur(14px) saturate(1.3);
  border-radius: 22px;
  box-shadow: 0 12px 34px rgba(46, 70, 100, 0.22);
  transform: translate(-50%, 0);
  transition: transform 0.8s cubic-bezier(.2, .9, .3, 1.2) 1.6s, opacity 0.6s ease 1.6s;
}

.intro-pending .bottom-nav {
  transform: translate(-50%, 140%);
  opacity: 0;
}

.bottom-nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0;
  color: var(--gray-text);
  font-family: var(--font-sans);
  font-size: 0.56rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: color 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform 0.4s cubic-bezier(.3, 1.6, .5, 1);
}

.bottom-nav-item.is-active {
  color: var(--seal-blue-deep);
}

.bottom-nav-item.is-active svg {
  transform: translateY(-2px) scale(1.12);
  color: var(--gold-deep);
  filter: drop-shadow(0 0 4px rgba(232, 200, 120, 0.8));
}

/* Píldora que se desliza hasta la sección activa */
.bottom-nav-indicator {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 0;
  width: calc((100% - 16px) / 5);
  margin-left: 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(231, 238, 245, 0.95) 0%, rgba(243, 227, 184, 0.6) 100%);
  box-shadow: inset 0 0 0 1px rgba(201, 163, 82, 0.55), 0 0 14px rgba(232, 200, 120, 0.35);
  transform: translateX(calc(var(--nav-index, 0) * 100%));
  transition: transform 0.55s cubic-bezier(.3, 1.4, .5, 1);
}

/* ============================================================
   BOTÓN DE MÚSICA
   ============================================================ */
.music-toggle {
  position: fixed;
  right: 16px;
  bottom: calc(var(--nav-height) + 26px);
  z-index: 901;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  background: radial-gradient(circle at 35% 30%, #8AA6C4 0%, var(--seal-blue) 55%, var(--seal-blue-deep) 100%);
  box-shadow: 0 8px 22px rgba(46, 70, 100, 0.35);
  transition: transform 0.3s ease, opacity 0.6s ease 1.8s;
}

.intro-pending .music-toggle {
  opacity: 0;
  pointer-events: none;
}

.music-toggle:hover { transform: scale(1.08); }
.music-toggle:active { transform: scale(0.94); }

.music-ring {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  padding: 2px;
  background: conic-gradient(from var(--spin, 0deg), #9C7A2E, #FFF6D8, #E8C878, transparent 60%, #9C7A2E);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  animation: spinAngle 3s linear infinite;
  animation-play-state: paused;
}

.music-toggle.is-playing .music-ring { animation-play-state: running; }

.music-note {
  width: 22px;
  height: 22px;
}

.music-bars {
  display: none;
  align-items: flex-end;
  gap: 3px;
  height: 18px;
}

.music-bars i {
  width: 3px;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(180deg, #FFF1C4, #E8C878);
  transform-origin: bottom;
  animation: eq 0.9s ease-in-out infinite;
}

.music-bars i:nth-child(2) { animation-delay: 0.2s; }
.music-bars i:nth-child(3) { animation-delay: 0.45s; }
.music-bars i:nth-child(4) { animation-delay: 0.1s; }

.music-toggle.is-playing .music-note { display: none; }
.music-toggle.is-playing .music-bars { display: flex; }

@keyframes eq {
  0%, 100% { transform: scaleY(0.3); }
  50% { transform: scaleY(1); }
}

/* ============================================================
   ESCRITORIO
   ============================================================ */
@media (min-width: 900px) {
  .invite-stage { max-width: 470px; }
  .invite-photo { height: 320px; }
  .hero-floral { width: 520px; height: 390px; }
}

@media (max-width: 380px) {
  .invite-body { padding: 0.8rem 1rem 1.2rem; }
  .circle-icon { width: 50px; height: 50px; }
  .circle-label { font-size: 0.5rem; letter-spacing: 0.08em; }
  .bottom-nav-item { font-size: 0.5rem; letter-spacing: 0.04em; }
}

/* ============================================================
   RSVP — validación de campos
   ============================================================ */
.form-required-note {
  font-size: 0.72rem;
  color: var(--gray-text);
  margin-bottom: 1.2rem;
  text-align: right;
}

.req,
.form-required-note span {
  color: #C0564F;
  font-weight: 600;
}

.form-group.has-error input,
.form-group.has-error select,
.form-group.has-error textarea {
  border-color: #C0564F;
  background: #FFF6F5;
  box-shadow: 0 0 0 3px rgba(192, 86, 79, 0.12);
}

.form-group.has-error .radio-option {
  border-color: rgba(192, 86, 79, 0.6);
}

.form-group.has-error {
  animation: fieldShake 0.4s ease;
}

@keyframes fieldShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-3px); }
}

.field-error {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: #B0443D;
  animation: fadeInUp 0.3s ease-out;
}

.field-error::before {
  content: '!';
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: none;
  border-radius: 50%;
  background: #C0564F;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
}

/* ============================================================
   RSVP — MODAL DE CONFIRMACIÓN
   ============================================================ */
.modal-open body {
  overflow: hidden;
}

.rsvp-modal {
  padding: 0;
  border: none;
  background: transparent;
  width: min(92vw, 440px);
  max-width: none;
  max-height: none;
  margin: auto;
  overflow: visible;
  color: var(--ink);
}

.rsvp-modal::backdrop {
  background:
    radial-gradient(ellipse at 50% 30%, rgba(247, 231, 166, 0.25) 0%, transparent 60%),
    rgba(30, 48, 74, 0.62);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: modalFade 0.35s ease;
}

@keyframes modalFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.rsvp-modal-card {
  position: relative;
  border-radius: 20px;
  text-align: center;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(201, 217, 234, 0.7) 0%, transparent 55%),
    linear-gradient(180deg, #FFFFFF 0%, #FFFDF5 60%, #FDF6D8 100%);
  box-shadow: 0 30px 70px rgba(20, 35, 60, 0.45);
  animation: modalIn 0.6s cubic-bezier(.2, .9, .3, 1.15);
  transform-origin: 50% 80%;
}

/* El scroll va dentro para que el marco dorado quede fijo */
.rsvp-modal-scroll {
  max-height: min(90vh, 760px);
  max-height: min(90dvh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 1.8rem 1.4rem 1.4rem;
}

.rsvp-modal.is-closing .rsvp-modal-card {
  animation: modalOut 0.25s ease forwards;
}

.rsvp-modal.is-closing::backdrop {
  opacity: 0;
  transition: opacity 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: perspective(900px) translateY(40px) rotateX(18deg) scale(0.9); }
  to { opacity: 1; transform: none; }
}

@keyframes modalOut {
  to { opacity: 0; transform: translateY(20px) scale(0.95); }
}

.rsvp-modal-close {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 6;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(110, 141, 176, 0.12);
  color: var(--seal-blue-deep);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.3s ease;
}

.rsvp-modal-close:hover {
  background: rgba(110, 141, 176, 0.25);
  transform: rotate(90deg);
}

.rsvp-step {
  position: relative;
  z-index: 1;
}

.rsvp-step-success:not([hidden]) {
  animation: modalIn 0.5s ease;
}

.rsvp-modal-seal {
  --size: 56px;
  margin: 0 auto 0.6rem;
}

.rsvp-modal-pretitle {
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold-deep);
  margin-bottom: 0.3rem;
}

.rsvp-modal-title {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 2.1rem;
  line-height: 1.15;
  color: var(--seal-blue-deep);
  margin-bottom: 0.4rem;
}

.rsvp-modal-text {
  font-size: 0.9rem;
  color: var(--gray-text);
  margin-bottom: 1.2rem;
}

.rsvp-modal-date {
  display: inline-block;
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--seal-blue-deep);
  padding: 0.5rem 1rem;
  margin-bottom: 1.4rem;
  border-top: 1px solid var(--gold);
  border-bottom: 1px solid var(--gold);
}

/* Resumen de datos */
.rsvp-summary {
  text-align: left;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(201, 163, 82, 0.35);
  border-radius: 12px;
  padding: 0.4rem 1rem;
  margin-bottom: 1.4rem;
}

.rsvp-summary-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 0.8rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(201, 163, 82, 0.4);
  animation: fadeInUp 0.4s ease both;
}

.rsvp-summary-row:last-child { border-bottom: none; }
.rsvp-summary-row:nth-child(2) { animation-delay: 0.05s; }
.rsvp-summary-row:nth-child(3) { animation-delay: 0.1s; }
.rsvp-summary-row:nth-child(4) { animation-delay: 0.15s; }
.rsvp-summary-row:nth-child(5) { animation-delay: 0.2s; }
.rsvp-summary-row:nth-child(6) { animation-delay: 0.25s; }
.rsvp-summary-row:nth-child(n+7) { animation-delay: 0.3s; }

.rsvp-summary dt {
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--seal-blue);
  padding-top: 0.15rem;
}

.rsvp-summary dd {
  font-size: 0.9rem;
  color: var(--ink);
  word-break: break-word;
  white-space: pre-line;
}

.rsvp-summary dd.is-yes { color: #2F7A55; font-weight: 500; }
.rsvp-summary dd.is-no { color: #9A5A3A; font-weight: 500; }

/* Botones del modal */
.rsvp-modal-actions {
  display: flex;
  gap: 0.7rem;
  justify-content: center;
}

.rsvp-btn {
  flex: 1;
  max-width: 200px;
  padding: 0.95rem 0.8rem;
  border-radius: 40px;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  white-space: nowrap;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.rsvp-btn-ghost {
  background: transparent;
  color: var(--seal-blue-deep);
  border: 1.5px solid var(--seal-blue);
}

.rsvp-btn-ghost:hover {
  background: rgba(110, 141, 176, 0.1);
  transform: translateY(-2px);
}

.rsvp-btn-primary {
  border: none;
  color: #FDF6D8;
  background: linear-gradient(135deg, var(--seal-blue-deep) 0%, var(--seal-blue) 100%);
  box-shadow: 0 0 0 1.5px var(--gold-light), 0 8px 20px rgba(46, 70, 100, 0.35);
}

.rsvp-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 2px #FFF1C4, 0 12px 26px rgba(46, 70, 100, 0.4), 0 0 20px rgba(247, 231, 166, 0.7);
}

/* Check animado de éxito */
.rsvp-check {
  width: 84px;
  height: 84px;
  margin: 0 auto 1rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #8AA6C4 0%, var(--seal-blue) 55%, var(--seal-blue-deep) 100%);
  box-shadow: 0 10px 26px rgba(46, 70, 100, 0.35), 0 0 0 4px rgba(232, 200, 120, 0.6), 0 0 30px rgba(247, 231, 166, 0.8);
  animation: checkPop 0.6s cubic-bezier(.3, 1.6, .5, 1) both;
}

.rsvp-check svg {
  width: 52px;
  height: 52px;
  fill: none;
  stroke: #FDF6D8;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.rsvp-check circle {
  stroke: rgba(253, 246, 216, 0.5);
  stroke-width: 1.5;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  animation: drawStroke 0.7s ease 0.2s forwards;
}

.rsvp-check path {
  stroke-dasharray: 40;
  stroke-dashoffset: 40;
  animation: drawStroke 0.45s ease 0.6s forwards;
}

@keyframes checkPop {
  from { transform: scale(0) rotate(-45deg); }
  to { transform: scale(1) rotate(0); }
}

@keyframes drawStroke {
  to { stroke-dashoffset: 0; }
}

@media (max-width: 380px) {
  .rsvp-summary-row { grid-template-columns: 1fr; gap: 0.15rem; }
  .rsvp-modal-scroll { padding: 1.6rem 1rem 1.2rem; }
}

/* ============================================================
   RSVP — envío por WhatsApp
   ============================================================ */
.rsvp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  text-decoration: none;
}

.rsvp-btn svg {
  flex: none;
}

.rsvp-modal-text strong {
  color: #1E8E50;
  font-weight: 600;
}

.rsvp-whatsapp-note {
  background: rgba(37, 211, 102, 0.08);
  border: 1px solid rgba(37, 211, 102, 0.35);
  border-radius: 14px;
  padding: 0.9rem 1rem 1rem;
  margin: 0 0 1.2rem;
}

.rsvp-whatsapp-note p {
  font-size: 0.85rem;
  color: var(--ink);
  margin-bottom: 0.8rem;
}

.rsvp-btn-whatsapp {
  max-width: none;
  width: 100%;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #1E9E57 0%, #25D366 100%);
  box-shadow: 0 8px 20px rgba(30, 158, 87, 0.35);
}

.rsvp-btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(30, 158, 87, 0.45);
}
