:root {
  --pink:       #FFA5D5;  /* brand pink */
  --purple:     #B77ADB;  /* brand purple */
  --purple-ink: #8E4FB8;  /* darker purple for legible body text */
  --gold:       #d9b65a;
  --paper-1:    #fdf6fb;
  --paper-2:    #f3ecfb;
  --card:       #ffffff;
  --line:       #f1dcef;
  --shadow:     0 18px 50px rgba(183, 122, 219, .18);
  --radius:     22px;
  font-size: 17px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--purple-ink);
  font-family: "Montagu Slab", Georgia, "Times New Roman", serif;
  background:
    radial-gradient(1200px 600px at 50% -10%, #fbe9f5 0%, transparent 60%),
    linear-gradient(160deg, var(--paper-1) 0%, var(--paper-2) 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

/* ---- twinkling gold stars ---- */
.sky { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.sky .star {
  position: absolute;
  color: var(--gold);
  opacity: .15;
  animation: twinkle 4s ease-in-out infinite;
  text-shadow: 0 0 6px rgba(217, 182, 90, .5);
}
@keyframes twinkle { 0%,100% { opacity: .12; transform: scale(.7); } 50% { opacity: .85; transform: scale(1); } }

.page {
  position: relative;
  z-index: 1;
  max-width: 620px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 44px) clamp(16px, 5vw, 28px) 8px;
}

/* ---- invitation image ---- */
.invite { display: flex; justify-content: center; }
.invite__img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #fff;
  animation: float 7s ease-in-out infinite;
}
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

/* ---- RSVP card ---- */
.rsvp {
  margin: clamp(22px, 5vw, 34px) 0 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 34px);
}
.rsvp__title {
  font-family: "Satisfy", cursive;
  font-weight: 400;
  font-size: clamp(2rem, 7vw, 2.9rem);
  color: var(--pink);
  text-align: center;
  margin: 0;
  line-height: 1.1;
}
.rsvp__deadline { text-align: center; margin: .35rem 0 1.4rem; color: var(--purple-ink); }

/* ---- form ---- */
.form { display: flex; flex-direction: column; gap: 1.05rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field__label { font-weight: 600; color: var(--purple-ink); font-size: .95rem; }
.muted { color: #b7a6cc; font-weight: 500; }

.field__input {
  font: inherit;
  color: var(--purple-ink);
  background: #fbf7fe;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: .72rem .9rem;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.field__input::placeholder { color: #c4b6d8; }
.field__input:focus {
  outline: none;
  background: #fff;
  border-color: var(--pink);
  box-shadow: 0 0 0 4px rgba(255, 165, 213, .32);
}
.field__input--num { width: 7.5rem; }
textarea.field__input { resize: vertical; min-height: 3.2rem; }

.choice { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .55rem; }
.choice legend { margin-bottom: .5rem; padding: 0; }
.choice__opt {
  display: flex; align-items: center; gap: .6rem;
  background: #fbf7fe; border: 2px solid var(--line); border-radius: 14px;
  padding: .68rem .9rem; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.choice__opt:hover { border-color: #e9d6ef; }
.choice__opt:has(input:checked) { border-color: var(--pink); background: #fff0f8; }
.choice__opt input { accent-color: var(--pink); width: 1.1rem; height: 1.1rem; }

.form__errors {
  background: #fff0f4; border: 1px solid #f6c9d9; color: #c0507a;
  border-radius: 14px; padding: .6rem .9rem; font-size: .92rem;
}
.form__errors p { margin: .15rem 0; }

/* ---- button ---- */
.btn {
  position: relative;
  margin-top: .3rem;
  font: inherit; font-weight: 700; letter-spacing: .2px;
  color: #fff; cursor: pointer;
  text-shadow: 0 1px 2px rgba(142, 79, 184, .45);
  border: 0; border-radius: 16px; padding: .9rem 1.2rem;
  background: linear-gradient(135deg, var(--pink) 0%, var(--purple) 100%);
  box-shadow: 0 10px 24px rgba(183, 122, 219, .35);
  transition: transform .12s, box-shadow .12s, filter .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 14px 30px rgba(183, 122, 219, .45); }
.btn:active { transform: translateY(0); }
.btn:disabled { filter: saturate(.6) brightness(1.02); cursor: progress; }
.btn__spinner { display: none; }
.btn:disabled .btn__label { opacity: .65; }
.btn:disabled .btn__spinner {
  display: inline-block; width: 1em; height: 1em; margin-left: .5em;
  vertical-align: -.15em; border: 2px solid rgba(255,255,255,.5);
  border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- thank-you ---- */
.thanks { text-align: center; padding: .5rem 0; }
.thanks__burst { font-size: 3.2rem; animation: pop .5s ease-out both; }
@keyframes pop { 0% { transform: scale(.2) rotate(-12deg); opacity: 0; } 70% { transform: scale(1.15); } 100% { transform: scale(1); opacity: 1; } }
.thanks__title {
  font-family: "Satisfy", cursive; font-weight: 400;
  font-size: clamp(1.6rem, 6vw, 2.2rem); color: var(--pink); margin: .4rem 0 .5rem;
}
.thanks__body { color: var(--purple-ink); margin: 0 auto; max-width: 26rem; }

/* ---- footer ---- */
.footer {
  position: relative; z-index: 1;
  text-align: center; color: #b09ec9; font-size: .85rem;
  padding: 1.6rem 1rem 2.4rem;
}

@media (prefers-reduced-motion: reduce) {
  .invite__img, .sky .star, .thanks__burst { animation: none; }
}
