/* ============================================================
   Modal de confirmación de asistencia (RSVP)
   Neutro y autocontenido para funcionar sobre cualquiera de las
   5 plantillas sin tocar su diseño.
   ============================================================ */

:root {
  --bb-wine: #6d1926;
  --bb-wine-dark: #561420;
  --bb-ink: #2a2024;
  --bb-muted: #8a7d81;
  --bb-line: #ece3e5;
  --bb-green: #1f8a4c;
  --bb-green-soft: #eef9f1;
  --bb-red: #d23c3c;
  --bb-red-soft: #fdf0f0;
}

.bb-rsvp-lead { margin: 0 auto; max-width: 520px; }

.bb-rsvp-trigger {
  display: inline-block; margin-top: 18px; padding: 14px 32px; border: none;
  border-radius: 999px; background: var(--bb-wine); color: #fff;
  font: 600 15px/1 system-ui, -apple-system, "Segoe UI", sans-serif;
  letter-spacing: .02em; cursor: pointer; box-shadow: 0 8px 20px rgba(109, 25, 38, .25);
  transition: background .2s, transform .2s, box-shadow .2s;
}
.bb-rsvp-trigger:hover { background: var(--bb-wine-dark); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(109, 25, 38, .3); }

/* ---------- Overlay ---------- */
.bb-modal-overlay {
  position: fixed; inset: 0; z-index: 2147483600; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(26, 12, 16, .55); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.bb-modal-overlay.is-open { display: flex; animation: bb-fade .25s ease; }

/* ---------- Tarjeta ---------- */
.bb-modal {
  position: relative; width: 100%; max-width: 440px; max-height: 92vh; overflow-y: auto;
  background: #fff; border-radius: 24px; padding: 0 0 26px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .35);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--bb-ink);
  animation: bb-rise .3s cubic-bezier(.2, .8, .25, 1);
}
@keyframes bb-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes bb-rise { from { opacity: 0; transform: translateY(18px) scale(.98); } to { opacity: 1; transform: none; } }

.bb-modal__close {
  position: absolute; top: 16px; right: 16px; width: 36px; height: 36px; border: none;
  border-radius: 50%; background: rgba(255, 255, 255, .25); color: #fff; font-size: 22px; line-height: 1;
  cursor: pointer; z-index: 2; transition: background .15s;
}
.bb-modal__close:hover { background: rgba(255, 255, 255, .4); }

/* Cabecera con degradado granate e iniciales de la pareja */
.bb-modal__head {
  background: linear-gradient(150deg, #7d1e2d 0%, #6d1926 55%, #561420 100%);
  color: #fff; padding: 30px 26px 26px; border-radius: 24px 24px 0 0; text-align: center;
}
.bb-modal__monogram {
  width: 60px; height: 60px; margin: 0 auto 14px; border-radius: 50%;
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .35);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 600; letter-spacing: .04em;
  font-family: Georgia, "Times New Roman", serif;
}
.bb-modal__monogram svg { width: 30px; height: 30px; color: #fff; }
.bb-modal__head h3 { margin: 0; font-size: 23px; font-weight: 600; font-family: Georgia, "Times New Roman", serif; }
.bb-modal__head p { margin: 6px 0 0; font-size: 13.5px; opacity: .9; line-height: 1.5; }

.bb-modal__body { padding: 22px 26px 0; }

/* Detalles de la boda */
.bb-modal__details {
  margin: 0 0 22px; display: grid; gap: 9px; padding: 16px; border-radius: 14px;
  background: #faf5f6; border: 1px solid var(--bb-line);
}
.bb-modal__detail { display: flex; align-items: center; gap: 10px; font-size: 13.5px; line-height: 1.4; color: #4a3f43; }
.bb-modal__detail svg { flex: 0 0 18px; width: 18px; height: 18px; color: var(--bb-wine); }
.bb-modal__detail strong { color: var(--bb-wine); font-weight: 600; }

.bb-field { margin-bottom: 18px; }
.bb-field > span { display: block; margin-bottom: 10px; font-size: 13.5px; font-weight: 600; color: var(--bb-ink); }

/* Botones grandes Sí / No (tipo tarjeta) */
.bb-choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bb-choice {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 16px 10px; border: 2px solid var(--bb-line); border-radius: 16px; cursor: pointer;
  font-size: 14px; font-weight: 600; color: #6a5f63; background: #fff;
  transition: border-color .15s, background .15s, color .15s, transform .1s;
}
.bb-choice:hover { transform: translateY(-1px); }
.bb-choice input { position: absolute; opacity: 0; pointer-events: none; }
.bb-choice__icon { width: 34px; height: 34px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: #f1ebec; transition: background .15s; }
.bb-choice__icon svg { width: 20px; height: 20px; }

.bb-choice--yes.is-selected { border-color: var(--bb-green); background: var(--bb-green-soft); color: var(--bb-green); }
.bb-choice--yes.is-selected .bb-choice__icon { background: var(--bb-green); color: #fff; }
.bb-choice--no.is-selected { border-color: var(--bb-red); background: var(--bb-red-soft); color: var(--bb-red); }
.bb-choice--no.is-selected .bb-choice__icon { background: var(--bb-red); color: #fff; }

.bb-modal select, .bb-modal textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--bb-line); border-radius: 12px;
  font-size: 14px; font-family: inherit; color: var(--bb-ink); background: #fff; box-sizing: border-box;
  transition: border-color .15s;
}
.bb-modal select:focus, .bb-modal textarea:focus { outline: none; border-color: var(--bb-wine); }
.bb-modal textarea { min-height: 84px; resize: vertical; }

.bb-modal__submit {
  width: 100%; margin-top: 4px; padding: 15px; border: none; border-radius: 999px;
  background: var(--bb-wine); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
  box-shadow: 0 8px 20px rgba(109, 25, 38, .25); transition: background .2s, transform .15s;
}
.bb-modal__submit:hover { background: var(--bb-wine-dark); transform: translateY(-1px); }
.bb-modal__note { margin: 14px 4px 0; font-size: 11.5px; line-height: 1.5; color: var(--bb-muted); text-align: center; }
.bb-modal__error { margin: 0 0 16px; padding: 11px 13px; border-radius: 11px; background: var(--bb-red-soft); color: #a12626; font-size: 13px; border: 1px solid #f6d5d5; }

/* Estado de gracias */
.bb-modal__thanks { text-align: center; padding: 4px 0 0; }
.bb-modal__thanks-icon { width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bb-green-soft); color: var(--bb-green); }
.bb-modal__thanks-icon svg { width: 30px; height: 30px; }
.bb-modal__thanks p { font-size: 15px; line-height: 1.6; color: #4a3f43; }
.bb-modal__thanks .bb-rsvp-trigger { margin-top: 16px; background: #fff; color: var(--bb-wine); border: 1.5px solid var(--bb-line); box-shadow: none; padding: 11px 24px; font-size: 14px; }
.bb-modal__thanks .bb-rsvp-trigger:hover { background: #faf5f6; transform: none; }

.bb-hidden { display: none !important; }

/* ===== RSVP por familia (varias personas) ===== */
.bb-person { padding: 14px 0; border-bottom: 1px solid var(--bb-line); }
.bb-person:first-of-type { padding-top: 4px; }
.bb-person__name { margin: 0 0 9px; font-size: 15px; font-weight: 600; color: var(--bb-ink); }
.bb-person__tag { margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--bb-wine); background: var(--bb-wine-soft, #f6e7ea); padding: 2px 8px; border-radius: 999px; vertical-align: middle; }
.bb-choices--sm .bb-choice { padding: 10px 12px; font-size: 13.5px; }
.bb-person__extra { margin-top: 12px; display: flex; flex-direction: column; gap: 12px; }
.bb-person__field { display: block; }
.bb-person__field > span { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: #4a3f43; }
.bb-person__field em { font-weight: 400; font-style: italic; color: var(--bb-muted); }
.bb-consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; font-size: 12px; font-weight: 400 !important; line-height: 1.45; color: var(--bb-muted); }
.bb-consent input { margin-top: 2px; flex-shrink: 0; }

/* ===== Canción para la fiesta (con portada + muestra de 30s) ===== */
.bb-song-block { margin-top: 18px; }
.bb-song__label { display: block; margin-bottom: 10px; font-size: 13.5px; font-weight: 600; color: var(--bb-ink); }
.bb-song__label em { font-weight: 400; font-style: italic; color: var(--bb-muted); }
.bb-song { display: flex; gap: 12px; align-items: center; }
.bb-song__cover {
  position: relative; flex: 0 0 56px; width: 56px; height: 56px; border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: #faf0f2; color: var(--bb-wine); border: 1px solid var(--bb-line);
}
.bb-song__ph { width: 24px; height: 24px; }
.bb-song__art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bb-song__main { flex: 1; min-width: 0; }
.bb-modal .bb-song__input {
  width: 100%; padding: 12px 14px; border: 1.5px solid var(--bb-line); border-radius: 12px;
  font-size: 14px; font-family: inherit; color: var(--bb-ink); background: #fff; box-sizing: border-box;
  transition: border-color .15s;
}
.bb-modal .bb-song__input:focus { outline: none; border-color: var(--bb-wine); }
.bb-song__player { width: 100%; height: 38px; margin-top: 10px; }

/* ===== Asistente paso a paso (wizard) ===== */
.bb-wiz-progress { height: 6px; border-radius: 999px; background: #f0e8ea; overflow: hidden; margin: 2px 0 20px; }
.bb-wiz-bar { display: block; height: 100%; width: 0; background: var(--bb-wine); border-radius: 999px; transition: width .35s cubic-bezier(.2, .8, .25, 1); }
.bb-step { display: none; }
.bb-step.is-active { display: block; animation: bb-step-in .28s ease; }
@keyframes bb-step-in { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.bb-step--nudge { animation: bb-nudge .45s ease; }
@keyframes bb-nudge { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.bb-step__title { margin: 0 0 6px; font-size: 17px; font-weight: 600; color: var(--bb-ink); text-align: center; }
.bb-step__sub { margin: 0 0 18px; font-size: 13px; color: var(--bb-muted); text-align: center; line-height: 1.5; }
.bb-step__fields { display: flex; flex-direction: column; gap: 14px; }
.bb-wiz-nav { display: flex; gap: 10px; margin-top: 22px; }
.bb-wiz-back { flex: 0 0 auto; padding: 14px 20px; border: 1.5px solid var(--bb-line); border-radius: 999px; background: #fff; color: var(--bb-ink); font-size: 14px; font-weight: 600; cursor: pointer; transition: background .15s; }
.bb-wiz-back:hover { background: #faf5f6; }
.bb-wiz-next { flex: 1; padding: 15px; border: none; border-radius: 999px; background: var(--bb-wine); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 20px rgba(109, 25, 38, .25); transition: background .2s, transform .15s; }
.bb-wiz-next:hover { background: var(--bb-wine-dark); transform: translateY(-1px); }
.bb-wiz-send { flex: 1; margin: 0; }

/* Confirmar con código desde la web de boda */
.bb-rsvp-code { margin: 18px auto 0; max-width: 360px; display: flex; flex-direction: column; gap: 10px; }
.bb-rsvp-code input { width: 100%; padding: 13px 16px; border: 1.5px solid var(--bb-line); border-radius: 12px;
  font-size: 16px; font-family: inherit; text-align: center; letter-spacing: 2px; text-transform: uppercase; box-sizing: border-box; }
.bb-rsvp-code input:focus { outline: none; border-color: var(--bb-wine); }
.bb-rsvp-error { margin: 12px auto 0; max-width: 360px; padding: 9px 13px; border-radius: 10px;
  background: var(--bb-red-soft); color: #a12626; font-size: 13.5px; border: 1px solid #f6d5d5; }

/* Modal de código (confirmar desde la web de boda) — reutiliza la tarjeta .bb-modal */
.bb-code-overlay {
  position: fixed; inset: 0; z-index: 9999; display: none;
  align-items: center; justify-content: center; padding: 18px;
  background: rgba(26, 12, 16, .55); -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px);
}
.bb-code-overlay.is-open { display: flex; animation: bb-fade .25s ease; }
.bb-code-input {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--bb-line); border-radius: 12px;
  font-size: 18px; font-family: inherit; text-align: center; letter-spacing: 3px; text-transform: uppercase;
  box-sizing: border-box;
}
.bb-code-input:focus { outline: none; border-color: var(--bb-wine); }
