:root {
  --bg-ivory: #f7f1e5;
  --bg-ivory-deep: #ede2ce;
  --bg-card: #fcf8ef;
  --navy-deep: #0b1e3b;
  --navy-ink: #13294b;
  --navy-muted: #334a6b;
  --gold-primary: #b8892d;
  --gold-dark: #8c6318;
  --gold-light: #e2c47d;
  --border-gold: rgba(184, 137, 45, 0.55);
  --shadow-card: 0 22px 55px rgba(11, 30, 59, 0.12), 0 4px 14px rgba(11, 30, 59, 0.06);
  --radius-card: 6px;
  --radius-control: 6px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-ivory-deep);
  color: var(--navy-ink);
  font-family: 'Lora', Georgia, serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

.page-backdrop {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 15%, rgba(255, 252, 245, 0.85), transparent 55%),
    radial-gradient(circle at 80% 85%, rgba(184, 137, 45, 0.12), transparent 50%),
    linear-gradient(160deg, #efe6d5 0%, #e6dac4 100%);
}

.invitation-wrapper {
  width: 100%;
  max-width: 700px;
  margin: 0 auto;
  padding: 2.25rem 1rem 3.5rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Tarjetas estilo papelería fina */
.card {
  position: relative;
  background:
    radial-gradient(circle at 50% 30%, #fffdf8 0%, var(--bg-ivory) 100%);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 1.1rem;
  overflow: hidden;
  border: 1px solid rgba(184, 137, 45, 0.35);
  animation: cardReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.rsvp-card {
  animation-delay: 0.12s;
}

.card-inner-frame {
  position: relative;
  border: 1.5px solid var(--gold-primary);
  padding: 2.5rem 2.25rem;
  z-index: 1;
}

.card-inner-frame::before {
  content: '';
  position: absolute;
  inset: 5px;
  border: 1px solid rgba(184, 137, 45, 0.32);
  pointer-events: none;
}

/* Cintas de esquina */
.corner-ribbon {
  position: absolute;
  width: 148px;
  height: 148px;
  pointer-events: none;
  z-index: 2;
}

.corner-ribbon--tl {
  top: 0;
  left: 0;
}

.corner-ribbon--br {
  bottom: 0;
  right: 0;
}

/* Cabecera hero */
.hero-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  margin-bottom: 1.15rem;
}

.emblem-box {
  width: 185px;
  margin-top: 0.25rem;
}

.grad-emblem {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(11, 30, 59, 0.14));
}

.intro-copy {
  margin: 0;
  max-width: 36ch;
  font-size: 1.05rem;
  color: var(--navy-ink);
  font-weight: 500;
}

/* Ornamentos dorados */
.flourish {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.1rem auto;
  color: var(--gold-primary);
  max-width: 340px;
}

.flourish--wide {
  max-width: 400px;
  margin: 1.4rem auto;
}

.flourish--compact {
  max-width: 280px;
  margin: 0.9rem auto;
}

.flourish-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.flourish-icon {
  width: 34px;
  height: 18px;
  flex-shrink: 0;
}

.flourish-scroll {
  width: 105px;
  height: 22px;
  flex-shrink: 0;
}

/* Título principal */
.title-block {
  text-align: center;
  margin-top: 0.5rem;
}

.script-title {
  margin: 0;
  font-family: 'Great Vibes', cursive;
  font-size: clamp(3rem, 8.5vw, 4.35rem);
  font-weight: 400;
  line-height: 1.08;
  color: var(--gold-dark);
  background: linear-gradient(180deg, #c79a3b 0%, #8c6318 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  padding: 0.15em 0;
}

.de-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  margin: 0.55rem auto 0.75rem;
  max-width: 260px;
}

.de-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.de-text {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  color: var(--gold-dark);
  font-weight: 600;
}

.honoree-name {
  margin: 0;
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.45rem, 4.4vw, 2.15rem);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0.04em;
  color: var(--navy-deep);
}

