
/* =================================================================
   RSVP — EDITORIAL REDESIGN 2026
   ================================================================= */

/* ===== Section ===== */
.section.rsvp {
  background: transparent;
  text-align: center;
}

.section.rsvp h2 {
  margin-bottom: 8px;
}

/* Prevent mobile horizontal overflow caused by intrinsic sizing inside centered flex container */
.section.rsvp .container {
  align-items: stretch;
}

.rsvp-subtitle {
  font-family: var(--font-sans);
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 48px;
  font-size: 15px;
  line-height: 1.8;
}

/* ===== FORM SHELL ===== */
#weddingForm {
  max-width: 620px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: #FFFCF8;
  border: 1px solid rgba(194, 168, 120, 0.45);
  border-radius: var(--radius-lg);
  padding: 40px 48px;
  box-sizing: border-box;
  box-shadow: 0 8px 40px -8px rgba(20, 40, 30, 0.1), 0 2px 12px rgba(20, 40, 30, 0.04);
}

/* Section blocks — borderless with gentle dividers */
#weddingForm > .form-group,
#weddingForm > .form-fieldset {
  background: transparent;
  border-radius: 0;
  padding: 32px 0;
  box-shadow: none;
  border: none;
  border-bottom: 1px solid rgba(194, 168, 120, 0.25);
  position: relative;
  text-align: left;
}

/* Non-card wrappers */
#weddingForm > .submit-guard,
#weddingForm > .form-bottom-note {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

#weddingForm > .submit-guard::before,
#weddingForm > .form-bottom-note::before {
  display: none;
}

/* Last section before submit — no bottom border */
#weddingForm > .form-group:last-of-type {
  border-bottom: none;
}

/* ===== INTERNALS ===== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-fieldset {
  border: none;
  padding: 0;
}

#weddingForm > .form-group.guest-section-hidden {
  display: none;
}

.form-legend,
.form-section-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.form-legend {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 500;
  font-style: italic;
  color: var(--green);
  width: 100%;
  white-space: normal;
}

.field-title {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 500;
  font-style: italic;
  color: var(--green);
  margin: 0;
  line-height: 1.3;
}

label[for="message"] {
  font-family: var(--font-serif);
  font-size: clamp(20px, 3.2vw, 26px);
  font-weight: 500;
  font-style: italic;
  color: var(--green);
}

/* Step badge — now a gold ring */
.form-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent;
  border: 1.5px solid var(--gold-soft);
  color: var(--gold-soft);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0;
}

.form-help {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* ===== ATTENDANCE CARDS ===== */
.attendance-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.attendance-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid rgba(194, 168, 120, 0.3);
  border-radius: var(--radius-sm);
  background: rgba(253, 250, 245, 0.6);
  cursor: pointer;
  transition: border-color 0.24s, box-shadow 0.24s, background 0.24s, transform 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overflow: hidden;
}

.attendance-card:focus-within {
  border-color: rgba(25, 48, 37, 0.45);
  box-shadow: 0 0 0 4px rgba(166, 141, 91, 0.18);
}

.attendance-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  border-radius: 0 2px 2px 0;
  opacity: 0;
  transition: opacity 0.22s;
  pointer-events: none;
}

