/* Fairjungle login app — design system v2 (Figma « 1 - design system 💾 », pages « 🔴 ❖ auth - components » and
   « 🔴 ⮕ auth - flow »). Every value below is a design variable of the Corpo theme; its Figma name is in the comment.
   Layout: the form column on the left (432 px at most), the brand panel on the right on desktop only; tablet and
   mobile show the form alone, centred. */

@font-face {
  font-family: "Source Sans 3";
  src: url("/static/source-sans-3-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Sans 3";
  src: url("/static/source-sans-3-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --text-primary: #00050a;            /* text/color/primary, auth/title/text-color */
  --text-secondary: #4e5055;          /* text/color/secondary, auth/text/text-color */
  --text-tertiary: #9ea0a5;           /* text/color/tertiary, auth/legal/text-color */
  --text-hover: #5445ff;              /* text/color/hover */
  --link: #5445ff;                    /* auth/link/text-color */
  --danger: #992b34;                  /* message/color/danger, input/border-color/error */
  --success: #148161;                 /* message/color/success */
  --line: #e4e6eb;                    /* input/border-color/default, auth/separator/color, button/border/color */
  --surface: #f8faff;                 /* color/grey/50: button/bg-color/secondary, auth/email/bg-color */
  --main: #5445ff;                    /* button/bg-color/main */
  --main-hover: #4337cc;              /* button/bg-color/hover/main */
  --secondary-hover: #f6f6ff;         /* button/bg-color/hover/secondary */
  --border-hover: #bbb5ff;            /* button/border/hover-color */
  --disabled-text: #9ea0a5;           /* button/text-color/action-disabled */
  --panel-start: #766aff;             /* auth/panel/bg-color/start (= home/hero-v2) */
  --panel-end: #ffb5bc;               /* auth/panel/bg-color/end */
  --stroke: 1.5px;                    /* input/border-stroke/default, button/border/stroke */
  --field-radius: 12px;               /* field/radius */
  --button-radius: 16px;              /* button/radius/lg */
  --panel-radius: 24px;               /* auth/panel/radius */
  --form-width: 432px;                /* auth/form/width (grille/4-colonnes) */
  --form-gap: 20px;                   /* auth/form/gap (mobile) */
  --header-height: 56px;              /* auth/header/height (mobile) */
  --header-x: 16px;                   /* auth/header/padding-x (mobile) */
  --flow-top: 40px;                   /* auth/flow/padding-top (mobile) */
  --flow-x: 16px;                     /* auth/flow/padding-x (mobile) */
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 768px) {          /* tablet-834 */
  :root { --form-gap: 24px; --header-height: 64px; --header-x: 40px; --flow-top: 96px; --flow-x: 40px; }
}
@media (min-width: 1200px) {         /* web-1440 */
  :root { --header-height: 72px; --flow-top: 100px; }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: #fff; font-size: 16px; line-height: 20px; }   /* auth/flow/bg-color */
p { margin: 0; }
img { display: block; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 2; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* Layout */
.auth { display: flex; min-height: 100vh; }
.auth-column { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.auth-header { height: var(--header-height); padding: 0 var(--header-x); display: flex; align-items: center;
  justify-content: space-between; gap: 16px; flex-shrink: 0; }
.auth-header .logo img { width: 98px; height: 20px; }                       /* logo */
.auth-header nav { display: flex; gap: 16px; }
.auth-header nav a { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--text-secondary);
  text-decoration: none; }
.auth-header nav a:hover { color: var(--text-hover); }
.auth-body { flex: 1 0 auto; display: flex; flex-direction: column; align-items: center;
  padding: var(--flow-top) var(--flow-x) 40px; }
.auth-form { width: 100%; max-width: var(--form-width); display: flex; flex-direction: column; gap: var(--form-gap); }
.auth-form form { display: flex; flex-direction: column; gap: var(--form-gap); margin: 0; }
.auth-form form.inline-form { display: inline; }

/* Brand panel (auth-panneau): desktop only */
.auth-panel { display: none; }
@media (min-width: 1024px) {
  .auth-panel { display: flex; flex: 1 1 0; min-width: 0; padding: 16px; }              /* auth/panel/margin */
  .auth-panel-inner { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 24px;
    padding: 48px; border-radius: var(--panel-radius); color: #fff;                     /* auth/panel/text-color */
    background: linear-gradient(137.93deg, var(--panel-start) 14.286%, var(--panel-end) 85.714%); }
  .auth-panel-title { font-size: 32px; line-height: 40px; font-weight: 600; }          /* title/h1 */
  .auth-panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
  .auth-panel li { display: flex; gap: 8px; align-items: flex-start; font-size: 16px; line-height: 20px; }
  .auth-panel li img { width: 20px; height: 20px; flex-shrink: 0; }
  .auth.wide .auth-panel { display: none; }
}
@media (min-width: 1200px) { .auth-panel-inner { padding: 56px; } }                     /* auth/panel/padding */

/* Titles: title/h2 and body/regular/md, 8 apart (auth/title/gap) */
.titles { display: flex; flex-direction: column; gap: 8px; }
h1 { margin: 0; font-size: 28px; line-height: 36px; font-weight: 600; color: var(--text-primary); }
h2 { margin: 0; font-size: 20px; line-height: 26px; font-weight: 600; }                   /* title/h4 */
.lead { font-size: 16px; line-height: 20px; color: var(--text-secondary); }
.muted { font-size: 14px; line-height: 18px; color: var(--text-secondary); }
/* Benefits of a choice (passkey offer): green check, body/regular/md, 12 apart */
.benefits { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.benefits li { display: flex; gap: 8px; align-items: flex-start; font-size: 16px; line-height: 20px;
  color: var(--text-secondary); }
.benefits li::before { content: ""; flex: 0 0 16px; height: 16px; margin-top: 2px;
  background: url("/static/icon-cercle-coche.svg") no-repeat center / 16px 16px; }
.benefits strong { font-weight: 600; color: var(--text-primary); }
.legal { font-size: 12px; line-height: 15px; color: var(--text-tertiary); }            /* caption/md */
.legal a { color: var(--link); }
a { color: var(--link); }

/* Address reminder (auth-identité) */
.identity { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.identity img { width: 16px; height: 16px; flex-shrink: 0; }
.identity span { flex: 1; min-width: 0; font-size: 14px; line-height: 18px; font-weight: 600; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.identity a { font-size: 14px; line-height: 18px; font-weight: 600; color: var(--text-primary); text-decoration: none; }
.identity a:hover { color: var(--text-hover); }

/* Floating input (floating-input): label inside the field */
.field-group { display: flex; flex-direction: column; gap: 8px; }
.field { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px;   /* input/height/lg */
  padding: 12px 16px; background: #fff; border: var(--stroke) solid var(--line); border-radius: var(--field-radius);
  cursor: text; }
.field:hover { border-color: var(--border-hover); }
.field:focus-within { border-color: var(--text-primary); }
.field.invalid { border-color: var(--danger); }
.field label { font-size: 12px; line-height: 15px; color: var(--text-secondary); cursor: text; }       /* caption/md */
.field input { width: 100%; padding: 0; margin: 0; border: 0; outline: none; background: transparent;
  font: inherit; font-size: 16px; line-height: 20px; font-weight: 600; color: var(--text-primary); }   /* body/bold/md */
.field input::placeholder { font-weight: 400; color: var(--text-tertiary); }
label.check { display: flex; gap: 8px; align-items: center; font-size: 14px; line-height: 18px; color: var(--text-secondary); }
label.check input { width: 16px; height: 16px; accent-color: var(--main); margin: 0; }

/* Messages under a field (condition): 14 px icon, 14/18 text, 4 apart */
.error, .notice { display: flex; gap: 4px; align-items: flex-start; font-size: 14px; line-height: 18px; }
.error { color: var(--danger); }                          /* tone=no, couleur=texte */
.notice { color: var(--text-secondary); }                  /* tone=ok, couleur=gris */
.error::before, .notice::before { content: ""; flex: 0 0 14px; height: 14px; margin-top: 2px;
  background: no-repeat center / 14px 14px; }
.error::before { background-image: url("/static/icon-cercle-croix.svg"); }
.notice::before { background-image: url("/static/icon-cercle-coche.svg"); }

/* Buttons (cta, size lg) */
button, .button, .primary, .secondary { font: inherit; cursor: pointer; text-decoration: none; text-align: center; }
.primary, .secondary { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  min-height: 48px; padding: 12px 24px; border-radius: var(--button-radius); font-size: 16px; line-height: 20px;
  font-weight: 600; }
.primary { background: var(--main); color: #fff; border: 0; }
.primary:hover { background: var(--main-hover); }
.secondary { background: var(--surface); color: var(--text-primary); border: var(--stroke) solid var(--line); }
.secondary:hover { background: var(--secondary-hover); border-color: var(--border-hover); }
.primary:disabled, .secondary:disabled { background: var(--surface); color: var(--disabled-text); border-color: var(--surface);
  cursor: default; }
.secondary img { width: 20px; height: 20px; flex-shrink: 0; }
.buttons .secondary { white-space: nowrap; }
@media (max-width: 767px) { .buttons .secondary { padding: 12px; } }
.link { display: inline; background: none; border: 0; padding: 0; font-size: 14px; line-height: 18px; font-weight: 600;
  color: var(--text-primary); text-decoration: none; }
.link:hover { color: var(--text-hover); }
.danger { color: var(--danger); }
.secondary.danger { color: var(--danger); }
button:focus-visible, a:focus-visible, summary:focus-visible, .field:focus-within, .code:focus-within {
  outline: 2px solid var(--main); outline-offset: 2px; }
.field:focus-within { outline: none; }
.buttons { display: flex; gap: 8px; }
.buttons > * { flex: 1 1 0; min-width: 0; }
.links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; line-height: 18px;
  color: var(--text-secondary); }
.links form { display: inline; margin: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }

.passkey-zone { display: flex; flex-direction: column; gap: var(--form-gap); }
section .secondary, section .button { width: auto; align-self: flex-start; }

/* Separator (auth-séparateur) */
.sep { display: flex; align-items: center; gap: 12px; font-size: 12px; line-height: 15px; color: var(--text-tertiary); }
.sep::before, .sep::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* Six-digit code (auth-code): one real input over six boxes; without JavaScript, the input alone */
.code { position: relative; }
.code-boxes { display: none; }
.js .code-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }        /* auth/code/gap */
.js .code input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; border: 0; padding: 0;
  font-size: 16px; caret-color: transparent; }
.code-box { height: 64px; display: flex; align-items: center; justify-content: center; background: #fff;
  border: var(--stroke) solid var(--line); border-radius: var(--field-radius);
  font-size: 24px; line-height: 30px; font-weight: 600; color: var(--text-primary); }                    /* title/h3 */
.code:focus-within .code-box.active { border-color: var(--text-primary); }
.code:focus-within .code-box.active:empty::after { content: ""; width: 1.5px; height: 28px; background: var(--text-primary);
  animation: blink 1s steps(1) infinite; }
.code.invalid .code-box { border-color: var(--danger); }
.code:focus-within { outline: none; }
@keyframes blink { 50% { opacity: 0; } }

/* Disclosures and lists */
details { display: flex; flex-direction: column; gap: 16px; }
details[open] > summary { margin-bottom: 16px; }
summary { cursor: pointer; font-size: 14px; line-height: 18px; font-weight: 600; color: var(--text-primary); list-style: none; }
summary::-webkit-details-marker { display: none; }
summary::after { content: " ›"; }
details[open] > summary::after { content: " ⌄"; }
summary:hover { color: var(--text-hover); }
.choice { display: flex; flex-direction: column; gap: 8px; }
.qr { display: flex; justify-content: center; padding: 16px; border: var(--stroke) solid var(--line); border-radius: var(--field-radius); }
.qr svg { width: 184px; height: 184px; }
.secret { font-size: 15px; letter-spacing: .05em; word-break: break-all; color: var(--text-primary); }
.codes { columns: 2; margin: 0; padding: 16px 16px 16px 40px; background: var(--surface); border-radius: var(--field-radius);
  font-size: 18px; line-height: 28px; }
.codes code { letter-spacing: .08em; font-weight: 600; }

/* Account pages: wider column, no brand panel */
.auth.wide .auth-form { max-width: 640px; }
section { display: flex; flex-direction: column; gap: 12px; padding-top: 24px; border-top: 1px solid var(--line); }
.rows { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.rows li { border: var(--stroke) solid var(--line); border-radius: var(--field-radius); padding: 12px 16px; display: flex;
  flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; font-size: 14px; line-height: 18px; }
.inline { display: inline-flex; gap: 8px; align-items: center; margin: 0; }
.inline input { width: auto; padding: 8px 12px; font: inherit; font-size: 14px; border: var(--stroke) solid var(--line);
  border-radius: 8px; }
.inline .secondary, .inline .primary { width: auto; min-height: 32px; padding: 6px 16px; font-size: 14px; border-radius: 8px; }
.activity { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 18px; }
.activity td { border-bottom: 1px solid var(--line); padding: 8px 4px; color: var(--text-secondary); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
