:root {
  --bg-pink: #fbe4e6;
  --bg-pink-2: #f7d9dc;
  --card-bg: #ffffff;
  --lilac: #b89ce8;
  --lilac-soft: #d8c7f2;
  --rose: #c6747f;
  --rose-dark: #b85c66;
  --gold: #c9a86a;
  --text-dark: #5a4a4a;
  --text-soft: #8a7676;
  --font-script: 'Great Vibes', cursive;
  --font-display: 'Playfair Display', serif;
  --font-body: 'Cormorant Garamond', serif;
  --max-w: 480px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: #e8cdd0;          /* fondo exterior más oscuro */
  color: var(--text-dark);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Wrapper central que simula el "teléfono" */
#envelope-screen,
#main-content {
  width: 100%;
  max-width: var(--max-w);
}

/* ============ BOTÓN MÚSICA ============ */
#music-toggle {
  position: fixed;
  top: 14px;
  right: 14px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--lilac);
  background: rgba(255,255,255,0.9);
  color: var(--lilac);
  font-size: 1.1rem;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
#music-toggle.playing .music-icon {
  animation: spin 4s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ PANTALLA SOBRE ============ */
#envelope-screen {
  min-height: 100vh;
  background: linear-gradient(180deg, var(--bg-pink) 0%, var(--bg-pink-2) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 24px 16px 40px;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#envelope-screen.hidden {
  opacity: 0; visibility: hidden;
  position: fixed; pointer-events: none;
}

/* florales laterales del sobre */
.bg-floral {
  position: absolute;
  width: 110px;
  height: 100%;
  top: 0;
  opacity: 0.5;
  pointer-events: none;
}
.bg-floral-l { left: 0; }
.bg-floral-r { right: 0; }

.bg-butterfly {
  position: absolute;
  width: 55px; height: 46px;
  top: 50px; right: 130px;
  opacity: 0.55;
  animation: flutter 4s ease-in-out infinite;
  pointer-events: none;
}

.envelope-wrap {
  position: relative;
  width: min(320px, 90%);
  text-align: center;
  z-index: 2;
}

.invite-card {
  background: var(--card-bg);
  border-radius: 24px 24px 20px 20px;
  padding: 36px 24px 60px;
  box-shadow: 0 14px 40px rgba(184,156,232,0.3);
  position: relative;
  z-index: 2;
  animation: float 5s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

.eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  color: var(--gold);
  font-weight: 600;
  margin-bottom: 10px;
}
.title-script {
  font-family: var(--font-display);
  font-size: 1.1rem;
  letter-spacing: 0.22em;
  color: var(--lilac);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 6px;
}
.tiara-svg {
  display: block;
  width: 100px; height: 48px;
  margin: 4px auto 10px;
}
.name-script {
  font-family: var(--font-script);
  font-size: 3rem;
  color: var(--rose);
  line-height: 1.25;
}

