/* ============ VARIABILE & RESET ============ */
:root {
  --gold: #c2a14e;
  --gold-deep: #a8842f;
  --gold-soft: #d8bd7a;
  --gold-line: #e4d3a3;
  --cream: #fdfaf1;
  --cream-2: #f7efdd;
  --ink: #4a3f28;
  --ink-soft: #6f6244;
  --muted: #9c8f70;
  --serif-body: "Cormorant Garamond", Georgia, serif;
  --script: "Great Vibes", cursive;
  --sans: "Montserrat", system-ui, sans-serif;
  --maxw: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.7;
  font-size: 1.14rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.intro-open { overflow: hidden; height: 100vh; }
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ============ INTRO: PLIC + SIGILIU ============ */
.envelope-intro {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(120% 90% at 50% 22%, #fbf3dc 0%, #f2e2b8 42%, #e6cf94 100%);
  transition: opacity .8s ease;
}
.envelope-intro.opening { pointer-events: none; }
.envelope-intro.done { opacity: 0; visibility: hidden; }

.env-paper {
  position: relative;
  width: min(86vw, 460px);
  aspect-ratio: 3 / 2;
  background: linear-gradient(160deg, #fffdf6, #f3e8cc);
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  box-shadow: 0 30px 70px -30px rgba(120, 90, 20, .55), inset 0 0 0 6px rgba(255,255,255,.4);
}
.env-seam {
  position: absolute; top: 0; width: 0; height: 0;
  border-style: solid;
}
.env-seam-left {
  left: 0;
  border-width: 0 0 calc(66.66% * 0.5 * 3 / 3) 50%;
  border-color: transparent transparent transparent #ecdcb4;
  height: 100%; border-width: 0; background: linear-gradient(135deg, #efe0bb 50%, transparent 50%);
  width: 50%; clip-path: polygon(0 0, 0 100%, 100% 50%);
  opacity: .8;
}
.env-seam-right {
  right: 0; left: auto;
  height: 100%; background: linear-gradient(-135deg, #efe0bb 50%, transparent 50%);
  width: 50%; clip-path: polygon(100% 0, 100% 100%, 0 50%);
  opacity: .8;
}
.env-flap-top {
  position: absolute; top: 0; left: 0; right: 0;
  height: 50%;
  background: linear-gradient(180deg, #f6ead0, #ead9b2);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  transform-origin: top center;
  transition: transform 2.4s cubic-bezier(.6, 0, .2, 1);
  z-index: 4;
  box-shadow: 0 4px 10px -4px rgba(120, 90, 20, .3);
}
.envelope-intro.opening .env-flap-top { transform: rotateX(180deg); z-index: 1; }

.wax-seal {
  position: absolute; z-index: 6;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  background: none; border: 0; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  filter: drop-shadow(0 10px 18px rgba(120, 90, 20, .45));
  transition: transform .5s ease, opacity .5s ease;
  animation: sealPulse 2.6s ease-in-out infinite;
}
@keyframes sealPulse {
  0%, 100% { transform: translate(-50%, -50%) scale(1); }
  50% { transform: translate(-50%, -50%) scale(1.05); }
}
.envelope-intro.opening .wax-seal { opacity: 0; transform: translate(-50%, -50%) scale(.6); animation: none; }
.wax-blob { filter: drop-shadow(0 2px 2px rgba(0,0,0,.15)); }
.wax-hint {
  font-family: var(--sans); font-size: .72rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold-deep);
}

/* ============ AUDIO TOGGLE ============ */
.audio-toggle {
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid var(--gold-line);
  background: rgba(255,255,255,.7); color: var(--gold-deep);
  display: grid; place-items: center; cursor: pointer;
  backdrop-filter: blur(4px);
}
.intro-audio { position: absolute; top: 18px; right: 18px; z-index: 8; }
.floating-audio {
  position: fixed; bottom: 18px; right: 18px; z-index: 50;
  box-shadow: 0 8px 20px -8px rgba(120,90,20,.5);
}
.audio-toggle .icon-sound { display: none; }
.audio-toggle.playing .icon-sound { display: block; }
.audio-toggle.playing .icon-muted { display: none; }

/* ============ PAGE ============ */
.page { opacity: 0; transition: opacity 1s ease; position: relative; background: var(--cream); }
.page.visible { opacity: 1; }

/* Cerul auriu cu soare — se estompează treptat spre crem */
.sky {
  position: absolute; top: 0; left: 0; right: 0; height: 1100px;
  z-index: 0; overflow: hidden; pointer-events: none;
  background:
    radial-gradient(150% 82% at 50% -6%,
      #ffffff 0%,
      #fff7db 7%,
      #ffe7a0 18%,
      #f2ca6a 32%,
      #e6b84c 44%,
      #ecc36a 56%,
      #f5e0ac 74%,
      var(--cream) 100%);
}
/* mase de nori calzi în lateral */
.sky::before, .sky::after {
  content: ""; position: absolute; top: 2%; width: 80%; height: 52%;
  background: radial-gradient(58% 58% at 50% 42%, rgba(240,180,80,.7), transparent 72%);
  filter: blur(34px); opacity: .85;
}
.sky::before { left: -22%; }
.sky::after  { right: -22%; }

/* miezul strălucitor al soarelui */
.sky-sun {
  position: absolute; top: -8%; left: 50%; transform: translateX(-50%);
  width: 52vw; height: 52vw; max-width: 560px; max-height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle,
    #ffffff 0%,
    rgba(255,255,255,.98) 16%,
    rgba(255,246,208,.85) 34%,
    rgba(255,230,165,.42) 55%,
    transparent 72%);
  filter: blur(1px);
}
/* razele de soare — difuze, ca să nu deranjeze cititul */
.sky-rays {
  position: absolute; top: -8%; left: 50%; transform: translateX(-50%);
  width: 240vw; height: 1100px;
  background:
    repeating-conic-gradient(from 0deg at 50% 0%,
      rgba(255,255,255,0)    0deg,
      rgba(255,255,255,.30)  2deg,
      rgba(255,255,255,0)    8.5deg);
  opacity: .5; filter: blur(2.5px);
}
/* văl blând care liniștește fundalul sub text, pentru lizibilitate */
.sky-veil {
  position: absolute; top: 0; left: 0; right: 0; height: 1100px;
  z-index: 0; pointer-events: none;
  background:
    radial-gradient(120% 60% at 50% 34%, rgba(255,251,240,.55), transparent 70%);
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; position: relative; z-index: 1; }

/* ============ REVEAL ============ */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .9s ease, transform .9s ease; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ============ HERO ============ */
.hero { text-align: center; padding: 74px 0 30px; }
.names {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3.4rem, 12vw, 6.6rem);
  color: #6f5017;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(255,255,255,.7), 0 2px 16px rgba(255,244,205,.9);
}
.names .amp { font-size: .7em; color: #9a7526; }

.poem { max-width: 640px; margin: 34px auto 0; }
.stanza {
  color: #4a3a1c;
  font-size: 1.18rem;
  margin-bottom: 20px;
  font-style: italic;
  text-shadow: 0 1px 2px rgba(255,252,242,.85);
}
.stanza em { font-style: normal; color: #2f2410; font-weight: 600; }

.script-blessing {
  font-family: var(--script);
  font-size: clamp(1.8rem, 6vw, 2.9rem);
  color: #6f5017;
  line-height: 1.35;
  margin-top: 30px;
  text-shadow: 0 1px 2px rgba(255,252,242,.8);
}

/* ============ HEART DIVIDER ============ */
.heart-divider {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin: 46px auto; max-width: 420px;
}
.hd-line { flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-line), transparent); }

/* ============ FAMILY BOX ============ */
.family-box {
  border: 1px solid var(--gold-line);
  outline: 1px solid var(--gold-line); outline-offset: 6px;
  border-radius: 6px;
  background: rgba(255,255,255,.55);
  padding: 40px 26px;
  max-width: 900px; margin: 0 auto;
}
.fb-inner { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr; align-items: center; gap: 0; }
.fb-col { text-align: center; padding: 6px 16px; }
.fb-heart { margin: 0 auto 10px; display: block; }
.fb-label {
  font-family: var(--sans); font-size: .74rem; letter-spacing: .22em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 8px;
}
.fb-names { font-size: 1.4rem; color: var(--ink); font-weight: 500; line-height: 1.35; }
.fb-names.big { font-family: var(--script); font-size: 2rem; color: var(--gold-deep); font-weight: 400; }
.fb-note { font-size: 1rem; font-style: italic; color: var(--ink-soft); margin-top: 10px; }
.fb-sep { width: 1px; align-self: stretch; background: linear-gradient(180deg, transparent, var(--gold-line), transparent); }

/* ============ EVENTS ============ */
.events { padding: 20px 0; }
.events-title {
  text-align: center; font-weight: 500;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  color: var(--gold-deep); margin-bottom: 40px;
  display: flex; align-items: center; justify-content: center; gap: 16px;
}
.et-flourish { color: var(--gold); font-size: .8em; }

.events-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.event {
  text-align: center;
  background: rgba(255,255,255,.6);
  border: 1px solid var(--gold-line);
  border-radius: 8px;
  padding: 30px 20px;
  box-shadow: 0 20px 40px -30px rgba(120,90,20,.5);
}
.ev-icon {
  width: 74px; height: 74px; margin: 0 auto 16px;
  border: 1px solid var(--gold-line); border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle, #fffdf6, #f7efdd);
}
.ev-name { font-size: 1.5rem; color: var(--ink); font-weight: 600; margin-bottom: 10px; }
.ev-date { font-family: var(--sans); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep); }
.ev-time { font-size: 1.5rem; color: var(--gold-deep); font-weight: 500; margin: 4px 0 12px; }
.ev-place { color: var(--ink-soft); font-size: 1.05rem; line-height: 1.5; }
.ev-map {
  display: inline-block; margin-top: 16px;
  font-family: var(--sans); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold-deep); text-decoration: none;
  border-bottom: 1px solid var(--gold-line); padding-bottom: 3px;
}
.ev-map:hover { color: var(--gold); }

/* ============ CLOSING ============ */
.closing-script {
  text-align: center; font-family: var(--script);
  font-size: clamp(2.4rem, 9vw, 4rem);
  color: var(--gold-deep); margin: 10px 0 30px;
}

/* ============ RSVP ============ */
.rsvp { padding: 30px 0 20px; }
.rsvp-title {
  text-align: center; font-weight: 500;
  font-size: clamp(1.8rem, 6vw, 2.6rem);
  color: var(--gold-deep); margin-bottom: 10px;
}
.rsvp-sub { text-align: center; color: var(--ink-soft); max-width: 520px; margin: 0 auto 30px; }
.rsvp-sub strong { color: var(--gold-deep); }

.rsvp-card {
  max-width: 560px; margin: 0 auto;
  background: rgba(255,255,255,.7);
  border: 1px solid var(--gold-line);
  border-radius: 12px;
  padding: 30px 26px;
  box-shadow: 0 30px 60px -40px rgba(120,90,20,.5);
}
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.field { margin-bottom: 20px; }
.lbl {
  display: block; font-family: var(--sans); font-size: .74rem;
  letter-spacing: .16em; text-transform: uppercase; color: var(--gold-deep);
  margin-bottom: 8px;
}
input[type="text"], input[type="tel"], textarea {
  width: 100%; font-family: var(--serif-body); font-size: 1.1rem;
  color: var(--ink); background: #fffdf7;
  border: 1px solid var(--gold-line); border-radius: 8px;
  padding: 12px 14px; outline: none; transition: border-color .2s;
}
input:focus, textarea:focus { border-color: var(--gold); }
input.invalid { border-color: #c0392b; background: #fdf3f2; }
textarea { resize: vertical; }

.pill-group { display: flex; gap: 12px; flex-wrap: wrap; }
.pill {
  flex: 1; min-width: 140px; cursor: pointer;
  border: 1px solid var(--gold-line); border-radius: 30px;
  padding: 12px 18px; text-align: center; background: #fffdf7;
  transition: all .2s;
}
.pill input { position: absolute; opacity: 0; }
.pill span { font-family: var(--sans); font-size: .9rem; color: var(--ink-soft); }
.pill:has(input:checked) { background: var(--gold); border-color: var(--gold-deep); }
.pill:has(input:checked) span { color: #fff; }

.da-fields { border-top: 1px solid var(--gold-line); padding-top: 20px; margin-top: 4px; }

.stepper {
  display: inline-flex; align-items: center;
  border: 1px solid var(--gold-line); border-radius: 30px; overflow: hidden;
  background: #fffdf7;
}
.st-btn {
  width: 44px; height: 44px; border: 0; background: none;
  font-size: 1.4rem; color: var(--gold-deep); cursor: pointer;
}
.st-btn:hover { background: var(--cream-2); }
.stepper input {
  width: 52px; text-align: center; border: 0; background: none;
  font-family: var(--serif-body); font-size: 1.2rem; color: var(--ink);
  -moz-appearance: textfield;
}
.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.menu-rows { display: flex; flex-direction: column; gap: 12px; }
.menu-row { display: flex; align-items: center; justify-content: space-between; }
.menu-name { font-size: 1.1rem; color: var(--ink); }

.submit-btn {
  width: 100%; margin-top: 8px;
  font-family: var(--sans); font-size: .9rem; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border: 0; border-radius: 30px; padding: 15px;
  transition: filter .2s;
}
.submit-btn:hover { filter: brightness(1.06); }
.submit-btn:disabled { opacity: .6; cursor: default; }
.form-status { text-align: center; margin-top: 14px; font-size: .95rem; color: var(--ink-soft); }
.form-status.error { color: #c0392b; }

/* ============ FOOTER ============ */
.footer { text-align: center; padding: 50px 0 60px; }
.footer-names { font-family: var(--script); font-size: 2.6rem; color: var(--gold-deep); }
.footer-contact { font-family: var(--sans); font-size: .82rem; color: var(--muted); margin-top: 8px; letter-spacing: .04em; }
.footer-contact a { color: var(--gold-deep); text-decoration: none; }

/* ============ SUCCESS OVERLAY ============ */
.success-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(74, 63, 40, .55); backdrop-filter: blur(4px);
}
.success-overlay[hidden] { display: none; }
.success-card {
  background: var(--cream); border: 1px solid var(--gold-line);
  border-radius: 14px; padding: 40px 34px; text-align: center; max-width: 380px;
  box-shadow: 0 30px 70px -30px rgba(120,90,20,.6);
}
.success-check { margin: 0 auto 16px; width: 56px; height: 56px; }
.success-check circle { stroke: var(--gold); stroke-width: 2; }
.success-check path { stroke: var(--gold-deep); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.success-card h3 { font-family: var(--script); font-size: 2.4rem; color: var(--gold-deep); font-weight: 400; }
.success-card p { color: var(--ink-soft); margin: 8px 0 22px; }
.success-card strong { color: var(--gold-deep); }
.close-success {
  font-family: var(--sans); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  color: #fff; cursor: pointer;
  background: linear-gradient(135deg, var(--gold), var(--gold-deep));
  border: 0; border-radius: 30px; padding: 12px 34px;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 760px) {
  .fb-inner { grid-template-columns: 1fr; gap: 24px; }
  .fb-sep { width: auto; height: 1px; background: linear-gradient(90deg, transparent, var(--gold-line), transparent); }
  .events-grid { grid-template-columns: 1fr; }
  .hero { padding: 60px 0 20px; }
}