.attendance-card--yes::before {
  background: linear-gradient(180deg, #3d9e72, var(--green));
}

.attendance-card--no::before {
  background: linear-gradient(180deg, #e8d492, var(--gold-soft));
}

.attendance-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Radio indicator */
.attendance-card::after {
  content: "";
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid rgba(194, 168, 120, 0.5);
  background: transparent;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  margin-left: auto;
}

/* YES selected */
.attendance-card--yes:has(input:checked),
.attendance-card--yes.is-selected {
  border-color: rgba(25, 48, 37, 0.4);
  background: rgba(25, 48, 37, 0.03);
  box-shadow: none;
  transform: none;
}

.attendance-card--yes:has(input:checked)::before,
.attendance-card--yes.is-selected::before {
  opacity: 1;
}

.attendance-card--yes:has(input:checked)::after,
.attendance-card--yes.is-selected::after {
  border-color: var(--green);
  background: var(--green);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l3 3 5-5.5' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 10px;
  background-position: center;
}

/* NO selected */
.attendance-card--no:has(input:checked),
.attendance-card--no.is-selected {
  border-color: rgba(194, 168, 120, 0.6);
  background: rgba(194, 168, 120, 0.06);
  box-shadow: none;
  transform: none;
}

.attendance-card--no:has(input:checked)::before,
.attendance-card--no.is-selected::before {
  opacity: 1;
}

.attendance-card--no:has(input:checked)::after,
.attendance-card--no.is-selected::after {
  border-color: var(--gold-soft);
  background: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l3 3 5-5.5' stroke='%23C2A878' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 10px;
  background-position: center;
}

.card-icon {
  font-size: 26px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.attendance-card:has(input:checked) .card-icon,
.attendance-card.is-selected .card-icon {
  transform: scale(1.15);
}

.card-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.card-label {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  color: var(--green);
  line-height: 1.25;
}

.attendance-card--no .card-label {
  color: #8a6030;
}

.card-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.35;
}

/* ===== DECLINE HINT ===== */
.decline-hint {
  margin-top: 16px;
  padding: 20px;
  background: transparent;
  border: 1px solid rgba(194, 168, 120, 0.3);
  border-radius: var(--radius-sm);
  display: none;
}

.decline-hint.is-visible {
  display: block;
}

.decline-hint__head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.decline-hint__emoji {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}

.decline-hint__title {
  font-family: var(--font-serif);
  font-weight: 500;
  font-style: italic;
  font-size: 18px;
  color: var(--green);
  margin-bottom: 4px;
}

.decline-hint__sub {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.6;
  display: block;
}

.decline-fields {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.decline-field-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.decline-name-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: none;
  border-bottom: 1.5px solid rgba(194, 168, 120, 0.45);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  color: var(--text);
  background: transparent;
  outline: none;
  transition: border-color 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

.decline-name-input:focus {
  border-color: var(--green);
}

.decline-name-input::placeholder {
  color: rgba(112, 128, 118, 0.5);
}

/* ===== GUEST LIST ===== */
.guest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ===== GUEST CARD ===== */
.guest-card {
  background: transparent;
  border: 1px solid rgba(194, 168, 120, 0.3);
  border-radius: var(--radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s;
}

.guest-card:focus-within {
  border-color: rgba(25, 48, 37, 0.25);
}

.guest-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.guest-title {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-soft);
  min-width: 0;
}

.guest-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: end;
}

.guest-name-label,
.guest-drink-label {
  display: block;
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* Underline-style inputs */
.guest-name-input {
  width: 100%;
  height: 44px;
  padding: 0 0 0 0;
  border: none;
  border-bottom: 1.5px solid rgba(25, 48, 37, 0.15);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
  background: transparent;
  outline: none;
  transition: border-color 0.18s;
  -webkit-appearance: none;
  appearance: none;
}

.guest-name-input:focus {
  border-color: var(--green);
}

.guest-name-input::placeholder {
  color: rgba(112, 128, 118, 0.45);
}

/* ===== CUSTOM DRINK DROPDOWN ===== */
.drink-dropdown {
  position: relative;
  width: 100%;
}

.drink-dropdown__trigger {
  width: 100%;
  height: 44px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  border: none;
  border-bottom: 1.5px solid rgba(25, 48, 37, 0.15);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--green);
  text-align: left;
  outline: none;
  transition: border-color 0.18s;
  -webkit-tap-highlight-color: transparent;
}

.drink-dropdown__trigger:focus,
.drink-dropdown.is-open .drink-dropdown__trigger {
  border-color: var(--green);
}

.drink-dropdown__trigger:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.drink-dropdown__selected {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  line-height: 1.2;
  text-align: left;
}

.drink-dropdown__arrow {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  color: var(--gold-soft);
  transition: transform 0.22s ease;
}

.drink-dropdown.is-open .drink-dropdown__arrow {
  transform: rotate(180deg);
}

.drink-dropdown__list {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  width: auto;
  max-width: none;
  background: #FFFCF8;
  border: 1px solid rgba(194, 168, 120, 0.45);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 32px -8px rgba(20, 40, 30, 0.16), 0 2px 8px rgba(20, 40, 30, 0.06);
  z-index: 200;
  list-style: none;
  padding: 6px 0;
  display: none;
  max-height: min(60vh, 360px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.drink-dropdown.is-open .drink-dropdown__list {
  display: block;
}

.drink-dropdown__item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 14px;
  cursor: pointer;
  transition: background 0.12s;
  user-select: none;
}

.drink-dropdown__item:hover {
  background: var(--green-soft);
}

.drink-dropdown__item.is-selected {
  background: rgba(25, 48, 37, 0.04);
}

.drink-dropdown__item-main {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text);
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.drink-dropdown__item.is-selected .drink-dropdown__item-main {
  color: var(--green);
  font-weight: 600;
}

.drink-dropdown__item-sub {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  font-style: italic;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Remove button */
.guest-remove-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: transparent;
  border: 1px solid rgba(194, 168, 120, 0.3);
  color: var(--text-muted);
  font-size: 11px;
  font-family: var(--font-sans);
  font-weight: 500;
  cursor: pointer;
  transition: background 0.16s, color 0.16s, border-color 0.16s;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.04em;
}

.guest-remove-btn:hover {
  background: rgba(161, 61, 72, 0.06);
  color: var(--red-accent);
  border-color: rgba(161, 61, 72, 0.25);
}

/* ===== GUEST TOOLS ===== */
.guest-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
}

.guest-tools .btn-sm {
  min-height: 40px;
  height: 40px;
}

.guest-total {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

.guest-total strong {
  color: var(--green);
  font-weight: 700;
}

/* ===== TEXTAREA ===== */
textarea {
  width: 100%;
  min-height: 90px;
  padding: 12px 0;
  border: none;
  border-bottom: 1.5px solid rgba(25, 48, 37, 0.15);
  border-radius: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text);
  background: transparent;
  resize: none;
  outline: none;
  transition: border-color 0.18s;
  line-height: 1.7;
  -webkit-appearance: none;
  appearance: none;
}

textarea:focus {
  border-color: var(--green);
}

textarea::placeholder {
  color: rgba(112, 128, 118, 0.45);
}

/* ===== CONFIRM GUARD ===== */
.submit-guard {
  margin-top: 12px;
}

.confirm-submit-label {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  transition: color 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.confirm-submit-label:has(input:checked),
.confirm-submit-label.is-checked {
  color: var(--green);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.confirm-submit-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--green);
  cursor: pointer;
}

.submit-hint {
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.55;
  opacity: 0.75;
}

/* ===== BOTTOM NOTE ===== */
.form-bottom-note {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.65;
}

/* ===== SUBMIT BUTTON ===== */
.btn-submit {
  width: 100%;
  max-width: 380px;
  height: 56px;
  font-size: 13px;
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--green);
  color: #fff;
  border-radius: 40px;
  cursor: pointer;
  border: none;
  display: block;
  margin: 28px auto 0;
  transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 8px 28px rgba(25, 48, 37, 0.18);
  position: relative;
  overflow: hidden;
}

/* shimmer sweep on hover */
.btn-submit::after {
  content: "";
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.12) 50%,
    transparent 100%
  );
  transform: skewX(-20deg);
  transition: left 0.55s ease;
}

