/* ==========================================================================
   Thirdslot — account pages (connexion, reinitialiser, inscription)
   Loaded AFTER css/site.css (landing tokens + components).
   Every state class used by the scripts is styled here:
     .pane/.on  .formerr/.on/.warn  .noticebox/.on  .okbox/.on  .payerr/.on
     .err  .showerr  .spin  .sel  .done  .step/.on  [hidden]  .toast/.err/.ok
   ========================================================================== */

/* ---------- Legacy aliases (used by inline SVGs injected from JS) ---------- */
:root {
  --green: #1faa6b;
  --green-tint: #e5f6ee;
  --green-ink: #13804f;
  --red-tint: #fdf0f0;
  --red-ink: #a31919;
  --ink-soft: #4f4f4f;
  --ink-muted: #6e6e7a;
  --violet: #4a46d3;
  --violet-tint: #ededf4;
  --violet-deep: #3a36b8;
  --surface: #fff;
  --surface-alt: #f6f6fa;

  --ok-bg: #e5f6ee;
  --ok-ink: #13804f;
  --err-bg: #fdf0f0;
  --err-line: #f6d2d2;
  --err-ink: #b01c1c;
  --warn-bg: #fdf4e3;
  --warn-line: #f2e0b8;
  --warn-ink: #7a4a0c;
  --ring: 0 0 0 4px rgba(74, 70, 211, 0.12);
  --ring-err: 0 0 0 4px rgba(237, 29, 29, 0.1);
}

/* ---------- Base ---------- */
[hidden] { display: none !important; }
body.auth {
  font-size: 16px;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
.auth h1, .auth h2 { font-family: var(--font-head); color: var(--ink); letter-spacing: -0.01em; }
.auth b, .auth strong { color: var(--ink); font-weight: 600; }
.auth main a:not(.btn), .auth .footlinks a { color: var(--primary); font-weight: 500; }
.auth main a:not(.btn):hover { text-decoration: underline; text-underline-offset: 3px; }
.auth .lead { font-size: 16px; line-height: 1.6; color: var(--text); }
.auth .small { font-size: 13.5px; color: var(--ink-muted); }
.auth .mono { font-family: var(--font-head); font-variant-numeric: tabular-nums; }
.auth svg { flex: none; }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 600; font-size: 14px;
}
.skip-link:focus { top: 12px; }

/* Gradient underline on a key word (landing H1) */
.ul { position: relative; display: inline-block; padding-bottom: 4px; }
.ul::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; border-radius: 2px;
  background: var(--grad-underline); transform-origin: left center;
  animation: draw 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) 0.25s both;
}

