/* ===========================================================
   modal.css — compact luxury lead-capture pop-up
   Occupies ~30% of the desktop viewport, fully responsive
   =========================================================== */
.rp-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(var(--onyx-rgb), 0.92);
  backdrop-filter: blur(10px);
}
.rp-modal.open {
  display: flex;
  animation: modalFade 0.3s ease;
}
@keyframes modalFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.rp-modal__panel {
  position: relative;
  width: min(30vw, 460px);
  min-width: 340px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--espresso);
  border-top: 3px solid var(--accent);
  border-radius: 3px;
  box-shadow:
    0 0 0 1px rgba(var(--gold-rgb), 0.28),
    0 40px 100px rgba(var(--onyx-rgb), 0.85),
    inset 0 1px 0 rgba(var(--gold-rgb), 0.16);
  padding: 26px 30px 22px;
  animation: modalRise 0.4s cubic-bezier(0.22, 0.8, 0.32, 1);
}

@keyframes modalRise {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ── Close button ─────────────────────────────────── */
.rp-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(var(--gold-rgb), 0.35);
  color: rgba(var(--ivory-rgb), 0.45);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition:
    color 0.2s,
    border-color 0.2s;
}
.rp-modal__close:hover {
  color: var(--accent-soft);
  border-color: var(--accent-soft);
}

/* ── Header ───────────────────────────────────────── */
.rp-modal__header {
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.22);
  padding-bottom: 14px;
  margin-bottom: 16px;
}
.rp-modal__eyebrow {
  display: block;
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-bottom: 6px;
}
.rp-modal__title {
  font-size: clamp(19px, 3.5vw, 23px);
  color: var(--ivory);
  line-height: 1.15;
  margin: 0 0 4px;
}
.rp-modal__sub {
  font-size: 12px;
  color: rgba(var(--ivory-rgb), 0.5);
  line-height: 1.45;
  margin: 0;
}

/* ── Form fields ──────────────────────────────────── */
.rp-modal__form .lf-field {
  margin-bottom: 10px;
}
.rp-modal__form .lf-label {
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(var(--ivory-rgb), 0.45);
  margin-bottom: 3px;
  display: block;
}
.lf-optional {
  font-size: 8px;
  letter-spacing: 0.06em;
  color: rgba(var(--ivory-rgb), 0.28);
  text-transform: none;
}
.rp-modal__form input[type="text"],
.rp-modal__form input[type="email"],
.rp-modal__form input[type="tel"],
.rp-modal__form textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.32);
  border-radius: 0;
  padding: 6px 0;
  color: var(--ivory);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
  resize: none;
}
.rp-modal__form input[type="text"]::placeholder,
.rp-modal__form input[type="email"]::placeholder,
.rp-modal__form input[type="tel"]::placeholder,
.rp-modal__form textarea::placeholder {
  color: rgba(var(--ivory-rgb), 0.22);
}
.rp-modal__form input[type="text"]:focus,
.rp-modal__form input[type="email"]:focus,
.rp-modal__form input[type="tel"]:focus,
.rp-modal__form textarea:focus {
  border-bottom-color: var(--accent-soft);
}

/* phone field */
.rp-modal__form .phone-field {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.32);
  transition: border-color 0.2s;
}
.rp-modal__form .phone-field:focus-within {
  border-bottom-color: var(--accent-soft);
}
.rp-modal__form .phone-field input[type="tel"] {
  border: none;
  padding: 6px 0;
}
.rp-modal__form .cc-trigger {
  background: none;
  border: none;
  padding: 6px 8px 6px 0;
  color: rgba(var(--ivory-rgb), 0.5);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  white-space: nowrap;
}
.rp-modal__form .cc-trigger .cc-flag {
  display: flex;
  align-items: center;
}
.rp-modal__form .cc-trigger .cc-flag .cc-flag-img {
  width: 22px;
  height: 15px;
  object-fit: cover;
  border-radius: 2px;
  display: block;
}

/* ── recaptcha ──────────────────────────────────────── */
.rp-modal__recaptcha {
  margin-top: 12px;
}
.rp-modal__recaptcha .g-recaptcha {
  transform-origin: left top;
}
.rp-modal__recaptcha .captcha-err {
  display: none;
  color: var(--deep-soft);
  font-size: 11.5px;
  margin: 6px 0 0;
}
.rp-modal__recaptcha .captcha-err.visible {
  display: block;
}
@media (max-width: 380px) {
  .rp-modal__recaptcha .g-recaptcha {
    transform: scale(0.85);
    margin-bottom: -8px;
  }
}

/* ── Submit + fine print ──────────────────────────── */
.rp-modal__form .btn-gold {
  width: 100%;
  justify-content: center;
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: 0.12em;
  padding-top: 12px;
  padding-bottom: 12px;
}
.rp-modal__form .lf-error {
  min-height: 0;
  color: var(--deep-soft);
  font-size: 11.5px;
}
.rp-modal__form .lf-fine {
  font-size: 9px;
  color: rgba(var(--ivory-rgb), 0.3);
  text-align: center;
  margin-top: 10px;
  line-height: 1.45;
}

/* ── Country selector dropdown (modal-scoped) ────── */
.rp-modal__form .cc-dropdown {
  background: var(--espresso-2);
  border: 1px solid rgba(var(--gold-rgb), 0.25);
  box-shadow: 0 20px 50px rgba(var(--onyx-rgb), 0.7);
}
.rp-modal__form .cc-dropdown .cc-search-wrap {
  background: var(--espresso-2);
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.15);
}
.rp-modal__form .cc-dropdown .cc-search {
  background: rgba(var(--onyx-rgb), 0.5);
  border: 1px solid rgba(var(--gold-rgb), 0.25);
  color: var(--ivory);
}
.rp-modal__form .cc-dropdown .cc-search::placeholder {
  color: rgba(var(--ivory-rgb), 0.3);
}
.rp-modal__form .cc-dropdown .cc-opt {
  color: var(--ivory);
  border-bottom: 1px solid rgba(var(--gold-rgb), 0.08);
}
.rp-modal__form .cc-dropdown .cc-opt:hover {
  background: rgba(var(--onyx-rgb), 0.5);
}
.rp-modal__form .cc-dropdown .cc-opt .cc-dial {
  color: rgba(var(--ivory-rgb), 0.5);
}
.rp-modal__form .cc-divider {
  background: rgba(var(--gold-rgb), 0.18);
}

/* ── Tablet / mobile ──────────────────────────────── */
@media (max-width: 1080px) {
  .rp-modal {
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .rp-modal__panel {
    width: min(46vw, 460px);
    max-height: 88vh;
  }
}

@media (max-width: 760px) {
  .rp-modal {
    align-items: center;
    justify-content: center;
    padding: 16px;
  }

  .rp-modal__panel {
    width: min(80vw, 440px);
    max-height: 88vh;
  }
}

@media (max-width: 480px) {
  .rp-modal {
    padding: 12px;
    align-items: center;
    justify-content: center;
  }

  .rp-modal__panel {
    width: 100%;
    max-width: 440px;
    min-width: 0;
    max-height: 88vh;
    overflow-y: auto;
    padding: 16px 20px;
    border-radius: 6px;
    transform: translateY(-80px);
  }

  .rp-modal__header {
    padding-bottom: 10px;
    margin-bottom: 10px;
  }

  .rp-modal__form .lf-field {
    margin-bottom: 7px;
  }

  .rp-modal__form .btn-gold {
    margin-top: 10px;
  }
}
