/* ---------- RSVP modal ---------- */
.rsvp-modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.rsvp-modal[hidden] {
  display: none;
}

.rsvp-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(29, 41, 81, 0.5);
}

.rsvp-modal__panel {
  position: relative;
  background: var(--paper);
  width: 100%;
  max-width: 460px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.75rem 2rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.rsvp-modal__close {
  position: absolute;
  top: 0.6rem;
  right: 0.8rem;
  background: none;
  border: 0;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 0.35rem;
}

.rsvp-modal__panel h2 {
  margin-top: 0.2rem;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 1.75rem;
  text-align: left;
}

.rsvp-form[hidden] {
  display: none;
}

.rsvp-form__field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rsvp-form__field input[type="text"],
.rsvp-form__field input[type="email"],
.rsvp-form__field input[type="number"],
.rsvp-form__field textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink);
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--line);
  background: #fff;
  resize: vertical;
}

.rsvp-form__field input:focus,
.rsvp-form__field textarea:focus {
  outline: 1px solid var(--navy);
  outline-offset: 1px;
}

.rsvp-form__attending {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.rsvp-form__attending legend {
  padding: 0 0 0.3rem;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.rsvp-form__attending label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
}

.rsvp-form__submit {
  margin-top: 0.4rem;
  align-self: center;
  cursor: pointer;
}

.rsvp-form__status {
  min-height: 1.2em;
  margin: 0;
  font-size: 0.85rem;
  text-align: center;
  color: var(--gold-deep);
}

/* ---------- RSVP loading state ---------- */
.rsvp-loading {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 2.5rem 0 2rem;
  outline: none;
}

.rsvp-loading:not([hidden]) {
  display: flex;
}

.rsvp-loading__icon {
  width: 60px;
  height: 60px;
  animation: rsvp-spin 1.1s linear infinite;
}

.rsvp-loading__track {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
}

.rsvp-loading__spin {
  fill: none;
  stroke: var(--gold-deep);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 40 100;
}

.rsvp-loading__text {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0;
  animation: rsvp-fade-up 0.4s var(--ease) forwards;
}

@keyframes rsvp-spin {
  to { transform: rotate(360deg); }
}

/* ---------- RSVP success state ---------- */
.rsvp-success {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 1.5rem 0 0.5rem;
  outline: none;
}

.rsvp-success:not([hidden]) {
  display: flex;
}

.rsvp-success__icon {
  width: 74px;
  height: 74px;
  opacity: 0;
  transform: scale(0.6);
}

.rsvp-success.is-visible .rsvp-success__icon {
  animation: rsvp-pop 0.5s var(--ease) forwards;
}

.rsvp-success__circle {
  fill: none;
  stroke: var(--navy);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.rsvp-success__check {
  fill: none;
  stroke: var(--gold-deep);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
}

.rsvp-success.is-visible .rsvp-success__circle {
  animation: rsvp-draw 0.5s var(--ease) forwards 0.1s;
}

.rsvp-success.is-visible .rsvp-success__check {
  animation: rsvp-draw 0.35s var(--ease) forwards 0.55s;
}

.rsvp-success__title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  margin: 0;
  opacity: 0;
  transform: translateY(6px);
}

.rsvp-success__text {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin: 0;
  opacity: 0;
  transform: translateY(6px);
}

.rsvp-success.is-visible .rsvp-success__title {
  animation: rsvp-fade-up 0.45s var(--ease) forwards 0.75s;
}

.rsvp-success.is-visible .rsvp-success__text {
  animation: rsvp-fade-up 0.45s var(--ease) forwards 0.85s;
}

@keyframes rsvp-pop {
  0% { transform: scale(0.6); opacity: 0; }
  65% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes rsvp-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes rsvp-fade-up {
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-success__icon,
  .rsvp-success__title,
  .rsvp-success__text,
  .rsvp-success__circle,
  .rsvp-success__check,
  .rsvp-loading__icon,
  .rsvp-loading__text {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
}
