/* ============================================================
   The RSVP form.

   Hand-written, unlike site.css, which is generated from the design
   export. The markup is built by rsvp.js inside the design's RSVP card,
   so everything here borrows that card's palette: cream paper, gold
   hairlines, and the rose of the one button that matters.
============================================================ */

/* The design sets display inline on several of the blocks rsvp.js hides,
   which would otherwise beat the hidden attribute. */
#rsvp [hidden] { display: none !important; }

.rsvp-form,
.rsvp-panel {
  width: 100%;
  max-width: 440px;
  text-align: left;
  color: #342B29;
}

.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rsvp-form label,
.rsvp-form legend,
.rsvp-label {
  display: block;
  margin: 0 0 6px;
  padding: 0;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: #9E5642;
}

.rsvp-form input[type="text"],
.rsvp-form input[type="email"],
.rsvp-form input[type="tel"],
.rsvp-form select,
.rsvp-form textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #C9A978;
  border-radius: 4px;
  background: #FFFEFA;
  color: #342B29;
  font: inherit;
  /* Below 16px, iOS zooms the page when a field takes focus. */
  font-size: 16px;
  line-height: 1.4;
  -webkit-appearance: none;
  appearance: none;
}

.rsvp-form textarea { resize: vertical; }

.rsvp-form ::placeholder {
  color: #9C8460;
  font-style: italic;
  opacity: 1;
}

.rsvp-form select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%239E5642' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.rsvp-form input:focus-visible,
.rsvp-form select:focus-visible,
.rsvp-form textarea:focus-visible,
.rsvp-submit:focus-visible,
.rsvp-link:focus-visible {
  outline: 2px solid #C25859;
  outline-offset: 2px;
}

.rsvp-form [aria-invalid="true"] { border-color: #C25859; }

/* A found invitation: the name is settled, so it stops looking editable. */
.rsvp-form input[readonly] {
  border-style: dashed;
  background: transparent;
  color: #6E5F51;
}

.rsvp-found {
  margin-top: -8px;
  font-size: 16px;
  font-style: italic;
  line-height: 1.6;
  color: #6E5F51;
}

.rsvp-details {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rsvp-error {
  margin-top: 6px;
  font-size: 14px;
  font-style: italic;
  color: #9E4344;
}

.rsvp-send-error {
  margin: 0;
  text-align: center;
}

/* ------------------------------------------------ accept / decline */
.rsvp-reply {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

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

/* The radios stay in the accessibility tree and keep their keyboard
   behaviour; only their labels are drawn. */
.rsvp-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.rsvp-form .rsvp-seg label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid #C9A978;
  border-radius: 4px;
  background: #FFFEFA;
  color: #6E5F51;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-align: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.rsvp-seg input:checked + label {
  border-color: #C25859;
  background: #C25859;
  color: #F5F0E9;
}

.rsvp-seg input:focus-visible + label {
  outline: 2px solid #C25859;
  outline-offset: 2px;
}

/* ---------------------------------------------------------- layout */
.rsvp-attending {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.rsvp-label { margin-bottom: -8px; }

.rsvp-guests {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.rsvp-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------- actions */
.rsvp-submit {
  align-self: center;
  min-height: 52px;
  padding: 0 40px;
  border: 0;
  border-radius: 999px;
  background: #C25859;
  color: #F5F0E9;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(158, 67, 68, 0.28);
  cursor: pointer;
  transition: background .25s ease, box-shadow .25s ease, transform .25s ease;
}

.rsvp-submit:hover { background: #9E4344; }
.rsvp-submit:active { transform: scale(0.98); }
.rsvp-submit:disabled { opacity: 0.6; cursor: default; }

.rsvp-panel {
  text-align: center;
  outline: none;
}

.rsvp-panel p {
  margin: 0 0 18px;
  font-size: 17px;
  font-style: italic;
  line-height: 1.6;
  color: #6E5F51;
}

.rsvp-thanks {
  margin: 0 0 8px;
  font-family: 'Dancing Script', cursive;
  font-size: clamp(32px, 7vw, 42px);
  line-height: 1.1;
  color: #A75858;
}

.rsvp-link {
  padding: 6px 2px;
  border: 0;
  border-bottom: 1px dashed #C25859;
  background: none;
  color: #9E4344;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .rsvp-submit,
  .rsvp-form .rsvp-seg label { transition: none; }
}
