/* ===========================================================
   modal.css — Brigade Barcelona enquiry pop-up
   Same palette as the page: a midnight-navy panel (not a warm
   slab) on a navy wash that lets the page show through, a cool
   --hairline border, a 2px terracotta top rule (the .eyebrow /
   .s2-coda accent), a light-weight mixed-case display heading
   with an italic ember <em>, and ember-on-focus hairline fields.
   Ember appears only where the page uses it — the eyebrow label,
   the heading accent, focus states and the primary button.
   Kept compact (3 fields, no message box) so it never scrolls.
   =========================================================== */
.rp-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: color-mix(in srgb, var(--midnight) 74%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.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, 440px);
  min-width: 340px;
  max-height: 92vh;
  overflow: hidden auto;
  background: color-mix(in srgb, var(--midnight) 93%, #fff);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  box-shadow:
    0 44px 100px -46px rgba(0, 0, 0, 0.92),
    inset 0 1px 0 color-mix(in srgb, #fff 6%, transparent);
  padding: 24px 28px 18px;
  animation: modalRise 0.4s var(--ease-luxe);
}
/* 2px terracotta accent rule along the top — the same horizontal
   accent the page uses for .eyebrow::before and .s2-coda */
.rp-modal__panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--terracotta);
  z-index: 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: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  background: transparent;
  border: none;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 1;
  transition: color 0.2s;
}
.rp-modal__close svg {
  width: 13px;
  height: 13px;
}
.rp-modal__close:hover {
  color: var(--ember);
}

/* ── Header ───────────────────────────────────────── */
.rp-modal__header {
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 12px;
  margin-bottom: 14px;
}
.rp-modal__eyebrow {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 9px;
}
.rp-modal__eyebrow-rule {
  width: 2.2rem;
  height: 2px;
  flex: none;
  background: var(--terracotta);
}
.rp-modal__eyebrow-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.62rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ember);
}
.rp-modal__title {
  font-family: var(--font-display);
  font-weight: 300;
  text-transform: none;
  font-size: clamp(1.28rem, 2.8vw, 1.55rem);
  color: var(--ink);
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
.rp-modal__title em {
  font-style: italic;
  color: var(--ember);
}
.rp-modal__sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.78rem;
  color: var(--ink-soft);
  line-height: 1.45;
  margin: 0;
}

/* ── Form fields ──────────────────────────────────── */
.rp-modal__form .lf-field {
  margin-bottom: 8px;
  display: block;
}
.rp-modal__form .lf-label {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.58rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 3px;
  display: block;
}
.rp-modal__form input[type="text"],
.rp-modal__form input[type="email"],
.rp-modal__form input[type="tel"] {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--hairline);
  border-radius: 0;
  padding: 6px 0;
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 0.88rem;
  outline: none;
  transition: border-color 0.2s;
}
.rp-modal__form input::placeholder {
  color: color-mix(in srgb, var(--parchment) 28%, transparent);
}
.rp-modal__form input:focus {
  border-bottom-color: var(--ember);
}

/* phone field */
.rp-modal__form .phone-field {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--hairline);
  transition: border-color 0.2s;
}
.rp-modal__form .phone-field:focus-within {
  border-bottom-color: var(--ember);
}
.rp-modal__form .phone-field input[type="tel"] {
  border: none;
  border-left: 1px solid var(--hairline);
  padding: 6px 0 6px 10px;
  margin-left: 1px;
}
.rp-modal__form .cc-trigger {
  background: none;
  border: none;
  padding: 6px 10px 6px 0;
  color: var(--ink-soft);
  font-family: var(--font-body);
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s;
}
.rp-modal__form .cc-trigger:hover,
.rp-modal__form .cc-trigger:focus-visible {
  color: var(--ink);
}
.rp-modal__form .cc-trigger:hover .cc-flag-frame,
.rp-modal__form .cc-trigger:focus-visible .cc-flag-frame {
  border-color: var(--ember);
}
.rp-modal__form .cc-trigger .cc-flag {
  display: flex;
  align-items: center;
}
.rp-modal__form .cc-dial-sel {
  font-weight: 500;
  letter-spacing: 0.01em;
}
.rp-modal__form .cc-trigger .cc-caret {
  display: flex;
  align-items: center;
  color: var(--ink-faint);
}
.rp-modal__form .cc-trigger .cc-caret svg {
  width: 9px;
  height: 9px;
  transition: transform 0.25s var(--ease-luxe);
}
.rp-modal__form .phone-field:has(.cc-dropdown.open) .cc-caret svg {
  transform: rotate(180deg);
}