/* sobre */
.envelope {
  position: relative;
  width: 100%;
  height: 190px;
  margin-top: -44px;
  z-index: 1;
}
.envelope-back {
  position: absolute;
  inset: 36px 0 0 0;
  background: var(--lilac-soft);
  border-radius: 0 0 16px 16px;
}
.envelope-flap {
  position: absolute;
  top: 36px; left: 0; right: 0;
  height: 96px;
  background: var(--lilac);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
.envelope-front-left,
.envelope-front-right {
  position: absolute;
  bottom: 0; width: 50%; height: 115px;
  background: var(--lilac-soft);
}
.envelope-front-left  { left: 0;  clip-path: polygon(0 0, 100% 100%, 0 100%); }
.envelope-front-right { right: 0; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.wax-seal {
  position: absolute;
  bottom: 22px; left: 50%;
  transform: translateX(-50%);
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--rose);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(198,116,127,0.5);
  z-index: 3;
}
.bow-icon { width: 30px; height: 30px; }

#open-btn {
  margin-top: 22px;
  background: var(--lilac);
  color: #fff;
  border: none;
  font-family: var(--font-display);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  padding: 12px 34px;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(184,156,232,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
}
#open-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(184,156,232,0.55); }

/* ============ CONTENIDO PRINCIPAL ============ */
#main-content[hidden] { display: none; }

.panel {
  position: relative;
  padding: 60px 20px;
  text-align: center;
  overflow: hidden;
  width: 100%;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.panel.visible { opacity: 1; transform: translateY(0); }
.panel:nth-child(odd)  { background: var(--bg-pink); }
.panel:nth-child(even) { background: var(--bg-pink-2); }

@media (prefers-reduced-motion: reduce) {
  .panel, .invite-card { transition: none; animation: none; }
}

/* florales laterales en paneles */
.panel-floral {
  position: absolute;
  pointer-events: none;
  z-index: 0;
  top: 0;
  height: 100%;
  width: 90px;
  opacity: 0.5;
}
.pf-tl { left: 0; }
.pf-tr { right: 0; }

/* esquinas inferiores */
.pf-bl {
  position: absolute;
  width: 80px; height: 80px;
  bottom: 8px; left: 8px;
  opacity: 0.38;
  transform: rotate(90deg) scaleX(-1);
  z-index: 0; pointer-events: none;
}
.pf-br, .pf-br-peony {
  position: absolute;
  width: 95px; height: 95px;
  bottom: 8px; right: 8px;
  opacity: 0.4;
  z-index: 0; pointer-events: none;
}

.panel-butterfly {
  position: absolute;
  width: 52px; height: 44px;
  top: 18px; right: 54px;
  opacity: 0.5;
  animation: flutter 5s ease-in-out infinite;
  pointer-events: none; z-index: 0;
}
.rsvp-butterfly {
  top: auto; bottom: 130px; right: 16px;
  animation-delay: 1.5s;
}
@keyframes flutter {
  0%,100% { transform: translateY(0) rotate(-5deg); }
  50%      { transform: translateY(-7px) rotate(5deg); }
}

/* z-index para contenido sobre florales */
.card, .detail-card, .countdown, .section-script,
.kicker, .big-number, .hero-text, .script-line,
.gallery, .message-card, .rsvp-title, .rsvp-text,
.rsvp-form, #rsvp-confirm-msg, .final-name, .tiara-msg,
h2.section-script {
  position: relative; z-index: 1;
}

/* ============ HERO ============ */
.kicker {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--rose-dark);
  font-weight: 600;
  letter-spacing: 0.03em;
  max-width: 280px;
  margin: 0 auto 20px;
  line-height: 1.5;
}
.big-number {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 24px;
  position: relative; z-index: 1;
}
.num {
  font-family: var(--font-display);
  font-size: clamp(4rem, 20vw, 7rem);
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
  text-align: left;
}
.silhouette {
  width: 75px; height: 115px;
  background: var(--lilac);
  border-radius: 38px 38px 8px 8px / 42px 42px 16px 16px;
  position: relative;
  opacity: 0.85;
}
.silhouette::before {
  content: "";
  position: absolute;
  top: -26px; left: 14px;
  width: 44px; height: 44px;
  background: var(--lilac);
  border-radius: 50%;
}
.hero-text {
  max-width: 300px;
  margin: 0 auto 18px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--rose-dark);
}
.script-line {
  font-family: var(--font-script);
  font-size: 1.9rem;
  color: var(--lilac);
}

/* ============ TARJETAS ============ */
.card {
  background: var(--card-bg);
  border: 1px solid #ece0e2;
  border-radius: 24px;
  padding: 44px 24px;
  max-width: 340px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  box-shadow: 0 8px 28px rgba(0,0,0,0.05);
}
.card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid var(--gold);
  border-radius: 16px;
  opacity: 0.3;
  pointer-events: none;
}

