/* ============================================================
   Morgane & Paul — RSVP page
   Builds on css/styles.css (variables, .btn, .language-toggle)
   ============================================================ */

.rsvp-page {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background:
    radial-gradient(ellipse 80% 55% at 50% 0%, rgba(92,16,39,.16) 0%, rgba(92,16,39,0) 70%),
    linear-gradient(180deg, var(--cream) 0%, var(--cream-deep) 100%);
}

/* ---------- Top bar ---------- */
.rsvp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding:
    calc(18px + env(safe-area-inset-top, 0px))
    clamp(16px, 4vw, 48px)
    18px;
}
.rsvp-topbar__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--ink);
}
.rsvp-topbar__brand span { color: var(--gold); }
.rsvp-topbar__mark { color: var(--sage); }
.rsvp-topbar__right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.rsvp-topbar__back {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease), color .3s var(--ease);
  line-height: 1.35;
  text-align: right;
  max-width: 11rem;
}
.rsvp-topbar__back:hover { color: var(--sage-deep); border-color: var(--sage-deep); }

/* The shared toggle is built for the dark hero nav — restyle for cream */
.rsvp-page .language-toggle {
  border-color: var(--line);
  color: var(--ink-soft);
  background: rgba(255, 250, 244, .7);
}

/* ---------- Layout ---------- */
.rsvp-main {
  flex: 1;
  width: 100%;
  max-width: 660px;
  margin: 0 auto;
  padding: clamp(8px, 2vw, 24px) clamp(20px, 5vw, 24px) clamp(48px, 8vw, 88px);
}

.rsvp-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(28px, 6vw, 56px);
  box-shadow: 0 26px 70px rgba(43, 23, 27, .10);
}

.rsvp-card__head { text-align: center; margin-bottom: clamp(26px, 5vw, 40px); }
.rsvp-mark {
  width: 40px;
  height: 34px;
  margin: 0 auto 12px;
  color: var(--sage);
}
.rsvp-eyebrow {
  font-size: 0.74rem;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
}
.rsvp-title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 7vw, 3.2rem);
  line-height: 1.05;
}
.rsvp-subtitle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.rsvp-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }
.rsvp-deadline {
  margin-top: 16px;
  color: var(--ink-soft);
  font-size: 0.95rem;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
}

/* ---------- Form basics ---------- */
.rsvp-form { animation: rsvpFade .5s var(--ease) both; }
@keyframes rsvpFade { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.rsvp-lead {
  color: var(--ink-soft);
  text-align: center;
  margin-bottom: 26px;
}

.rsvp-field { margin-bottom: 20px; }
.rsvp-field label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 8px;
}
.rsvp-field input,
.rsvp-field select,
.rsvp-field textarea {
  width: 100%;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 300;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease), background .3s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.rsvp-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23614a4f' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 42px;
}
.rsvp-field textarea { resize: vertical; min-height: 62px; }
.rsvp-field input:focus,
.rsvp-field select:focus,
.rsvp-field textarea:focus {
  outline: none;
  background: var(--white);
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(127, 23, 52, .12);
}
.rsvp-field input::placeholder,
.rsvp-field textarea::placeholder { color: #a6968f; }

/* ---------- Radio groups ---------- */
.rsvp-group { border: 0; margin-bottom: 24px; }
.rsvp-group legend {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 12px;
  line-height: 1.45;
  padding: 0;
}
.rsvp-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rsvp-choice {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 56px;
  padding: 14px 16px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--serif);
  font-size: clamp(1rem, 3.8vw, 1.08rem);
  line-height: 1.25;
  color: var(--ink);
  transition: border-color .3s var(--ease), background .3s var(--ease), transform .3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}
.rsvp-choice:hover { transform: translateY(-2px); border-color: var(--gold); }
.rsvp-choice input {
  position: absolute;
  opacity: 0;
  width: 0; height: 0;
}
.rsvp-choice:has(input:checked),
.rsvp-choice.is-selected {
  background: var(--sage-deep);
  border-color: var(--sage-deep);
  color: #fff;
}
.rsvp-choice input:focus-visible + span {
  outline: 2px solid var(--gold);
  outline-offset: 6px;
}

/* Meal choices carry a full plated-dinner description rather than a short
   word, so they get their own single-column, left-aligned layout instead
   of the centered two-up grid used for Yes/No-style choices. */
.rsvp-choices--meal { grid-template-columns: 1fr; gap: 10px; }
.rsvp-choice--meal {
  justify-content: flex-start;
  text-align: left;
  font-family: var(--sans);
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 14px 18px;
}

/* ---------- Conditional blocks ---------- */
.rsvp-conditional { animation: rsvpFade .45s var(--ease) both; }

