:root {
  --accent: #b18466;
  --surface: #fffdf9;
  --invitation-text: #67625f;
  --heading-font: 'Great Vibes';
  --body-font: 'Montserrat';
  --page-width: 520px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; background: #eef0f5; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--invitation-text);
  background: #eef0f5;
  font-family: var(--body-font), sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.invitation-shell {
  position: relative;
  width: min(100%, var(--page-width));
  min-height: 100vh;
  margin: 0 auto;
  overflow: hidden;
  color: var(--invitation-text);
  background: var(--surface);
  box-shadow: 0 0 48px rgb(15 23 42 / 13%);
  isolation: isolate;
}
.texture-layer {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-size: 100% auto;
  background-position: top center;
  background-repeat: repeat-y;
}
.texture-layer::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface) 3%, transparent), color-mix(in srgb, var(--surface) 12%, transparent));
}
.invitation-content { position: relative; min-height: 100vh; }

.hero-section {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
}
.hero-inner {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  padding: clamp(148px, 24vh, 205px) 30px 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.decor { pointer-events: none; user-select: none; }
.decor-top {
  position: absolute;
  z-index: 1;
  left: -28px;
  top: -14px;
  width: min(68vw, 330px);
  max-height: 315px;
  object-fit: contain;
  object-position: top left;
}
.event-date {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.couple-names {
  max-width: 100%;
  margin: 20px 0 18px;
  color: var(--accent);
  font-family: var(--heading-font), cursive;
  font-size: clamp(46px, 12vw, 60px);
  font-weight: 500;
  line-height: 1.05;
  overflow-wrap: anywhere;
}
.ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}
.ornament span { width: 42px; height: 1px; background: color-mix(in srgb, var(--accent) 45%, transparent); }
.ornament i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.intro-copy {
  max-width: 370px;
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.62;
  white-space: pre-line;
}
.meta-line {
  max-width: 390px;
  margin-top: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
}
.hero-grow { flex: 1; min-height: 34px; }
.primary-button {
  width: 100%;
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  padding: 15px 22px;
  color: white;
  background: var(--accent);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 28%, transparent);
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease, box-shadow 160ms ease;
}
.primary-button:active { transform: scale(.985); }
.primary-button:disabled { opacity: .65; cursor: wait; }
.hero-footer { margin-top: 12px; font-size: 11px; opacity: .76; }

.invitation-section { position: relative; padding: 44px 28px 30px; }
.section-heading {
  max-width: 420px;
  margin: 0 auto;
  color: var(--accent);
  text-align: center;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  letter-spacing: 1.65px;
}
.section-ornament {
  width: 34px;
  height: 1px;
  margin: 18px auto 18px;
  background: color-mix(in srgb, var(--accent) 42%, transparent);
}
.schedule-list { max-width: 430px; margin: 0 auto; }
.schedule-row {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid color-mix(in srgb, var(--invitation-text) 10%, transparent);
}
.schedule-time { color: var(--accent); font-size: 14px; font-weight: 700; }
.schedule-title { font-size: 14px; font-weight: 600; letter-spacing: .65px; text-transform: uppercase; }
.schedule-location {
  margin-top: 7px;
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: inherit;
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
}
.schedule-location:not(.disabled) { color: var(--accent); }
.schedule-address { margin-top: 4px; font-size: 11px; line-height: 1.45; opacity: .72; }

.photo-section { padding: 24px 26px; }
.photo-section img {
  display: block;
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: 0 16px 38px rgb(15 23 42 / 13%);
}
.quote-section blockquote {
  max-width: 410px;
  margin: 0 auto;
  color: var(--accent);
  font-family: var(--heading-font), cursive;
  font-size: clamp(30px, 8vw, 38px);
  line-height: 1.28;
  text-align: center;
}