.card-tiara-svg {
  display: block;
  width: 100px; height: 48px;
  margin: 0 auto 10px;
}
.card-eyebrow {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.3em;
  color: var(--rose-dark);
  font-weight: 700;
  margin-bottom: 4px;
}
.card-name {
  font-family: var(--font-script);
  font-size: 2.8rem;
  color: var(--rose);
  margin: 8px 0;
}
.card-sub {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin-bottom: 16px;
}
.divider { margin: 16px 0; }
.bow-divider-svg { display: block; margin: 0 auto; }
.card-date {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--rose-dark);
  letter-spacing: 0.06em;
}
.day-circle {
  display: inline-block;
  background: var(--bg-pink);
  color: var(--rose-dark);
  font-weight: 700;
  padding: 3px 13px;
  border-radius: 50px;
  margin: 0 5px;
}

/* moños SVG */
.bow-top { margin-bottom: 12px; display: flex; justify-content: center; }
.bow-corner { position: absolute; top: 6px; }
.bow-left  { left: 6px; }
.bow-right { right: 6px; }

/* ============ CONTADOR ============ */
.section-script {
  font-family: var(--font-script);
  font-size: 2.6rem;
  color: var(--lilac);
  margin-bottom: 24px;
}
.countdown {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card-bg);
  border: 1px solid var(--text-dark);
  border-radius: 16px;
  padding: 20px 12px;
  max-width: 340px;
  margin: 0 auto;
  flex-wrap: wrap;
  position: relative; z-index: 1;
}
.time-block {
  display: flex; flex-direction: column; align-items: center;
  min-width: 55px;
}
.time-block span {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 7vw, 2.4rem);
  font-weight: 700;
  color: var(--rose);
}
.time-block:last-child span { color: var(--lilac); }
.time-block label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--text-soft);
  text-transform: uppercase;
  margin-top: 3px;
}
.sep { font-family: var(--font-display); font-size: 1.8rem; color: var(--rose); font-weight: 300; }
.countdown-note {
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--text-soft);
  font-style: italic;
  position: relative; z-index: 1;
}

/* ============ PADRES / PADRINOS ============ */
.family-label {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--rose-dark);
  font-weight: 600;
}
.family-script {
  font-family: var(--font-script);
  font-size: 2.4rem;
  color: var(--rose);
  margin-bottom: 8px;
}
.family-script-small {
  font-family: var(--font-script);
  font-size: 1.8rem;
  color: var(--rose);
  margin-top: 8px;
}
.family-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-dark);
  margin: 5px 0;
}
.amp {
  display: block;
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--lilac);
  margin: 1px 0;
}
.family-text {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--rose-dark);
  margin: 14px 0 0;
}
.ornament { margin: 20px 0; }
.ornament svg { display: block; margin: 0 auto; }

/* ============ DETALLES ============ */
.detail-card {
  background: var(--card-bg);
  border: 1px solid var(--gold);
  border-radius: 20px;
  padding: 30px 20px;
  max-width: 340px;
  margin: 0 auto 22px;
  position: relative; z-index: 1;
}
.detail-card:last-child { margin-bottom: 0; }
.detail-title {
  font-family: var(--font-script);
  font-size: 2rem;
  color: var(--text-dark);
  margin-bottom: 12px;
}
.detail-icon { color: var(--text-dark); margin: 0 auto 10px; display: flex; justify-content: center; }
.detail-time { font-family: var(--font-display); font-size: 1rem; font-weight: 700; color: var(--rose-dark); margin-bottom: 5px; }
.detail-place { font-family: var(--font-display); font-size: 1.1rem; font-weight: 700; color: var(--text-dark); margin-bottom: 5px; }
.detail-address { font-size: 0.9rem; color: var(--text-soft); line-height: 1.6; margin-bottom: 18px; }
.btn-pill {
  display: inline-block;
  background: var(--rose);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  padding: 11px 28px;
  border-radius: 50px;
  font-size: 0.82rem;
  transition: background 0.2s, transform 0.2s;
}
.btn-pill:hover { background: var(--rose-dark); transform: translateY(-2px); }