.rsvp-plusone,
.rsvp-songs {
  margin-top: 28px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.rsvp-songs .rsvp-field { margin-bottom: 0; }
.rsvp-songs .rsvp-hint { margin-top: 10px; }

/* ---------- Found-guest banner ---------- */
.rsvp-found {
  text-align: center;
  padding: 18px 20px;
  margin-bottom: 30px;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.rsvp-found__greeting {
  font-family: var(--serif);
  font-size: 1.35rem;
  color: var(--ink);
}
.rsvp-found__change {
  margin-top: 6px;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border-bottom: 1px solid transparent;
  transition: color .3s var(--ease), border-color .3s var(--ease);
}
.rsvp-found__change:hover { color: var(--sage-deep); border-color: var(--sage-deep); }

/* ---------- Messages ---------- */
.rsvp-message {
  margin: 4px 0 18px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  animation: rsvpFade .3s var(--ease) both;
}
.rsvp-message--error {
  background: rgba(127, 23, 52, .07);
  border: 1px solid rgba(127, 23, 52, .25);
  color: var(--sage-deep);
}
.rsvp-notice {
  padding: 14px 16px;
  background: rgba(92, 16, 39, .12);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  margin-bottom: 20px;
}

.rsvp-banner {
  padding: 14px 16px;
  border-radius: var(--radius);
  margin-bottom: 22px;
  font-size: 0.95rem;
  line-height: 1.55;
}
.rsvp-banner--demo {
  background: rgba(92, 16, 39, .18);
  border: 1px solid var(--gold);
  color: var(--ink);
}
.rsvp-banner--warn {
  background: rgba(127, 23, 52, .08);
  border: 1px solid rgba(127, 23, 52, .35);
  color: var(--sage-deep);
}

/* ---------- Buttons ---------- */
.rsvp-submit {
  width: 100%;
  margin-top: 8px;
  text-align: center;
  border: 0;
}
.rsvp-submit[disabled] { opacity: .6; cursor: progress; transform: none; box-shadow: none; }

.rsvp-hint {
  margin-top: 14px;
  text-align: center;
  font-size: 0.86rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ---------- Success ---------- */
.rsvp-success { text-align: center; animation: rsvpFade .55s var(--ease) both; }
.rsvp-success__mark {
  font-size: 2.4rem;
  color: var(--gold);
  margin-bottom: 14px;
}
.rsvp-success__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.7rem, 4.5vw, 2.3rem);
  line-height: 1.15;
  margin-bottom: 14px;
}
.rsvp-success__text { color: var(--ink-soft); margin-bottom: 30px; }

/* ---------- Full-page wait overlay ---------- */
.rsvp-wait {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(43, 23, 27, .45);
  backdrop-filter: blur(4px);
}
.rsvp-wait[hidden] { display: none; }
.rsvp-wait__card {
  width: min(420px, 100%);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px 28px 32px;
  text-align: center;
  box-shadow: 0 26px 70px rgba(43, 23, 27, .18);
}
.rsvp-wait__spin {
  width: 36px;
  height: 36px;
  margin: 0 auto 18px;
  border: 2px solid var(--line);
  border-top-color: var(--sage-deep);
  border-radius: 50%;
  animation: rsvpSpin .8s linear infinite;
}
.rsvp-wait__title {
  font-family: var(--serif);
  font-size: 1.55rem;
  margin-bottom: 8px;
}
.rsvp-wait__text {
  color: var(--ink-soft);
  font-size: 0.95rem;
  line-height: 1.55;
}
@keyframes rsvpSpin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  .rsvp-wait__spin { animation: none; border-top-color: var(--line); }
}

/* ---------- Footer contact ---------- */
.rsvp-contact {
  margin-top: 26px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--ink-soft);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.rsvp-contact a { color: var(--sage-deep); border-bottom: 1px solid var(--line); }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .rsvp-main { padding-left: 16px; padding-right: 16px; }
  .rsvp-card { padding: 24px 18px; }
  .rsvp-subtitle { letter-spacing: 0.14em; gap: 8px; }
  .rsvp-found__greeting { font-size: 1.2rem; line-height: 1.35; }
}

@media (max-width: 560px) {
  .rsvp-topbar { flex-wrap: wrap; gap: 12px; align-items: flex-start; }
  .rsvp-topbar__brand { font-size: 1.3rem; }
  .rsvp-topbar__right {
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  .rsvp-topbar__back { max-width: none; text-align: left; flex: 1; }
  .rsvp-choices { grid-template-columns: 1fr; }
  .rsvp-wait { padding: 16px; }
  .rsvp-wait__card { padding: 28px 20px 24px; }
}

@media (max-width: 390px) {
  .rsvp-eyebrow { letter-spacing: 0.28em; }
  .rsvp-title { font-size: 2rem; }
}

@media (hover: none) {
  .rsvp-choice:hover { transform: none; border-color: var(--line); }
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-form, .rsvp-conditional, .rsvp-success, .rsvp-message { animation: none; }
}
