/* ============================================================
   BELIER SHOPPING — Habillage des connexions (tous les espaces sauf Direction)
   Toutes les règles sont limitées à .bsa-auth / .bsa-sec / .bsa-reset :
   aucun style global n'est modifié.
   ============================================================ */

.bsa-auth,
.bsa-sec,
.bsa-reset {
  --bsa-navy-1: #143a86;
  --bsa-navy-2: #0b2559;
  --bsa-navy-3: #050e24;
  --bsa-gold: #f5810a;
  --bsa-gold-2: #ffa23c;
  --bsa-ink: #101826;
  --bsa-slate: #4b5670;
  --bsa-line: #dce3f2;
  --bsa-soft: #f2f6ff;
  --bsa-ok: #1f7a4c;
  --bsa-bad: #c6303e;
}

/* ---------- Carte / modale ---------- */
.bsa-auth.bsa-card,
.bsa-auth.bsa-modal {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 26px 70px rgba(5, 14, 36, .34);
  animation: bsaRise .42s cubic-bezier(.2, .8, .2, 1) both;
}
.bsa-auth.bsa-modal,
.bsa-auth.bsa-card {
  padding: 0;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  background: #fff;
}
/* Le long formulaire de création de compte défile DANS la carte, pas dans la page. */
.bsa-auth.bsa-card .form-card-head {
  position: sticky;
  top: 0;
  z-index: 3;
}
.bsa-auth.bsa-modal { max-width: 470px; }
.bsa-auth.bsa-modal .modal-bg { background: rgba(5, 14, 36, .68); }

.bsa-auth .bsa-head {
  position: relative;
  overflow: hidden;
  padding: 26px 28px 22px;
  color: #fff;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(245, 129, 10, .28) 0%, transparent 52%),
    linear-gradient(155deg, var(--bsa-navy-1) 0%, var(--bsa-navy-2) 62%, var(--bsa-navy-3) 100%);
}
.bsa-auth .bsa-head::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -90px;
  width: 210px;
  height: 210px;
  border: 18px solid rgba(245, 129, 10, .32);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(-18deg);
  pointer-events: none;
}
.bsa-auth .bsa-head .eyebrow {
  position: relative;
  z-index: 1;
  color: var(--bsa-gold-2);
  letter-spacing: .2em;
}
.bsa-auth .bsa-head h2,
.bsa-auth .bsa-head h3 {
  position: relative;
  z-index: 1;
  margin: 7px 0 0;
  color: #fff;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 23px;
  line-height: 1.2;
  letter-spacing: -.015em;
  font-weight: 800;
}
.bsa-auth .bsa-head p {
  position: relative;
  z-index: 1;
  margin: 9px 0 0;
  max-width: 34ch;
  color: rgba(255, 255, 255, .76);
  font-size: 12.8px;
  line-height: 1.55;
}
.bsa-auth .bsa-head .bsa-mark {
  position: absolute;
  right: 22px;
  bottom: -12px;
  width: 64px;
  height: 64px;
  opacity: .16;
  z-index: 0;
  pointer-events: none;
}
.bsa-auth .bsa-body { padding: 22px 28px 28px; }
.bsa-auth.bsa-modal .bsa-body { padding: 20px 24px 24px; }

/* La carte commerçant / livreur / commercial garde son en-tête existant,
   mais reçoit le même traitement visuel. */