/* Mensaje emotivo */
.message-block {
  text-align: center;
  max-width: 44ch;
  margin: 0 auto 1.65rem;
}

.italic-copy {
  margin: 0 0 0.75rem;
  font-style: italic;
  font-size: 1.03rem;
  color: var(--navy-ink);
}

.italic-copy--emphasis {
  margin-bottom: 0;
  font-weight: 600;
}

/* Detalles de fecha y dirección */
.event-details {
  max-width: 460px;
  margin: 0 auto 1.75rem;
  border-top: 1px solid rgba(184, 137, 45, 0.45);
  border-bottom: 1px solid rgba(184, 137, 45, 0.45);
  padding: 1.1rem 0.5rem;
}

.detail-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0.25rem;
}

.detail-divider {
  height: 1px;
  background: rgba(184, 137, 45, 0.35);
  margin: 0.65rem 0;
}

.detail-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-primary);
  color: #fffdf8;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 3px 8px rgba(140, 99, 24, 0.25);
}

.detail-icon svg {
  width: 21px;
  height: 21px;
}

.detail-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  flex: 1;
}

.detail-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.9rem;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--navy-deep);
  background-color: #fffdf8;
  border: 1.5px solid var(--gold-primary);
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    color 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease;
}

.detail-action-btn:hover {
  background-color: var(--navy-deep);
  color: #fcf8ef;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(11, 30, 59, 0.16);
}

.detail-action-btn:active {
  transform: translateY(0) scale(0.97);
}

.detail-action-btn:focus-visible {
  outline: 2px solid var(--navy-deep);
  outline-offset: 2px;
}

.detail-label {
  font-size: 0.92rem;
  color: var(--navy-muted);
}

.detail-value {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy-deep);
}

.closing-call {
  margin: 0;
  text-align: center;
  font-family: 'Great Vibes', cursive;
  font-size: 2.35rem;
  color: var(--navy-deep);
}

.rsvp-card {
  overflow: visible;
}
/* Tarjeta de confirmación (RSVP) */
.rsvp-header {
  text-align: center;
  margin-bottom: 1.8rem;
}

.rsvp-title {
  margin: 0 0 1.15rem;
  font-family: 'Cinzel', Georgia, serif;
  font-size: clamp(1.35rem, 3.8vw, 1.85rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.03em;
  color: var(--navy-deep);
}

.rsvp-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--navy-deep);
}

.meta-item--deadline {
  font-weight: 500;
  font-size: 1.02rem;
}

.meta-badge {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--navy-deep);
  color: var(--bg-ivory);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.meta-badge svg {
  width: 15px;
  height: 15px;
}

.meta-phones a {
  color: var(--navy-deep);
  text-decoration: none;
  border-bottom: 1px dotted var(--gold-primary);
}

.meta-phones a:hover {
  color: var(--gold-dark);
}

.meta-sub {
  margin: 0.2rem 0 0;
  font-style: italic;
  font-size: 0.95rem;
  color: var(--navy-muted);
}

/* Formulario */
.rsvp-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-label {
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--navy-deep);
}

.form-hint {
  margin: 0;
  font-size: 0.92rem;
  color: var(--navy-muted);
}

.custom-select {
  position: relative;
  margin-top: 0.2rem;
}

.custom-select-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  font-family: 'Lora', Georgia, serif;
  font-size: 1rem;
  text-align: left;
  color: var(--navy-deep);
  background-color: #fffdf8;
  border: 1.5px solid rgba(184, 137, 45, 0.65);
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.custom-select-trigger:hover {
  border-color: var(--gold-primary);
  background-color: #fcf7eb;
}

.custom-select-trigger:focus-visible,
.custom-select.is-open .custom-select-trigger {
  outline: none;
  border-color: var(--navy-deep);
  box-shadow: 0 0 0 3px rgba(11, 30, 59, 0.12);
}

.custom-select.is-invalid .custom-select-trigger {
  border-color: #9e2a2b;
  box-shadow: 0 0 0 3px rgba(158, 42, 43, 0.12);
}