/* flag chip — a framed badge with the page's ember hairline, so the
   selector always looks intentional whether the flag image has loaded,
   is still loading, or 404s */
.cc-flag-frame {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  overflow: hidden;
  border-radius: 2px;
  border: 1px solid var(--hairline-ember);
  background: color-mix(in srgb, var(--midnight) 96%, #fff);
}
.cc-flag-frame .cc-flag-img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
}
.cc-flag-fallback {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 8px;
  letter-spacing: 0.02em;
  color: var(--ember);
  line-height: 1;
}

/* ── country selector dropdown ──────────────────────── */
.rp-modal__form .cc-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  width: min(280px, 86vw);
  max-height: 260px;
  overflow: hidden;
  z-index: 5;
  background: var(--ground-deep);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.9);
}
.rp-modal__form .cc-dropdown.open {
  display: flex;
  flex-direction: column;
}
.rp-modal__form .cc-dropdown .cc-search-wrap {
  padding: 8px;
  background: var(--ground-deep);
  border-bottom: 1px solid var(--hairline);
}
.rp-modal__form .cc-dropdown .cc-search {
  width: 100%;
  background: color-mix(in srgb, var(--midnight) 60%, transparent);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  padding: 7px 9px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.78rem;
  outline: none;
}
.rp-modal__form .cc-dropdown .cc-search:focus {
  border-color: var(--ember);
}
.rp-modal__form .cc-dropdown .cc-search::placeholder {
  color: var(--ink-faint);
}
.rp-modal__form .cc-dropdown .cc-list {
  overflow-y: auto;
}
.rp-modal__form .cc-dropdown .cc-opt {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--parchment) 8%, transparent);
  padding: 8px 10px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.78rem;
  text-align: left;
  cursor: pointer;
}
.rp-modal__form .cc-dropdown .cc-opt:hover {
  background: color-mix(in srgb, #fff 5%, var(--midnight));
}
.rp-modal__form .cc-dropdown .cc-opt .cc-name {
  flex: 1;
}
.rp-modal__form .cc-dropdown .cc-opt .cc-dial {
  color: var(--ink-faint);
}
.rp-modal__form .cc-divider {
  height: 1px;
  background: var(--hairline);
}

/* ── 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(--danger);
  font-family: var(--font-body);
  font-size: 0.72rem;
  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-ember {
  width: 100%;
  justify-content: center;
  margin-top: 13px;
  --_pad-y: 0.8rem;
}
.rp-modal__form .btn-ember.is-loading {
  opacity: 0.6;
  pointer-events: none;
}
.rp-modal__form .lf-error {
  min-height: 0;
  color: var(--danger);
  font-family: var(--font-body);
  font-size: 0.72rem;
}
.rp-modal__form .lf-error:not(:empty) {
  margin-top: 4px;
}
.rp-modal__form .lf-fine {
  font-family: var(--font-body);
  font-weight: 300;
  font-style: italic;
  font-size: 0.6rem;
  color: var(--ink-faint);
  text-align: center;
  margin-top: 9px;
  line-height: 1.4;
}

/* ── Tablet / mobile ──────────────────────────────── */
@media (max-width: 1080px) {
  .rp-modal__panel {
    width: min(48vw, 440px);
  }
}
@media (max-width: 760px) {
  .rp-modal__panel {
    width: min(82vw, 420px);
  }
}
@media (max-width: 480px) {
  .rp-modal {
    padding: 12px;
  }
  .rp-modal__panel {
    width: 100%;
    min-width: 0;
    max-height: min(92vh, 92dvh);
    padding: 22px 18px 15px;
  }
  .rp-modal__header {
    padding-bottom: 11px;
    margin-bottom: 12px;
  }
  .rp-modal__form .lf-field {
    margin-bottom: 7px;
  }
  .rp-modal__form .btn-ember {
    margin-top: 11px;
  }
}
@media (max-height: 640px) {
  .rp-modal__panel {
    padding-top: 18px;
  }
  .rp-modal__header {
    padding-bottom: 10px;
    margin-bottom: 11px;
  }
  .rp-modal__form .lf-field {
    margin-bottom: 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .rp-modal.open,
  .rp-modal__panel {
    animation: none;
  }
}