.bsa-auth.bsa-card .form-card-head {
  padding: 26px 28px 22px;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(245, 129, 10, .28) 0%, transparent 52%),
    linear-gradient(155deg, var(--bsa-navy-1) 0%, var(--bsa-navy-2) 62%, var(--bsa-navy-3) 100%);
}
.bsa-auth.bsa-card .form-card-head::after {
  width: 190px;
  height: 190px;
  right: -62px;
  top: -74px;
  background: none;
  border: 18px solid rgba(245, 129, 10, .32);
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius: 50%;
  transform: rotate(-18deg);
}
.bsa-auth.bsa-card .form-card-head .eyebrow { color: var(--bsa-gold-2); }
.bsa-auth.bsa-card .form-card-head h2,
.bsa-auth.bsa-card .form-card-head h3 {
  color: #fff;
  font-family: var(--sans, system-ui, sans-serif);
  font-size: 25px;
  letter-spacing: -.015em;
}
.bsa-auth.bsa-card .form-card-head p { color: rgba(255, 255, 255, .78); }
.bsa-auth.bsa-card .form-card-head .head-rule {
  width: 46px;
  height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--bsa-gold), var(--bsa-gold-2));
}
.bsa-auth.bsa-card .form-card-body { padding: 24px 28px 30px; }

/* ---------- Onglets ---------- */
.bsa-auth .tabs {
  display: flex;
  gap: 4px;
  padding: 5px;
  margin-bottom: 20px;
  background: var(--bsa-soft);
  border: 1px solid var(--bsa-line);
  border-radius: 14px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}
.bsa-auth .tabs::-webkit-scrollbar { display: none; }
.bsa-auth .tab {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--bsa-slate);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.bsa-auth .tab:hover { color: var(--bsa-ink); background: rgba(20, 58, 134, .06); }
.bsa-auth .tab.active {
  color: var(--bsa-ink);
  background: linear-gradient(135deg, var(--bsa-gold), var(--bsa-gold-2));
  box-shadow: 0 5px 14px rgba(245, 129, 10, .32);
}
.bsa-auth .tab:focus-visible {
  outline: 2px solid var(--bsa-gold);
  outline-offset: 2px;
}

/* ---------- Champs ---------- */
.bsa-auth .field { margin-bottom: 15px; }
.bsa-auth .field label {
  display: block;
  margin-bottom: 6px;
  color: var(--bsa-slate);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.bsa-auth .field-input-wrap {
  border: 1.5px solid var(--bsa-line);
  border-radius: 12px;
  background: #fff;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.bsa-auth .field-input-wrap:focus-within {
  border-color: var(--bsa-gold);
  box-shadow: 0 0 0 4px rgba(245, 129, 10, .14);
}
.bsa-auth .field-input-wrap .field-icon {
  width: 44px;
  background: transparent;
  color: var(--bsa-navy-2);
  font-size: 15px;
  opacity: .8;
}
.bsa-auth .field-input-wrap input,
.bsa-auth .field-input-wrap select,
.bsa-auth .field-input-wrap textarea {
  padding: 13px 13px 13px 0;
  font-size: 14.5px;
  color: var(--bsa-ink);
}
.bsa-auth .field-input-wrap .pw-toggle {
  width: 44px;
  border-left: 1px solid rgba(220, 227, 242, .7);
  font-size: 15px;
  opacity: .72;
  transition: opacity .18s ease, background .18s ease;
}
.bsa-auth .field-input-wrap .pw-toggle:hover,
.bsa-auth .field-input-wrap .pw-toggle:focus-visible {
  opacity: 1;
  background: rgba(245, 129, 10, .08);
  outline: none;
}
.bsa-auth .field > input,
.bsa-auth .field > select,
.bsa-auth .field > textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--bsa-line);
  border-radius: 12px;
  font-size: 14.5px;
  background: #fff;
  color: var(--bsa-ink);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.bsa-auth .field > input:focus,
.bsa-auth .field > select:focus,
.bsa-auth .field > textarea:focus {
  outline: none;
  border-color: var(--bsa-gold);
  box-shadow: 0 0 0 4px rgba(245, 129, 10, .14);
}

/* ---------- Boutons et liens ---------- */
.bsa-auth .bsa-submit {
  width: 100%;
  padding: 13px 20px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--bsa-gold), var(--bsa-gold-2));
  color: #1b1405;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .01em;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(245, 129, 10, .3);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.bsa-auth .bsa-submit:hover { transform: translateY(-1px); box-shadow: 0 13px 30px rgba(245, 129, 10, .38); }
