  /* ── Reset & tokens ─────────────────────────────── */
  /* Scope the reset to the popup only */
  #popupOverlay *, #popupOverlay *::before, #popupOverlay *::after { box-sizing: border-box; margin: 0; padding: 0; font-family: Arial, Helvetica, sans-serif; }

  /* Scope variables to the popup */
  #popupOverlay {
    --bg-overlay: rgba(0,0,0,.72);
    --panel-bg:   #0d0d0e;
    --border:     rgba(255,255,255,.08);
    --border-focus: rgba(255,255,255,.35);
    --input-bg:   rgba(255,255,255,.055);
    --input-hover:rgba(255,255,255,.085);
    --text:       #f0ede8;
    --muted:      rgba(240,237,232,.45);
    --accent:     #B1E0FA;          /* lime-green punch */
    --accent-dark:#bae4fb;
    --radius-modal: 20px;
    --radius-input: 10px;
    --font-head:  'Syne', sans-serif;
    --font-body:  'DM Sans', sans-serif;
    --transition: .2s ease;
  }


/* ── Overlay ────────────────────────────────────── */
#popupOverlay {
  position: fixed; inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
  overscroll-behavior: none;
}

#popupOverlay.open {
  opacity: 1;
  pointer-events: all;
}

/* ── Modal ──────────────────────────────────────── */
#popupOverlay .popup-modal {
  display: grid;
  grid-template-columns: 420px 1fr;
  width: min(900px, 100%);
  max-height: 94vh;
  background: var(--panel-bg);
  border-radius: var(--radius-modal);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.04);
  transform: translateY(28px) scale(.97);
  transition: transform .35s cubic-bezier(.16,1,.3,1);
  position: relative; /* for abs close btn */
}
#popupOverlay.open .popup-modal {
  transform: translateY(0) scale(1);
}

/* ── Left image panel ───────────────────────────── */
#popupOverlay .popup-image {
  position: relative;
  overflow: hidden;
  min-height: 560px;
}
#popupOverlay .popup-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* placeholder shown when no image is provided */
#popupOverlay .popup-image .img-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(160deg, #1b2838 0%, #2a1f3d 50%, #0f1923 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-family: var(--font-head);
  font-size: 13px;
  letter-spacing: .06em;
  text-transform: uppercase;
}
#popupOverlay .popup-image .img-placeholder svg {
  opacity: .3;
  width: 48px; height: 48px;
}
/* subtle gradient vignette */
#popupOverlay .popup-image::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 60%, var(--panel-bg) 100%),
              linear-gradient(180deg, rgba(0,0,0,.2) 0%, transparent 30%);
  pointer-events: none;
}
/* branding chip */
#popupOverlay .brand-chip {
  position: absolute;
  width: max-content 20px;
  top: 22px; left: 22px;
  z-index: 2;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 8px;
  padding: 7px 14px;
}

/* ── Right form panel ───────────────────────────── */
#popupOverlay .popup-form-panel {
  display: flex;
  flex-direction: column;
  padding: 44px 40px 36px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* close button */
#popupOverlay .close-btn {
  position: absolute;
  top: 18px; right: 18px;
  z-index: 10;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition), color var(--transition);
}
#popupOverlay .close-btn:hover { background: rgba(255,255,255,.12); color: var(--text); }

/* heading */
#popupOverlay .form-heading {
  font-family: var(--font-head);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  color: var(--text);
  line-height: 1.18;
  margin-bottom: 6px;
  letter-spacing: -.02em;
}
#popupOverlay .form-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 28px;
  line-height: 1.5;
}
#popupOverlay .form-sub span { color: var(--accent); }

/* grid rows */
#popupOverlay .form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
#popupOverlay .form-row.full { grid-template-columns: 1fr; }

/* field wrapper */
#popupOverlay .field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
#popupOverlay .field label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color var(--transition);
}
#popupOverlay .field:focus-within label { color: var(--accent); }

#popupOverlay .field input,
#popupOverlay .field select,
#popupOverlay .field textarea {
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  padding: 11px 14px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
}
#popupOverlay .field input::placeholder,
#popupOverlay .field textarea::placeholder { color: rgba(240,237,232,.25); }
#popupOverlay .field input:hover,
#popupOverlay .field select:hover,
#popupOverlay .field textarea:hover { background: var(--input-hover); }
#popupOverlay .field input:focus,
#popupOverlay .field select:focus,
#popupOverlay .field textarea:focus {
  border-color: var(--border-focus);
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 0 3px rgba(200,255,87,.08);
}
#popupOverlay .field input.error,
#popupOverlay .field select.error,
#popupOverlay .field textarea.error {
  border-color: rgba(255,90,90,.5);
  box-shadow: 0 0 0 3px rgba(255,90,90,.08);
}

