/* ==========================================================================
   Pages d'accès : bandeau mobile/tablette, encart « Nouveau commerçant »,
   notification de bienvenue (carte flottante sur PC/tablette, panneau bas sur téléphone)
   ========================================================================== */

/* ---------- Bandeau compact (téléphone & tablette, la colonne bleue étant masquée) ---------- */
.auth-hero {
  position: relative; overflow: hidden; border-radius: 1.1rem; padding: 1.1rem 1.15rem 1rem;
  margin-bottom: 1.6rem; color: #fff;
  background: radial-gradient(120% 120% at 0% 0%, #2a4fd0 0%, #0c1631 70%);
}
.auth-hero::after {
  content: ''; position: absolute; width: 180px; height: 180px; right: -60px; top: -70px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,.45), transparent 70%);
}
.auth-hero .brand-name { color: #fff; }
.auth-hero p { color: #cdd6f8; font-size: .85rem; margin: .55rem 0 .8rem; position: relative; z-index: 1; }
.auth-chips { display: flex; gap: .45rem; overflow-x: auto; scrollbar-width: none; position: relative; z-index: 1; margin: 0 -.15rem; padding: 0 .15rem; }
.auth-chips::-webkit-scrollbar { display: none; }
.auth-chips span {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: .35rem; font-size: .76rem; font-weight: 600;
  padding: .32rem .65rem; border-radius: 99px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.14);
}
.auth-chips i { color: var(--hms-accent); }

/* ---------- Encart « Nouveau commerçant » sous le formulaire ---------- */
.new-shop {
  margin-top: 1.75rem; border-radius: 1rem; padding: 1.15rem 1.2rem; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #fff7e8 0%, #fff 55%); border: 1px solid #fde4b4;
}
.new-shop::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 4px; background: linear-gradient(var(--hms-accent), #f97316); }
.new-shop-title { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--hms-ink); margin-bottom: .2rem; }
.new-shop-title .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #fff0d1; color: #c2680a; flex-shrink: 0; }
.new-shop-steps { list-style: none; padding: 0; margin: .85rem 0 1rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; }
.new-shop-steps li { background: #fff; border: 1px solid var(--hms-border); border-radius: .75rem; padding: .6rem .55rem; font-size: .76rem; line-height: 1.3; color: var(--hms-muted); }
.new-shop-steps b { display: flex; align-items: center; gap: .35rem; color: var(--hms-ink); font-size: .8rem; margin-bottom: .15rem; }
.new-shop-steps .n { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; background: var(--hms-primary); color: #fff; flex-shrink: 0; }
.btn-shop {
  --c1: #f59e0b; --c2: #f97316;
  background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; border: 0; font-weight: 700;
  box-shadow: 0 8px 20px -8px rgba(249,115,22,.7); transition: transform .15s ease, box-shadow .15s ease;
}
.btn-shop:hover, .btn-shop:focus-visible { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(249,115,22,.85); }
.trust { display: flex; flex-wrap: wrap; gap: .3rem 1rem; justify-content: center; margin-top: .7rem; font-size: .74rem; color: var(--hms-muted); }
.trust i { color: #16a34a; }

@media (max-width: 420px) {
  .new-shop-steps { grid-template-columns: 1fr; }
  .new-shop-steps li { display: flex; gap: .55rem; align-items: flex-start; }
  .new-shop-steps b { margin: 0; }
}

/* ---------- Étapes en tête de l'inscription (téléphone & tablette) ---------- */
.reg-steps { display: flex; gap: .4rem; margin-bottom: 1.4rem; }
.reg-steps div { flex: 1; text-align: center; font-size: .72rem; color: var(--hms-muted); }
.reg-steps i { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto .3rem; border-radius: 11px; background: #eef2ff; color: var(--hms-primary); font-size: 1rem; }
.reg-steps div:first-child i { background: var(--hms-primary); color: #fff; }

/* ---------- Notification de bienvenue ---------- */
.hw { position: fixed; inset: 0; z-index: 1080; pointer-events: none; }
.hw[hidden] { display: none; }
.hw-backdrop { position: absolute; inset: 0; background: rgba(11,20,48,.5); backdrop-filter: blur(2px); opacity: 0; transition: opacity .3s ease; display: none; }
.hw-card {
  position: absolute; top: 1.25rem; right: 1.25rem; width: min(400px, calc(100vw - 2rem));
  background: #fff; border-radius: 1.25rem; overflow: hidden; pointer-events: auto;
  box-shadow: 0 30px 60px -20px rgba(11,20,48,.45), 0 0 0 1px rgba(11,20,48,.05);
  transform: translateY(-14px) scale(.97); opacity: 0;
  transition: transform .45s cubic-bezier(.2,.9,.25,1.15), opacity .3s ease;
}
.hw.is-open .hw-card { transform: none; opacity: 1; }
.hw-head {
  position: relative; padding: 1.15rem 1.25rem 1.1rem; color: #fff; overflow: hidden;
  background: radial-gradient(120% 140% at 0% 0%, #2f5ae6 0%, #0c1631 75%);
}
.hw-head::after {
  content: ''; position: absolute; width: 200px; height: 200px; right: -70px; bottom: -110px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,158,11,.55), transparent 70%);
}
.hw-badge {
  display: inline-flex; align-items: center; gap: .35rem; font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .25rem .6rem; border-radius: 99px; background: rgba(255,255,255,.14); color: #ffd98a; position: relative; z-index: 1;
}
.hw-badge .dot { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 0 rgba(34,197,94,.6); animation: hwPulse 1.8s infinite; }
.hw-row { display: flex; gap: .9rem; align-items: center; margin-top: .75rem; position: relative; z-index: 1; }
.hw-ico {
  width: 52px; height: 52px; border-radius: 15px; flex-shrink: 0; display: grid; place-items: center; font-size: 1.55rem;
  background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 10px 22px -8px rgba(249,115,22,.9);
  animation: hwFloat 3.2s ease-in-out infinite;
}
.hw-title { font-family: 'Jakarta', 'Inter', sans-serif; font-weight: 800; font-size: 1.15rem; line-height: 1.2; margin: 0; }
.hw-sub { font-size: .8rem; color: #cdd6f8; margin-top: .2rem; }
.hw-close {
  position: absolute; top: .7rem; right: .7rem; z-index: 2; width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.12); color: #fff; display: grid; place-items: center; transition: background .15s;
}
.hw-close:hover, .hw-close:focus-visible { background: rgba(255,255,255,.25); }
.hw-body { padding: 1rem 1.25rem 1.15rem; }
.hw-steps { list-style: none; margin: 0 0 1rem; padding: 0; position: relative; }
.hw-steps::before { content: ''; position: absolute; left: 15px; top: 18px; bottom: 18px; width: 2px; background: linear-gradient(var(--hms-primary), #f59e0b); opacity: .25; }
.hw-steps li { display: flex; gap: .75rem; align-items: flex-start; padding: .38rem 0; opacity: 0; transform: translateX(10px); }
.hw.is-open .hw-steps li { animation: hwIn .45s ease forwards; }
.hw.is-open .hw-steps li:nth-child(1) { animation-delay: .2s; }
.hw.is-open .hw-steps li:nth-child(2) { animation-delay: .32s; }
.hw.is-open .hw-steps li:nth-child(3) { animation-delay: .44s; }
.hw-steps .n { width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; background: #eef2ff; color: var(--hms-primary); font-size: 1rem; position: relative; z-index: 1; }
.hw-steps li:last-child .n { background: #ecfdf3; color: #16a34a; }
.hw-steps strong { display: block; font-size: .86rem; color: var(--hms-ink); }
.hw-steps span { font-size: .78rem; color: var(--hms-muted); line-height: 1.35; }
.hw-actions { display: grid; gap: .45rem; }
.hw-actions .btn { padding: .65rem 1rem; border-radius: .8rem; }
.hw-foot { display: flex; justify-content: center; gap: .9rem; flex-wrap: wrap; margin-top: .75rem; font-size: .72rem; color: var(--hms-muted); }
.hw-foot i { color: #16a34a; }

/* Téléphone : panneau qui monte du bas, avec fond assombri */
@media (max-width: 575.98px) {
  .hw-backdrop { display: block; pointer-events: auto; }
  .hw.is-open .hw-backdrop { opacity: 1; }
  .hw-card {
    top: auto; right: 0; left: 0; bottom: 0; width: 100%; border-radius: 1.4rem 1.4rem 0 0;
    transform: translateY(100%); opacity: 1; max-height: 92vh; overflow-y: auto;
    transition: transform .42s cubic-bezier(.2,.9,.3,1);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .hw-head { padding-top: 1.5rem; }
  .hw-head::before { content: ''; position: absolute; top: .55rem; left: 50%; width: 42px; height: 4px; margin-left: -21px; border-radius: 4px; background: rgba(255,255,255,.35); z-index: 2; }
  .hw-actions .btn { padding: .8rem 1rem; font-size: 1rem; }
}

/* Petit rappel discret quand la notification a été fermée */
.hw-pill {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 1070; display: inline-flex; align-items: center; gap: .45rem;
  padding: .55rem .95rem; border-radius: 99px; font-size: .82rem; font-weight: 700; color: #fff; border: 0;
  background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 12px 26px -10px rgba(249,115,22,.9);
  transform: translateY(150%); transition: transform .4s cubic-bezier(.2,.9,.25,1.15);
}
.hw-pill.show { transform: none; }
.hw-pill:hover { color: #fff; }

@keyframes hwPulse { 70% { box-shadow: 0 0 0 7px rgba(34,197,94,0); } 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); } }
@keyframes hwFloat { 50% { transform: translateY(-4px) rotate(-3deg); } }
@keyframes hwIn { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .hw-card, .hw-backdrop, .hw-pill { transition: none; }
  .hw-ico, .hw-badge .dot { animation: none; }
  .hw.is-open .hw-steps li { animation: none; opacity: 1; transform: none; }
}

/* Empêche le bandeau défilant d'élargir la page sur téléphone */
.auth-wrap { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-form .inner { min-width: 0; }
@media (max-width: 991.98px) {
  .auth-wrap { grid-template-columns: minmax(0, 1fr); }
  .auth-form { padding: 1.25rem 1rem 2rem; align-items: flex-start; }
}
@media (min-width: 576px) and (max-width: 991.98px) {
  .auth-form { align-items: center; padding: 2.5rem 1.5rem; background: var(--hms-bg); }
  .auth-form .inner { max-width: 480px; background: #fff; border-radius: 1.4rem; padding: 1.6rem; box-shadow: 0 20px 50px -25px rgba(11,20,48,.35); }
}

/* PC : la carte se pose sur la colonne de présentation, sans jamais masquer le formulaire */
@media (min-width: 992px) {
  .hw-card { top: auto; right: auto; left: 2.5rem; bottom: 2rem; transform: translateY(18px) scale(.97); }
}
/* Tablette : carte centrée en bas de l'écran, fond assombri comme une alerte */
@media (min-width: 576px) and (max-width: 991.98px) {
  .hw-backdrop { display: block; pointer-events: auto; }
  .hw.is-open .hw-backdrop { opacity: 1; }
  .hw-card { top: auto; right: auto; left: 50%; bottom: 1.5rem; width: min(480px, calc(100vw - 3rem)); transform: translate(-50%, 24px) scale(.97); }
  .hw.is-open .hw-card { transform: translate(-50%, 0); }
}

/* ---------- Code de parrainage (inscription) ---------- */
.ref-box { border: 1px dashed #f5b25c; background: linear-gradient(135deg, #fff9ef, #fff); border-radius: 14px; overflow: hidden; transition: border-color .2s, box-shadow .2s; }
.ref-box.open { border-style: solid; box-shadow: 0 8px 24px -16px rgba(249,115,22,.6); }
.ref-toggle { width: 100%; display: flex; align-items: center; gap: .75rem; padding: .75rem .9rem; background: none; border: 0; color: var(--hms-ink); }
.ref-toggle small { display: block; color: var(--hms-muted); font-size: .76rem; line-height: 1.3; margin-top: .1rem; }
.ref-gift { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex-shrink: 0; color: #fff; font-size: 1.1rem; background: linear-gradient(135deg, #f59e0b, #f97316); box-shadow: 0 6px 14px -6px rgba(249,115,22,.8); }
.ref-chev { color: var(--hms-muted); transition: transform .25s; }
.ref-box.open .ref-chev { transform: rotate(180deg); }
.ref-panel { display: none; padding: 0 .9rem .9rem; }
.ref-box.open .ref-panel { display: block; animation: ref-in .25s ease; }
@keyframes ref-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ref-input { position: relative; }
.ref-input input { text-transform: uppercase; letter-spacing: .12em; font-weight: 700; padding-right: 2.6rem; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.ref-input input::placeholder { letter-spacing: .04em; font-weight: 400; text-transform: none; font-family: inherit; }
.ref-state { position: absolute; right: .8rem; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; display: grid; place-items: center; font-size: 1.15rem; }
.ref-input.is-loading .ref-state::after { content: ''; width: 16px; height: 16px; border-radius: 50%; border: 2px solid #f5b25c; border-top-color: transparent; animation: ref-spin .7s linear infinite; }
.ref-input.is-ok input { border-color: #16a34a; box-shadow: 0 0 0 .2rem rgba(22,163,74,.15); }
.ref-input.is-ok .ref-state::after { content: '\F26A'; font-family: bootstrap-icons; color: #16a34a; }
.ref-input.is-bad input { border-color: #dc2626; box-shadow: 0 0 0 .2rem rgba(220,38,38,.12); }
.ref-input.is-bad .ref-state::after { content: '\F622'; font-family: bootstrap-icons; color: #dc2626; }
.ref-msg { font-size: .8rem; margin-top: .35rem; min-height: 1.1em; color: var(--hms-muted); }
.ref-msg.ok { color: #15803d; font-weight: 600; } .ref-msg.bad { color: #b91c1c; } .ref-msg.warn { color: #b45309; }
.ref-msg.ok::before { content: '\F4D5'; margin-right: .35rem; font-family: bootstrap-icons; }
@keyframes ref-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ref-box.open .ref-panel { animation: none; } .ref-chev { transition: none; } }