/* ---------- Buttons ---------- */
.auth .btn { height: 50px; border-radius: var(--radius-sm); font-size: 15.5px; padding: 0 22px; }
.auth .btn:not(.btn-primary):not(.btn-violet) { color: var(--ink); background: var(--lavender-4); }
.auth .btn:not(.btn-primary):not(.btn-violet):hover { background: #dcdcf0; }
.auth .btn-violet { color: #fff; background: var(--grad-btn); box-shadow: var(--shadow-btn); }
.auth .btn-violet:hover { transform: translateY(-2px); box-shadow: 0 14px 28px rgba(74, 70, 211, 0.4); }
.auth .btn[disabled] { opacity: 0.6; cursor: not-allowed; transform: none; }
.auth .btn-block { width: 100%; }
.spin {
  display: inline-block; width: 15px; height: 15px; flex: none;
  border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #fff; border-radius: 50%;
  animation: authSpin 0.7s linear infinite; vertical-align: -2px;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* ---------- Fields ---------- */
.auth .field { margin-bottom: 16px; }
.auth .field label {
  display: flex; align-items: center; gap: 6px;
  margin-bottom: 7px; font-weight: 600; font-size: 13.5px; color: var(--ink);
}
.auth .field label .aux { margin-left: auto; font-size: 13.5px; min-height: 24px; display: inline-flex; align-items: center; }
.auth .field label .opt { font-weight: 400; color: var(--ink-muted); }
.auth .field input {
  width: 100%; height: 50px; padding: 0 16px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--white);
  font-size: 15.5px; color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.auth .field input::placeholder { color: #8a8a94; }
.auth .field input:hover { border-color: #cfcfd8; }
.auth .field input:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.auth .field input.err { border-color: var(--red); box-shadow: var(--ring-err); }
.auth .field input[readonly] { background: var(--lavender-3); color: var(--text); border-color: var(--lavender-4); }
.auth .field .hint { margin-top: 6px; font-size: 13px; color: var(--ink-muted); line-height: 1.45; }
.auth .field .errmsg { display: none; margin-top: 6px; font-size: 13px; font-weight: 500; color: var(--err-ink); }
.auth .field.showerr .errmsg { display: block; }
.inwrap { position: relative; }
.auth .inwrap input { padding-right: 48px; }
.eye {
  position: absolute; top: 50%; right: 7px; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 8px;
  display: grid; place-items: center; color: var(--ink-muted);
  transition: background-color 0.15s ease, color 0.15s ease;
}
.eye:hover { color: var(--ink); background: var(--lavender-3); }
.eye[aria-pressed="true"] { color: var(--primary); }
.lockic { position: absolute; top: 50%; right: 16px; transform: translateY(-50%); color: var(--ink-muted); display: flex; }
.auth input[type="checkbox"] { accent-color: var(--primary); width: 18px; height: 18px; flex: none; margin: 0; }

/* ---------- Notices (hidden until .on) ---------- */
.formerr, .noticebox, .okbox, .payerr {
  display: none;
  border-radius: 12px; border: 1px solid transparent;
  padding: 12px 16px; margin: 0 0 16px;
  font-size: 14.5px; font-weight: 500; line-height: 1.5;
}
.formerr.on, .noticebox.on, .okbox.on, .payerr.on { display: block; animation: authIn 0.22s ease-out; }
.formerr, .payerr { color: var(--err-ink); background: var(--err-bg); border-color: var(--err-line); }
.formerr.warn, .noticebox { color: var(--warn-ink); background: var(--warn-bg); border-color: var(--warn-line); }
.okbox { color: var(--ok-ink); background: var(--ok-bg); border-color: #c8ead8; }
.formerr a, .okbox a, .noticebox a { color: inherit !important; text-decoration: underline; text-underline-offset: 3px; }
@keyframes authIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   Split layout (connexion + reinitialiser)
   ========================================================================== */
.split { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); min-height: 100vh; min-height: 100dvh; }
.formside { display: flex; flex-direction: column; min-width: 0; padding: 32px 48px 28px; }
.auth-logo { display: inline-flex; align-items: center; }
.auth-logo img { height: 38px; width: auto; }
.formwrap { margin: auto; width: 100%; max-width: 420px; padding: 44px 0 36px; }
.auth-title { font-weight: 500; font-size: clamp(32px, 3vw, 42px); line-height: 1.1; }
.formwrap .lead { margin: 12px 0 28px; }
.pane { display: none; }
.pane.on { display: block; animation: authIn 0.25s ease-out; }
.pane h1:focus, .formwrap h1:focus { outline: none; }
.remember {
  display: flex; align-items: center; gap: 10px; margin: 4px 0 22px;
  font-size: 14.5px; color: var(--text); cursor: pointer; min-height: 24px;
}
.formwrap .btn { width: 100%; }
.formwrap .btn + .btn, .formwrap form + .btn { margin-top: 12px; }
.signup {
  margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border);
  font-size: 14.5px; color: var(--text); text-align: center; line-height: 1.6;
}
.hint { font-size: 13px; color: var(--ink-muted); margin: -4px 0 20px; }
.footlinks {
  display: flex; gap: 8px 22px; flex-wrap: wrap; justify-content: center;
  font-size: 13.5px;
}
.auth .footlinks a { color: var(--ink-muted); font-weight: 500; min-height: 24px; display: inline-flex; align-items: center; }
.auth .footlinks a:hover { color: var(--primary); }
.footcopy { margin-top: 10px; text-align: center; font-size: 12.5px; color: #9b9ba6; }

/* ---------- Brand panel ---------- */
.brandside {
  position: relative; overflow: hidden; isolation: isolate;
  margin: 16px 16px 16px 0; border-radius: 28px;
  background: #f5f5fb;
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px clamp(40px, 5vw, 80px);
}
.brandside .bp-bg { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.brandside .bp-bg img { width: 100%; height: 100%; object-fit: cover; opacity: 0.35; }
.brandside .bp-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(40% 35% at 85% 10%, rgba(247, 218, 159, 0.55), transparent 70%),
    radial-gradient(45% 40% at 8% 90%, rgba(186, 215, 229, 0.65), transparent 70%),
    radial-gradient(55% 45% at 70% 75%, rgba(146, 141, 240, 0.35), transparent 70%),
    radial-gradient(40% 35% at 15% 15%, rgba(225, 224, 248, 0.9), transparent 70%);
}
.brandside .pill { margin: 0; align-self: flex-start; }
.brandside h2 {
  margin-top: 22px; max-width: 19ch;
  font-weight: 500; font-size: clamp(30px, 2.6vw, 40px); line-height: 1.12;
}
.brandside .bp-sub { margin-top: 14px; max-width: 46ch; font-size: 16px; line-height: 1.6; color: #505056; }

.bp-stage { position: relative; margin-top: 30px; padding: 0 0 60px; max-width: 520px; }
.brandside .tilt-card.after-card {
  position: relative; left: auto; right: auto; top: auto;
  width: min(390px, 88%); padding: 24px 24px 30px;
  transform: rotate(3deg);
  box-shadow: 0 30px 60px rgba(74, 70, 211, 0.14);
}
.brandside .tilt-card .row { height: 52px; padding: 0 16px; }
.brandside .tilt-card .row .name { font-size: 17px; }
.brandside .after-card .row.is-check { height: 42px; }
.brandside .after-card .row.is-check .name { font-size: 15.5px; }
.brandside .after-card .row.is-you { width: calc(100% + 16px); transform: rotate(1.5deg) translateX(-10px); }
.bp-score {
  position: absolute; right: 0; bottom: 0; z-index: 2;
  width: 250px; padding: 18px 20px 16px;
  border-radius: 18px; background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid #fff; box-shadow: var(--shadow-card);
  transform: rotate(-2deg);
}
.bp-score .ms-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text); }
.bp-score .up {
  position: absolute; top: -11px; right: 16px;
  height: 22px; padding: 0 9px; border-radius: 999px; box-shadow: 0 6px 14px rgba(209, 134, 194, 0.35);
  background: var(--grad-badge); color: #fff; font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; gap: 3px; white-space: nowrap;
}
.bp-score .n { margin-top: 6px; font-family: var(--font-head); font-weight: 500; font-size: 40px; line-height: 1; color: var(--ink); }
.bp-score .n small { font-size: 17px; color: var(--muted); }
.msseg { display: flex; gap: 3px; margin-top: 12px; }
.msseg i { flex: 1; height: 7px; border-radius: 999px; background: var(--lavender-2); }
.msseg i.on { background: var(--primary); }

.bp-quote {
  margin: 34px 0 0; max-width: 470px;
  padding: 20px 22px; border-radius: 18px;
  background: rgba(255, 255, 255, 0.7); border: 1px solid #fff;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.bp-quote p { font-weight: 500; font-size: 16.5px; line-height: 1.5; color: var(--ink); }
.bp-who { display: flex; align-items: center; gap: 12px; margin-top: 14px; font-size: 14px; color: var(--text); }
.bp-who b { display: block; font-family: var(--font-head); font-weight: 500; font-size: 15.5px; }
.bp-who .avatar { width: 44px; height: 44px; }

.bp-points { margin-top: 30px; display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.bp-points li { display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--ink); }
.bp-points .icon-box { width: 44px; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, 0.85); }
.bp-points .icon-box img { width: 22px; height: 22px; }

/* Reset page: #loginLink turns into the main action once JS drops .btn-ghost */
.auth-reset .bp-stage { padding-bottom: 0; }
.auth-reset #loginLink:not(.btn-ghost) { color: #fff; background: var(--grad-btn); box-shadow: var(--shadow-btn); }
.auth-reset #loginLink:not(.btn-ghost):hover { transform: translateY(-2px); background: var(--grad-btn); }

@media (max-width: 1280px) {
  .formside { padding: 28px 36px 24px; }
  .bp-score { width: 220px; }
}
@media (max-width: 1023px) {
  .split { grid-template-columns: 1fr; }
  .brandside { display: none; }
  .formside { min-height: 100vh; min-height: 100dvh; }
}
@media (max-width: 600px) {
  .formside { padding: 20px 16px 22px; }
  .auth-logo img { height: 32px; }
  .formwrap { padding: 34px 0 28px; }
  .auth-title { font-size: 32px; }
}

/* ==========================================================================
   Signup (inscription.html) : styles dans css/signup.css depuis le 3 novembre 2026
   (maquette « audit-payment »). Seuls les toasts, partagés avec connexion.html, restent ici.
   ========================================================================== */
/* Toasts */
#toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 99; width: max-content; max-width: calc(100vw - 32px); }
.toast { padding: 12px 18px; border-radius: 12px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 500; box-shadow: 0 14px 34px rgba(26, 26, 46, 0.3); transition: opacity 0.3s; }
.toast.err { background: #8f1b1b; }
.toast.ok { background: var(--ok-ink); }

@media (prefers-reduced-motion: reduce) {
  .auth *, .auth *::before, .auth *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Préférences email sans connexion (desabonnement.html, /unsubscribe/)
   ========================================================================== */
.auth-unsub .formwrap { max-width: 460px; }
.ep-focus { margin-top: 22px; padding: 18px 20px; border-radius: 14px; background: var(--lavender-3); border: 1px solid var(--lavender-4); }
.ep-focus p { margin: 0 0 14px; font-size: 16px; line-height: 1.5; color: var(--ink); }
.auth-unsub .okbox { margin-top: 16px; }
.ep-h { margin-top: 30px; font-weight: 500; font-size: 20px; }
.ep-list { margin: 12px 0 18px; border-top: 1px solid var(--border); }
.ep-row { display: flex; align-items: center; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.ep-tt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ep-tt b { font-size: 15.5px; }
.ep-tt span { font-size: 13.5px; line-height: 1.4; color: var(--ink-muted); }
.auth-unsub .tog { position: relative; flex: none; margin-left: auto; width: 46px; height: 26px; padding: 0; border: none; border-radius: 999px; background: #dcdce6; cursor: pointer; transition: background-color 0.2s ease; }
.auth-unsub .tog::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15); transition: transform 0.25s cubic-bezier(0.2, 0.7, 0.2, 1.3); }
.auth-unsub .tog.on { background: var(--primary); }
.auth-unsub .tog.on::after { transform: translateX(20px); }
.auth-unsub .tog:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ep-note { margin-top: 14px; line-height: 1.5; }
.auth-unsub #dashLink { margin-top: 22px; }