.custom-select-placeholder {
  color: var(--navy-muted);
}

.custom-select-value {
  color: var(--navy-deep);
  font-weight: 600;
}

.select-chevron {
  width: 20px;
  height: 20px;
  color: var(--gold-dark);
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.custom-select.is-open .select-chevron {
  transform: rotate(180deg);
}

.custom-select-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  background: #fffdf8;
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-control);
  box-shadow: 0 18px 40px rgba(11, 30, 59, 0.18), 0 4px 12px rgba(11, 30, 59, 0.08);
  overflow: hidden;
  transform-origin: top center;
  animation: dropdownReveal 0.22s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.companions-section:not([hidden]),
.summary-box:not([hidden]) {
  animation: panelReveal 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.custom-select-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid rgba(184, 137, 45, 0.35);
  background: var(--bg-card);
}

.search-icon {
  width: 17px;
  height: 17px;
  color: var(--gold-dark);
  flex-shrink: 0;
  margin-right: 0.55rem;
}

.custom-select-search {
  width: 100%;
  border: none;
  background: transparent;
  font-family: 'Lora', Georgia, serif;
  font-size: 0.95rem;
  color: var(--navy-deep);
}

.custom-select-search::placeholder {
  color: var(--navy-muted);
  opacity: 0.75;
}

.custom-select-search:focus {
  outline: none;
}

.custom-select-options {
  list-style: none;
  margin: 0;
  padding: 0.35rem;
  max-height: 250px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-primary) transparent;
}

.custom-select-options::-webkit-scrollbar {
  width: 6px;
}

.custom-select-options::-webkit-scrollbar-thumb {
  background-color: rgba(184, 137, 45, 0.65);
  border-radius: 999px;
}

.custom-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.68rem 0.85rem;
  border-radius: 4px;
  font-size: 0.96rem;
  color: var(--navy-ink);
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease;
}

.custom-select-option:hover,
.custom-select-option.is-highlighted {
  background-color: rgba(184, 137, 45, 0.14);
  color: var(--navy-deep);
}

.custom-select-option.is-selected {
  background-color: var(--navy-deep);
  color: #fcf8ef;
  font-weight: 600;
}

.option-check {
  width: 16px;
  height: 16px;
  color: var(--gold-light);
  flex-shrink: 0;
}

.custom-select-empty {
  margin: 0;
  padding: 1rem;
  text-align: center;
  font-size: 0.92rem;
  font-style: italic;
  color: var(--navy-muted);
}

.form-textarea {
  width: 100%;
  font-family: 'Lora', Georgia, serif;
  font-size: 1rem;
  color: var(--navy-deep);
  background-color: #fffdf8;
  border: 1.5px solid rgba(184, 137, 45, 0.6);
  border-radius: var(--radius-control);
  padding: 0.8rem 1rem;
  resize: vertical;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-textarea:focus {
  outline: none;
  border-color: var(--navy-deep);
  box-shadow: 0 0 0 3px rgba(11, 30, 59, 0.12);
}

.form-error {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #9e2a2b;
  font-weight: 500;
}

/* Lista de acompañantes */
.companions-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.companion-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  background: #fffdf8;
  border: 1px solid rgba(184, 137, 45, 0.45);
  border-radius: var(--radius-control);
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.2s ease;
}

.companion-item:hover {
  border-color: var(--gold-primary);
  background: #fcf6e8;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(184, 137, 45, 0.12);
}

.companion-item:active {
  transform: scale(0.995);
}

.companion-check-label {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  cursor: pointer;
  flex: 1;
  font-size: 0.98rem;
  color: var(--navy-deep);
  font-weight: 500;
}

.companion-checkbox {
  width: 18px;
  height: 18px;
  accent-color: var(--navy-deep);
  cursor: pointer;
  flex-shrink: 0;
}

.counter-control {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--bg-ivory);
  border: 1px solid rgba(184, 137, 45, 0.5);
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
}