/* select arrow */
#popupOverlay .select-wrapper { position: relative; }
#popupOverlay .select-wrapper::after {
  content: '';
  position: absolute;
  right: 14px; top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-top-color: var(--muted);
  pointer-events: none;
}
#popupOverlay .field select { padding-right: 36px; cursor: pointer; }
#popupOverlay .field select option { background: #1a1a1e; color: var(--text); }

#popupOverlay .field textarea { resize: vertical; min-height: 88px; }

/* error message */
#popupOverlay .err-msg {
  font-size: 11px;
  color: rgba(255,110,110,.85);
  min-height: 14px;
  display: block;
}

/* required star */
#popupOverlay .req { color: var(--accent); margin-left: 2px; }

/* ── Captcha row ────────────────────────────────── */
#popupOverlay .captcha-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--input-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-input);
  user-select: none;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition);
  margin-bottom: 0;
}
#popupOverlay .captcha-box:hover { background: var(--input-hover); }
#popupOverlay .captcha-box.checked { border-color: var(--border-focus); }
#popupOverlay .captcha-checkbox {
  width: 22px; height: 22px;
  border: 2px solid var(--border-focus);
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: background .15s, border-color .15s;
}
#popupOverlay .captcha-box.checked .captcha-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}
#popupOverlay .captcha-checkbox svg {
  opacity: 0;
  transition: opacity .15s;
  width: 13px; height: 13px;
}
#popupOverlay .captcha-box.checked .captcha-checkbox svg { opacity: 1; }
#popupOverlay .captcha-label {
  font-size: 13px;
  color: var(--muted);
  flex: 1;
}
#popupOverlay .captcha-logo {
  font-family: var(--font-head);
  font-size: 9px;
  font-weight: 700;
  color: rgba(255,255,255,.2);
  text-align: right;
  letter-spacing: .04em;
  line-height: 1.4;
  text-transform: uppercase;
}
#popupOverlay .captcha-err { color: rgba(255,110,110,.85); font-size: 11px; min-height: 14px; }

/* ── Send button ────────────────────────────────── */
#popupOverlay .send-btn {
  margin-top: 18px;
  width: 100%;
  padding: 14px 28px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 50px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: .02em;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: transform .15s, box-shadow .15s, background .15s;
  position: relative;
  overflow: hidden;
}
#popupOverlay .send-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: rgba(0,0,0,.12);
  opacity: 0;
  transition: opacity .15s;
}
#popupOverlay .send-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(87, 247, 255, 0.205); }
#popupOverlay .send-btn:hover::before { opacity: 1; }
#popupOverlay .send-btn:active { transform: translateY(0); }
#popupOverlay .send-btn svg { width: 17px; height: 17px; }

/* ── Success state ──────────────────────────────── */
#popupOverlay .success-screen {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  height: 100%;
  gap: 16px;
  padding: 20px;
}
#popupOverlay .success-screen.show { display: flex; }
#popupOverlay .success-icon {
  width: 64px; height: 64px;
  background: rgba(200,255,87,.12);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--accent);
}
#popupOverlay .success-icon svg { width: 30px; height: 30px; color: var(--accent); }
#popupOverlay .success-title {
  font-family: var(--font-head);
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}
#popupOverlay .success-msg { font-size: 14px; color: var(--muted); line-height: 1.6; max-width: 280px; }
#popupOverlay .success-close {
  margin-top: 8px;
  padding: 11px 30px;
  background: transparent;
  border: 1px solid var(--border-focus);
  border-radius: 50px;
  color: var(--text);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
#popupOverlay .success-close:hover { background: rgba(255,255,255,.07); }

/* ── Responsive ─────────────────────────────────── 
@media (max-width: 700px) {
  #popupOverlay .popup-modal {
    grid-template-columns: 1fr;
    max-height: 92vh;
    max-height: 92dvh;
  }
  #popupOverlay .popup-image { display: none; }
  #popupOverlay .popup-form-panel { padding: 36px 24px 28px; }
  #popupOverlay .form-row { grid-template-columns: 1fr; }
  #popupOverlay .hide-on-mobile {
    display: none !important;
  } */


/* ── Mobile fixes ───────────────────────────────── */
@media (max-width: 700px) {
  #popupOverlay {
    align-items: flex-end;   /* modal colle au bas comme un bottom sheet */
    padding: 0;
  }

  #popupOverlay .popup-modal {
    grid-template-columns: 1fr;
    width: 100%;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;  /* arrondi seulement en haut */
    overflow: hidden;              /* garde le clip du border-radius */
  }

  #popupOverlay .popup-image { display: none; }

  #popupOverlay .popup-form-panel {
    padding: 36px 24px 40px;
    max-height: 92vh;
    max-height: 92dvh;
    overflow-y: auto;             /* scroll DANS le panel */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  #popupOverlay .form-row { grid-template-columns: 1fr; }

  #popupOverlay .hide-on-mobile { display: none !important; }
}