/* ============ GALERÍA + MENSAJE ============ */
.vertical-label {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.4em;
  color: var(--text-soft);
  writing-mode: vertical-rl;
  position: absolute;
  left: 6px; top: 50%;
  transform: translateY(-50%) rotate(180deg);
  opacity: 0.5; z-index: 1;
}
.gallery {
  display: flex; flex-direction: column; gap: 14px;
  max-width: 210px;
  margin: 0 auto 22px;
  position: relative; z-index: 1;
}
.photo-frame {
  background: var(--card-bg);
  padding: 8px;
  border-radius: 6px;
  box-shadow: 0 5px 16px rgba(0,0,0,0.06);
}
.photo-placeholder {
  height: 180px;
  background: linear-gradient(135deg, #ece0e2, #f7d9dc);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-soft);
  font-family: var(--font-display);
  letter-spacing: 0.1em;
  font-size: 0.85rem;
}
.tiara-msg {
  display: block;
  width: 90px; height: 44px;
  margin: 0 auto 14px;
  opacity: 0.65;
  position: relative; z-index: 1;
}
.message-card {
  background: var(--card-bg);
  border-radius: 20px;
  padding: 30px 22px;
  max-width: 340px;
  margin: 0 auto;
  box-shadow: 0 8px 26px rgba(0,0,0,0.05);
  position: relative; z-index: 1;
}
.message-text {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--rose-dark);
  font-style: italic;
}

/* ============ REGALO ============ */
.gift-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--lilac);
  line-height: 1.4;
  margin-bottom: 14px;
  position: relative; z-index: 1;
}
.gift-text { font-size: 0.95rem; color: var(--rose-dark); margin-bottom: 8px; position: relative; z-index: 1; }
.gift-highlight {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--lilac);
  letter-spacing: 0.04em;
  margin-bottom: 18px;
  position: relative; z-index: 1;
}
.envelope-icon { color: var(--rose-dark); display: flex; justify-content: center; position: relative; z-index: 1; }

/* ============ RSVP ============ */
.rsvp-title {
  font-family: var(--font-script);
  font-size: 2.4rem;
  color: var(--rose);
  margin-bottom: 14px;
}
.rsvp-text { font-size: 0.95rem; color: var(--text-dark); line-height: 1.7; margin-bottom: 22px; }
.rsvp-envelope-deco { margin: 0 auto 14px; display: flex; justify-content: center; }
.rsvp-form { display: flex; flex-direction: column; gap: 12px; }
.rsvp-form input,
.rsvp-form select {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 11px 15px;
  border: 1px solid #ddd0d2;
  border-radius: 12px;
  background: #fdf8f9;
  color: var(--text-dark);
}
.rsvp-form input:focus, .rsvp-form select:focus { outline: 2px solid var(--lilac); outline-offset: 1px; }
.btn-confirm { border: none; cursor: pointer; margin-top: 5px; font-size: 0.95rem; }
#rsvp-confirm-msg { margin-top: 18px; color: var(--rose-dark); font-weight: 600; position: relative; z-index: 1; }

.final-name {
  margin-top: 44px;
  position: relative;
  font-family: var(--font-script);
  font-size: clamp(2.8rem, 13vw, 4.5rem);
  color: var(--rose);
  z-index: 1;
}
.final-15 {
  position: absolute;
  font-family: var(--font-display);
  font-size: 0.5em;
  color: transparent;
  -webkit-text-stroke: 1px var(--rose);
  bottom: -8px;
  margin-left: 5px;
}

/* ============ FOOTER ============ */
.footer {
  background: var(--card-bg);
  padding: 26px 20px;
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  width: 100%;
  max-width: var(--max-w);
}
.footer-floral-l, .footer-floral-r { width: 52px; height: 52px; opacity: 0.4; }
.footer-floral-r { transform: scaleX(-1); }
.footer-bow { opacity: 0.65; }

a:focus-visible, button:focus-visible { outline: 2px solid var(--lilac); outline-offset: 2px; }