.counter-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: var(--navy-deep);
  color: var(--bg-ivory);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.14s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.counter-btn:not(:disabled):hover {
  background: #173a6e;
  transform: scale(1.08);
}

.counter-btn:not(:disabled):active {
  transform: scale(0.92);
}

.counter-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.counter-value {
  min-width: 1.4ch;
  text-align: center;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--navy-deep);
}

.solo-notice {
  margin: 0.25rem 0 0;
  padding: 0.75rem 1rem;
  background: rgba(184, 137, 45, 0.08);
  border-left: 3px solid var(--gold-primary);
  font-size: 0.94rem;
  color: var(--navy-ink);
}

/* Resumen en vivo */
.summary-box {
  background: rgba(11, 30, 59, 0.04);
  border: 1px solid rgba(11, 30, 59, 0.16);
  border-left: 4px solid var(--navy-deep);
  border-radius: var(--radius-control);
  padding: 1rem 1.15rem;
}

.summary-title {
  margin: 0 0 0.55rem;
  font-family: 'Cinzel', Georgia, serif;
  font-size: 0.95rem;
  color: var(--navy-deep);
}

.summary-list {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.95rem;
}

.summary-row dt {
  font-weight: 600;
  color: var(--navy-muted);
}

.summary-row dd {
  margin: 0;
  color: var(--navy-deep);
  font-weight: 500;
}

/* Botón principal de WhatsApp */
.form-actions {
  margin-top: 0.25rem;
}

.btn-whatsapp {
  position: relative;
  overflow: hidden;
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 1rem 1.5rem;
  background: linear-gradient(135deg, #0b1e3b 0%, #153463 100%);
  color: #fcf8ef;
  border: 1.5px solid var(--gold-primary);
  border-radius: var(--radius-control);
  font-family: 'Cinzel', Georgia, serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(11, 30, 59, 0.22);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.22s ease, background 0.22s ease;
}

.btn-whatsapp::after {
  content: '';
  position: absolute;
  top: 0;
  left: -120%;
  width: 60%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(226, 196, 125, 0.24), transparent);
  transform: skewX(-20deg);
  transition: left 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(11, 30, 59, 0.28);
  background: linear-gradient(135deg, #102a52 0%, #1a407a 100%);
}

.btn-whatsapp:hover::after {
  left: 140%;
}

.btn-whatsapp:active {
  transform: translateY(0) scale(0.99);
}

.btn-whatsapp:focus-visible {
  outline: 3px solid var(--gold-primary);
  outline-offset: 3px;
}

.wa-icon {
  width: 22px;
  height: 22px;
  color: var(--gold-light);
  flex-shrink: 0;
}

.rsvp-footer {
  margin-top: 1.75rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(184, 137, 45, 0.35);
  text-align: center;
}

.footer-note {
  margin: 0;
  font-style: italic;
  font-size: 0.96rem;
  color: var(--navy-muted);
}

/* Responsive */
@media (max-width: 600px) {
  .invitation-wrapper {
    padding: 1rem 0.65rem 2.5rem;
    gap: 1.35rem;
  }

  .card {
    padding: 0.7rem;
  }

  .card-inner-frame {
    padding: 2rem 1.25rem;
  }

  .corner-ribbon {
    width: 105px;
    height: 105px;
  }

  .emblem-box {
    width: 150px;
  }

  .btn-whatsapp {
    font-size: 0.92rem;
    padding: 0.95rem 1rem;
  }

  .detail-row {
    flex-wrap: wrap;
  }

  .detail-action-btn {
    margin-left: calc(42px + 1rem);
  }
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dropdownReveal {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.99);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes panelReveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .card,
  .custom-select-dropdown,
  .companions-section:not([hidden]),
  .summary-box:not([hidden]) {
    animation: none;
  }
  .btn-whatsapp,
  .btn-whatsapp::after,
  .companion-item,
  .counter-btn,
  .detail-action-btn,
  .custom-select-trigger,
  .custom-select-option,
  .select-chevron {
    transition: none;
  }
}