.bsa-auth .bsa-submit:active { transform: translateY(0) scale(.995); }
.bsa-auth .bsa-submit:disabled { opacity: .55; cursor: wait; transform: none; box-shadow: none; }
.bsa-auth .bsa-submit:focus-visible { outline: 2px solid var(--bsa-navy-2); outline-offset: 3px; }

.bsa-auth .bsa-link,
.bsa-reset .bsa-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--bsa-navy-1);
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 1px solid rgba(20, 58, 134, .25);
  transition: color .16s ease, border-color .16s ease;
}
.bsa-auth .bsa-link:hover,
.bsa-reset .bsa-link:hover { color: var(--bsa-gold); border-color: var(--bsa-gold); }

.bsa-auth .bsa-alt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.bsa-auth .bsa-alt .bsa-link { font-size: 12px; }

.bsa-auth .bsa-check {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 2px 0 16px;
  color: var(--bsa-slate);
  font-size: 12.5px;
  line-height: 1.45;
  cursor: pointer;
  user-select: none;
}
.bsa-auth .bsa-check input[type="checkbox"] {
  flex: none;
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--bsa-gold);
  cursor: pointer;
}
.bsa-auth .bsa-check a { color: var(--bsa-gold); font-weight: 700; }

.bsa-auth .bsa-note {
  margin: 10px 0 0;
  color: var(--bsa-slate);
  font-size: 11.5px;
  line-height: 1.55;
}
.bsa-auth .bsa-note b { color: var(--bsa-ink); }

.bsa-auth .bsa-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 14px;
  color: var(--bsa-slate);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .12em;
}
.bsa-auth .bsa-divider::before,
.bsa-auth .bsa-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--bsa-line);
}

.bsa-auth .google-auth-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border: 1.5px solid var(--bsa-line);
  border-radius: 13px;
  background: #fff;
  color: var(--bsa-ink);
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}
.bsa-auth .google-auth-btn:hover { border-color: #c9d4ea; background: #f8faff; }

/* ---------- Alertes / étapes ---------- */
.bsa-auth .bsa-alert,
.bsa-reset .bsa-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid var(--bsa-line);
  background: var(--bsa-soft);
  color: var(--bsa-slate);
  font-size: 12.5px;
  line-height: 1.55;
}
.bsa-auth .bsa-alert.warn,
.bsa-reset .bsa-alert.warn {
  border-color: rgba(198, 48, 62, .28);
  background: #fdf1f2;
  color: #8d1f2b;
}
.bsa-auth .bsa-alert.ok,
.bsa-reset .bsa-alert.ok {
  border-color: rgba(31, 122, 76, .26);
  background: #eef9f2;
  color: #14603a;
}
.bsa-auth .bsa-alert b,
.bsa-reset .bsa-alert b { color: inherit; }

.bsa-auth .bsa-step,
.bsa-reset .bsa-step { animation: bsaFade .28s ease both; }

/* ---------- Code de secours ---------- */
.bsa-code {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 12px;
  border: 1.5px dashed rgba(245, 129, 10, .5);
  background: rgba(245, 129, 10, .07);
  color: var(--bsa-navy-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: .09em;
  user-select: all;
  word-break: break-all;
}
.bsa-code-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0 16px;
}
.bsa-code-list code {
  padding: 8px 10px;
  border-radius: 9px;
  background: var(--bsa-soft);
  border: 1px solid var(--bsa-line);
  color: var(--bsa-navy-2);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
  user-select: all;
}