.btn-submit:not(:disabled):hover::after {
  left: 160%;
}

.btn-submit:not(:disabled):hover {
  opacity: 0.92;
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(25, 48, 37, 0.22);
}

.btn-submit:not(:disabled):active {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(25, 48, 37, 0.18);
}

.btn-submit:disabled {
  opacity: 0.28;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ===== STATUS MESSAGE ===== */
#statusMessage {
  max-width: 620px;
  margin: 16px auto 0;
  text-align: center;
  font-size: 15px;
  min-height: 24px;
}

#statusMessage.success {
  color: var(--green);
  padding: 18px 20px;
  background: rgba(25, 48, 37, 0.04);
  border: 1px solid rgba(25, 48, 37, 0.15);
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 17px;
}

#statusMessage.error {
  color: var(--red-accent);
  padding: 18px 20px;
  background: rgba(161, 61, 72, 0.05);
  border: 1px solid rgba(161, 61, 72, 0.18);
  border-radius: var(--radius-sm);
  font-family: var(--font-sans);
  font-size: 14px;
}

/* =================================================================
   RESPONSIVE
   ================================================================= */

@media (max-width: 660px) {
  #weddingForm > .form-group,
  #weddingForm > .form-fieldset {
    padding: 24px 0;
  }
}

@media (max-width: 560px) {
  #weddingForm {
    gap: 0;
    padding: 28px 20px;
    border-radius: var(--radius-md);
  }

  .guest-fields {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .guest-card {
    padding: 16px;
  }
}

@media (max-width: 440px) {
  .card-icon {
    font-size: 22px;
  }

  .card-label {
    font-size: 13px;
  }

  .btn-submit {
    height: 52px;
    font-size: 12px;
  }

  .guest-tools {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  #addGuestBtn {
    width: 100%;
    justify-content: center;
  }

  .guest-total {
    text-align: center;
  }
}
