/*
 * Shared country-picker styles for offshore.html / onshore.html.
 * Mirrors the React FirstQuestion picker (mobile bottom-sheet,
 * desktop centered modal, search input, country list with flags).
 *
 * Re-uses CSS variables defined on :root in the parent page
 * (--primary, --border, --text, --muted, --safe-bottom, ...).
 */

/* ── Picker card (lives inside the hero) ─────────────────────────── */
.cp-card {
  background: var(--bg, #fff);
  border: 1px solid var(--border, #ebebeb);
  border-radius: 16px;
  padding: 20px;
  margin: 20px auto 0;
  max-width: 440px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.cp-card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  margin-bottom: 12px;
}

/* ── Trigger button (the "Select your country..." pill) ──────────── */
.cp-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 16px;
  background: var(--card, #f7f7f8);
  border: 1px solid var(--border, #ebebeb);
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  color: var(--text, #1a1a1a);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s;
}
.cp-trigger:hover {
  border-color: var(--border-hover, #d0d0d0);
}
.cp-trigger:focus-visible {
  outline: none;
  border-color: var(--primary, #e85d00);
  box-shadow: 0 0 0 3px rgba(232, 93, 0, 0.15);
}
.cp-trigger-label {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cp-trigger-flag {
  font-size: 20px;
  line-height: 1;
}
.cp-trigger.is-empty .cp-trigger-label {
  color: var(--faint, #999);
}
.cp-trigger-chevron {
  width: 18px;
  height: 18px;
  color: var(--muted, #6b6b6b);
  flex-shrink: 0;
}

/* ── Submit CTA ──────────────────────────────────────────────────── */
.cp-submit {
  display: block;
  width: 100%;
  margin-top: 14px;
  padding: 14px 24px;
  background: var(--primary, #e85d00);
  color: #fff;
  border: none;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, transform 0.05s;
}
.cp-submit:hover:not(:disabled) {
  background: var(--primary-hover, #d45500);
}
.cp-submit:active:not(:disabled) {
  transform: scale(0.98);
}
.cp-submit:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Backdrop & overlay container ────────────────────────────────── */
.cp-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}
.cp-overlay.is-open {
  display: block;
}
.cp-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  animation: cp-fade-in 0.2s ease;
}
@keyframes cp-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Mobile: bottom-sheet drawer (default) ───────────────────────── */
.cp-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-bottom, 0px);
  animation: cp-slide-up 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes cp-slide-up {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.cp-handle {
  width: 36px;
  height: 4px;
  background: #d0d0d0;
  border-radius: 2px;
  margin: 10px auto 4px;
  flex-shrink: 0;
}

/* ── Desktop: centered modal (≥640px) ────────────────────────────── */
@media (min-width: 640px) {
  .cp-panel {
    position: absolute;
    top: 50%;
    left: 50%;
    bottom: auto;
    right: auto;
    transform: translate(-50%, -50%);
    width: min(440px, calc(100vw - 32px));
    max-height: 80vh;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: cp-fade-scale 0.2s ease;
  }
  @keyframes cp-fade-scale {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
    to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  }
  .cp-handle {
    display: none;
  }
}

/* ── Header (title + close button) ───────────────────────────────── */
.cp-header {
  padding: 12px 20px 8px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.cp-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text, #1a1a1a);
  margin: 0 0 2px;
}
.cp-subtitle {
  font-size: 13px;
  color: var(--muted, #6b6b6b);
  margin: 0;
}
.cp-close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 50%;
  color: var(--muted, #6b6b6b);
  cursor: pointer;
  flex-shrink: 0;
}
.cp-close:hover {
  background: var(--card, #f7f7f8);
  color: var(--text, #1a1a1a);
}
.cp-close svg {
  width: 18px;
  height: 18px;
}

/* ── Search input ────────────────────────────────────────────────── */
.cp-search-wrap {
  padding: 8px 16px 4px;
  flex-shrink: 0;
}
.cp-search {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  font-size: 15px;
  color: var(--text, #1a1a1a);
  background: var(--card, #f7f7f8);
  border: 1px solid var(--border, #ebebeb);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.cp-search::placeholder {
  color: var(--faint, #999);
}
.cp-search:focus {
  background: #fff;
  border-color: var(--primary, #e85d00);
  box-shadow: 0 0 0 3px rgba(232, 93, 0, 0.15);
}

/* ── Scrollable country list ─────────────────────────────────────── */
.cp-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 12px;
  flex: 1 1 auto;
  min-height: 0;
}
.cp-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 20px;
  background: transparent;
  border: none;
  font: inherit;
  font-size: 15px;
  color: var(--text, #1a1a1a);
  text-align: left;
  cursor: pointer;
  transition: background 0.1s;
}
.cp-item:hover {
  background: var(--card, #f7f7f8);
}
.cp-item.is-active {
  background: rgba(232, 93, 0, 0.08);
  color: var(--primary, #e85d00);
}
.cp-item-flag {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.cp-empty {
  padding: 32px 20px;
  text-align: center;
  font-size: 14px;
  color: var(--faint, #999);
}

/* ── A11y: prevent body scroll when overlay is open ──────────────── */
body.cp-locked {
  overflow: hidden;
}
