:root {
  --rsvp-ink: #5f3529;
  --rsvp-copper: #8c5133;
  --rsvp-gold: #caa48d;
  --rsvp-cream: #faf1e1;
  --rsvp-paper: #fffdf9;
  --rsvp-line: rgba(140, 81, 51, .22);
  --rsvp-danger: #9b2c2c;
  --rsvp-success: #2f6d4f;
}

body:not(.admin-page):not(.rsvp-page) {
  padding-bottom: 5cm !important;
}

.rsvp-page,
#wedding-rsvp-root {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--rsvp-ink);
}

.rsvp-page {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(202, 164, 141, .2), transparent 35%),
    linear-gradient(145deg, var(--rsvp-cream), #f6eee4);
}

body.rsvp-locked {
  overflow: hidden;
}

.rsvp-launcher {
  position: fixed;
  right: 18px;
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 2147482000;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  padding: 13px 19px;
  color: #fff;
  background: linear-gradient(135deg, #8c5133, #a96f50);
  box-shadow: 0 14px 35px rgba(70, 37, 25, .28);
  font: 600 15px/1.1 Arial, sans-serif;
  cursor: pointer;
}

.rsvp-launcher:hover,
.rsvp-launcher:focus-visible {
  transform: translateY(-1px);
}

.rsvp-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(43, 28, 22, .58);
  backdrop-filter: blur(6px);
}

.rsvp-overlay[hidden],
.rsvp-view[hidden],
.rsvp-attendee-list[hidden] {
  display: none !important;
}

.rsvp-dialog {
  position: relative;
  width: min(100%, 660px);
  max-height: min(92vh, 820px);
  overflow: auto;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--rsvp-line);
  border-radius: 28px;
  background: var(--rsvp-paper);
  box-shadow: 0 28px 90px rgba(40, 20, 14, .35);
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.rsvp-dialog::before,
.rsvp-card::before {
  content: "";
  display: block;
  width: 86px;
  height: 1px;
  margin: 0 auto 18px;
  background: var(--rsvp-gold);
}

.rsvp-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--rsvp-copper);
  font: 30px/1 Arial, sans-serif;
  cursor: pointer;
}

.rsvp-eyebrow {
  margin: 0 0 8px;
  color: var(--rsvp-gold);
  font: 600 12px/1.2 Arial, sans-serif;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.rsvp-dialog h1,
.rsvp-card h1,
.rsvp-card h2 {
  margin: 0 0 12px;
  color: var(--rsvp-copper);
  font-weight: 400;
}

.rsvp-dialog h1 { font-size: clamp(30px, 7vw, 44px); }
.rsvp-card h1 { font-size: clamp(28px, 6vw, 40px); }

.rsvp-copy,
.rsvp-card p {
  line-height: 1.6;
}

.rsvp-ticket-note {
  margin: 18px auto;
  padding: 14px 18px;
  border: 1px solid var(--rsvp-line);
  border-radius: 16px;
  background: rgba(250, 241, 225, .65);
}

.rsvp-ticket-note strong {
  display: block;
  color: var(--rsvp-copper);
  font-size: 20px;
}

.rsvp-label,
.rsvp-form-grid label {
  display: grid;
  gap: 7px;
  text-align: left;
  font: 600 13px/1.25 Arial, sans-serif;
  color: var(--rsvp-ink);
}

.rsvp-input,
.rsvp-select,
.rsvp-textarea,
.rsvp-form-grid input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--rsvp-line);
  border-radius: 12px;
  padding: 12px 13px;
  background: #fff;
  color: #3d2b25;
  font: 16px/1.35 Arial, sans-serif;
}

.rsvp-textarea { min-height: 82px; resize: vertical; }

.rsvp-counts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 22px;
}

.rsvp-count {
  min-width: 46px;
  min-height: 46px;
  border: 1px solid var(--rsvp-line);
  border-radius: 50%;
  color: var(--rsvp-copper);
  background: #fff;
  font: 600 16px/1 Arial, sans-serif;
  cursor: pointer;
}

.rsvp-count[aria-pressed="true"] {
  color: #fff;
  border-color: var(--rsvp-copper);
  background: var(--rsvp-copper);
}

.rsvp-attendee-list {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.rsvp-attendee {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.rsvp-form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.rsvp-button,
.rsvp-button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 11px 22px;
  text-decoration: none;
  font: 600 14px/1.2 Arial, sans-serif;
  cursor: pointer;
}

.rsvp-button {
  border: 1px solid var(--rsvp-copper);
  color: #fff;
  background: var(--rsvp-copper);
}

.rsvp-button-secondary {
  border: 1px solid var(--rsvp-line);
  color: var(--rsvp-copper);
  background: #fff;
}

.rsvp-button[disabled] { opacity: .6; cursor: wait; }

.rsvp-alert {
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 12px;
  font: 14px/1.45 Arial, sans-serif;
}

.rsvp-alert-error { color: var(--rsvp-danger); background: rgba(155, 44, 44, .08); }
.rsvp-alert-success { color: var(--rsvp-success); background: rgba(47, 109, 79, .09); }

.rsvp-success-mark {
  width: 64px;
  height: 64px;
  margin: 6px auto 16px;
  display: grid;
  place-items: center;
  border: 1px solid var(--rsvp-gold);
  border-radius: 50%;
  color: var(--rsvp-success);
  font: 34px/1 Arial, sans-serif;
}

.rsvp-confirmed-names {
  margin: 18px auto;
  padding-left: 22px;
  max-width: 380px;
  text-align: left;
  line-height: 1.7;
}

.rsvp-muted,
.rsvp-form-grid small {
  color: #7a6a62;
  font: 13px/1.45 Arial, sans-serif;
}

.rsvp-standalone {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.rsvp-card {
  position: relative;
  width: min(100%, 680px);
  box-sizing: border-box;
  padding: clamp(24px, 5vw, 44px);
  border: 1px solid var(--rsvp-line);
  border-radius: 24px;
  background: var(--rsvp-paper);
  box-shadow: 0 18px 60px rgba(86, 50, 34, .15);
}

.rsvp-install-card { text-align: center; }
.rsvp-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.rsvp-full { grid-column: 1 / -1; }
.rsvp-summary-list { display: inline-grid; gap: 8px; margin: 10px auto 24px; text-align: left; }

@media (max-width: 620px) {
  .rsvp-overlay { padding: 0; align-items: end; }
  .rsvp-dialog {
    width: 100%;
    max-height: 94dvh;
    border-radius: 24px 24px 0 0;
    padding: 30px 20px calc(26px + env(safe-area-inset-bottom));
  }
  .rsvp-attendee,
  .rsvp-form-grid { grid-template-columns: 1fr; }
  .rsvp-full { grid-column: auto; }
  .rsvp-launcher { right: 12px; font-size: 14px; }
}