.rsvp-section { scroll-margin-top: 20px; }
#rsvp-form { max-width: 430px; margin: 0 auto; }
.counter-control,
.form-field {
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  background: color-mix(in srgb, white 64%, transparent);
  backdrop-filter: blur(4px);
  border-radius: 18px;
}
.counter-control {
  min-height: 62px;
  margin-top: 12px;
  padding: 10px 12px 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.counter-control > span { flex: 1; font-size: 14px; font-weight: 600; }
.counter-actions { display: flex; align-items: center; gap: 10px; }
.counter-actions button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.counter-actions output { width: 26px; text-align: center; font-weight: 700; }
.form-field {
  margin-top: 12px;
  padding: 12px 14px;
  display: block;
}
.form-field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .35px;
}
.form-field em { font-weight: 400; opacity: .7; }
.form-field input,
.form-field textarea {
  display: block;
  width: 100%;
  border: 0;
  outline: 0;
  resize: vertical;
  color: var(--invitation-text);
  background: transparent;
  font-size: 14px;
}
.form-field input::placeholder,
.form-field textarea::placeholder { color: color-mix(in srgb, var(--invitation-text) 48%, transparent); }
.submit-button { margin-top: 18px; }
.form-error {
  margin-top: 12px;
  color: #b42318;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
}
.thank-you {
  max-width: 390px;
  margin: 14px auto 0;
  padding: 28px 20px;
  border-radius: 22px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, white);
  text-align: center;
  font-family: var(--heading-font), cursive;
  font-size: 30px;
}
.thank-you-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: white;
  background: var(--accent);
  font-family: sans-serif;
  font-size: 19px;
}

.contact-section { padding-top: 26px; }
.whatsapp-button {
  max-width: 430px;
  margin: 18px auto 0;
  padding: 16px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, white);
  text-decoration: none;
  font-size: 13px;
}
.whatsapp-button strong { font-weight: 700; }

.invitation-footer {
  position: relative;
  min-height: 260px;
  padding: 38px 30px 90px;
  overflow: hidden;
  text-align: center;
}
.closing-message {
  position: relative;
  z-index: 2;
  color: var(--accent);
  font-family: var(--heading-font), cursive;
  font-size: clamp(32px, 9vw, 40px);
  line-height: 1.2;
}
.eventify-brand {
  position: relative;
  z-index: 2;
  margin-top: 22px;
  text-transform: uppercase;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 1.2px;
  opacity: .58;
}
.decor-bottom {
  position: absolute;
  z-index: 1;
  right: -18px;
  bottom: -18px;
  width: min(58vw, 280px);
  max-height: 260px;
  object-fit: contain;
  object-position: bottom right;
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 520ms ease var(--delay, 0ms), transform 520ms ease var(--delay, 0ms);
}
.reveal.visible { opacity: 1; transform: none; }

.state-card {
  width: min(calc(100% - 36px), 420px);
  margin: 80px auto;
  padding: 34px;
  border-radius: 28px;
  background: white;
  box-shadow: 0 18px 48px rgb(15 23 42 / 12%);
  text-align: center;
}
.state-icon { font-size: 38px; }
.state-card h1 { margin: 14px 0 8px; font-size: 22px; }
.state-card p { margin: 0; line-height: 1.55; color: #667085; }
.loading-state { color: #667085; }

body[data-template='black_gold_luxury'] .counter-control,
body[data-template='black_gold_luxury'] .form-field {
  background: rgb(255 255 255 / 8%);
  border-color: rgb(213 182 111 / 26%);
}
body[data-template='black_gold_luxury'] .form-field input,
body[data-template='black_gold_luxury'] .form-field textarea { color: #f4efe4; }
body[data-template='black_gold_luxury'] .whatsapp-button,
body[data-template='black_gold_luxury'] .thank-you {
  background: rgb(213 182 111 / 12%);
}

@media (min-width: 700px) {
  .invitation-shell {
    margin: 24px auto;
    min-height: calc(100vh - 48px);
    border-radius: 32px;
  }
}
@media (max-width: 360px) {
  .hero-inner { padding-left: 22px; padding-right: 22px; }
  .invitation-section { padding-left: 22px; padding-right: 22px; }
  .schedule-row { grid-template-columns: 54px minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .primary-button { transition: none; }
}


.retry-button {
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  padding: 12px 20px;
  background: #1f6feb;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.counter-control:last-of-type {
  margin-bottom: 18px;
}

.guest-total {
  margin-top: 18px;
  margin-bottom: 18px;
  padding-top: 18px;

  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 18px 16px;
  border-top: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-radius: 16px;

  background: color-mix(in srgb, var(--accent) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);

  font-size: 13px;
  font-weight: 700;
  color: var(--invitation-text);
}

.guest-total strong {
  color: var(--accent);
  font-size: 20px;
  font-weight: 800;
}