/* ---------- QR double authentification ---------- */
.bsa-qr {
  display: flex;
  justify-content: center;
  padding: 12px;
  margin: 4px 0 14px;
  border: 1px solid var(--bsa-line);
  border-radius: 14px;
  background: #fff;
}
.bsa-qr svg { width: 168px; height: 168px; display: block; }
.bsa-secret {
  display: block;
  padding: 9px 12px;
  margin: 8px 0 14px;
  border-radius: 9px;
  background: var(--bsa-soft);
  border: 1px solid var(--bsa-line);
  color: var(--bsa-navy-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  letter-spacing: .08em;
  word-break: break-all;
  user-select: all;
}

/* ---------- Réglages de sécurité (dans Mon compte) ---------- */
.bsa-sec {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--bsa-line);
  border-radius: 14px;
  background: #fff;
}
.bsa-sec h4 {
  margin: 0 0 4px;
  color: var(--bsa-ink);
  font-size: 15px;
  font-weight: 800;
}
.bsa-sec p {
  margin: 0 0 12px;
  color: var(--bsa-slate);
  font-size: 12.5px;
  line-height: 1.55;
}
.bsa-sec .bsa-sec-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--bsa-line);
  flex-wrap: wrap;
}
.bsa-sec .bsa-sec-row:first-of-type { border-top: 0; padding-top: 4px; }
.bsa-sec .bsa-sec-info { min-width: 0; flex: 1 1 210px; }
.bsa-sec .bsa-sec-info b { display: block; color: var(--bsa-ink); font-size: 13px; }
.bsa-sec .bsa-sec-info span { display: block; margin-top: 2px; color: var(--bsa-slate); font-size: 11.5px; line-height: 1.45; }
.bsa-sec .bsa-sec-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.bsa-sec .bsa-sec-btn {
  padding: 8px 13px;
  border-radius: 10px;
  border: 1.5px solid var(--bsa-line);
  background: #fff;
  color: var(--bsa-ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.bsa-sec .bsa-sec-btn:hover { border-color: var(--bsa-gold); color: var(--bsa-navy-2); background: rgba(245, 129, 10, .06); }
.bsa-sec .bsa-sec-btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--bsa-gold), var(--bsa-gold-2));
  color: #1b1405;
  box-shadow: 0 6px 16px rgba(245, 129, 10, .26);
}
.bsa-sec .bsa-sec-btn.danger { border-color: rgba(198, 48, 62, .3); color: var(--bsa-bad); }
.bsa-sec .bsa-sec-btn.danger:hover { background: #fdf1f2; border-color: var(--bsa-bad); }
.bsa-sec .bsa-sec-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.bsa-sec .bsa-sec-state.on { background: #eef9f2; color: var(--bsa-ok); }
.bsa-sec .bsa-sec-state.off { background: #f2f4f9; color: var(--bsa-slate); }

/* ---------- Animations ---------- */
@keyframes bsaRise {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes bsaFade {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 520px) {
  .bsa-auth.bsa-card .form-card-head,
  .bsa-auth .bsa-head { padding: 22px 20px 18px; }
  .bsa-auth.bsa-card .form-card-body,
  .bsa-auth .bsa-body { padding: 20px 20px 24px; }
  .bsa-auth.bsa-modal .bsa-body { padding: 18px 18px 20px; }
  .bsa-auth .bsa-head h2,
  .bsa-auth .bsa-head h3 { font-size: 21px; }
  .bsa-auth.bsa-card .form-card-head h2,
  .bsa-auth.bsa-card .form-card-head h3 { font-size: 22px; }
  .bsa-code-list { grid-template-columns: 1fr; }
  .bsa-auth .tabs { gap: 3px; }
  .bsa-auth .tab { flex: 0 0 auto; white-space: nowrap; font-size: 11.5px; padding: 8px 9px; }
  #mAuthTabs .tab-lg { display: none; }
  #mAuthTabs .tab-sm { display: inline; }
}

@media (prefers-reduced-motion: reduce) {
  .bsa-auth,
  .bsa-auth *,
  .bsa-reset,
  .bsa-reset *,
  .bsa-sec,
  .bsa-sec * {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
