/* css/tokens.css */
/* ==========================================================================
   Design tokens — toute couleur, taille ou durée passe par ces variables.
   Thème : système par défaut, forcé via <html data-theme="light|dark">.
   Accent : Encre par défaut, variantes via <html data-accent="foret|corail">.
   ========================================================================== */
:root{
  --accent-h: 229; --accent-s: 78%; --accent-l: 58%;
  --accent: hsl(var(--accent-h) var(--accent-s) var(--accent-l));
  --accent-hover: hsl(var(--accent-h) var(--accent-s) calc(var(--accent-l) - 6%));
  --accent-soft: hsl(var(--accent-h) var(--accent-s) var(--accent-l) / .1);
  --on-accent: #fff;
  /* Dégradé de marque (Tatasko) : dérivé de l'accent choisi, teinte décalée vers le violet */
  --grad: linear-gradient(120deg, hsl(var(--accent-h) var(--accent-s) 58%), hsl(calc(var(--accent-h) + 38) 70% 62%));
  --grad-text: linear-gradient(100deg, hsl(var(--accent-h) 90% 62%), hsl(calc(var(--accent-h) + 40) 80% 66%) 60%, hsl(calc(var(--accent-h) + 85) 75% 70%));
  --glow: 0 8px 28px -6px hsl(var(--accent-h) 80% 55% / .45);
  --ring: 0 0 0 3px hsl(var(--accent-h) 90% 60% / .22);

  --bg: #F5F6FA;
  --surface: #FFFFFF;
  --surface-2: #EEF0F6;
  --surface-3: #E4E7F0;
  --border: #E2E5EE;
  --border-strong: #CDD2DF;
  --text: #14162B;
  --text-2: #4F5470;
  --text-3: #858AA3;

  --p-urgent: #E5484D;
  --p-high:   #F76B15;
  --p-medium: #D69E2E;
  --p-low:    #12A594;
  --p-none:   #A1A1AA;

  --st-todo:     #8A8A93;
  --st-progress: var(--accent);
  --st-waiting:  #8E4EC6;
  --st-done:     #30A46C;

  --danger: #DC3E42;
  --success: #2B9A66;
  --warning: #D69E2E;

  --font-title: "Inter Tight", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --fs-xs: .75rem; --fs-sm: .8125rem; --fs-base: .9375rem; --fs-md: 1.0625rem;
  --fs-lg: 1.375rem; --fs-xl: 1.75rem; --fs-2xl: clamp(2rem, 1.4rem + 2.4vw, 3rem);

  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 5rem;

  --radius-sm: 6px; --radius: 10px; --radius-lg: 16px; --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgb(20 20 30 / .06);
  --shadow: 0 1px 2px rgb(20 20 30 / .05), 0 4px 14px rgb(20 20 30 / .06);
  --shadow-lg: 0 10px 40px rgb(20 20 30 / .14);

  --ease: cubic-bezier(.2,.7,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
  --dur: 220ms;

  --tap: 44px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --accent-s: 100%; --accent-l: 72%;
    --on-accent: #0B0D18;
    --bg: #07080E; --surface: #0E1019; --surface-2: #131624; --surface-3: #1B1F31;
    --border: #1D2134; --border-strong: #2C3150;
    --text: #EDEEF5; --text-2: #A0A5BC; --text-3: #6B7088;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .5);
    --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 6px 20px rgb(0 0 0 / .35);
    --shadow-lg: 0 24px 60px -12px rgb(0 0 0 / .75), 0 0 0 1px rgb(255 255 255 / .04);
    --glow: 0 10px 34px -6px hsl(var(--accent-h) 90% 60% / .55);
    color-scheme: dark;
  }
}
:root[data-theme="dark"]{
  --accent-s: 100%; --accent-l: 72%;
  --on-accent: #0B0D18;
  --bg: #07080E; --surface: #0E1019; --surface-2: #131624; --surface-3: #1B1F31;
  --border: #1D2134; --border-strong: #2C3150;
  --text: #EDEEF5; --text-2: #A0A5BC; --text-3: #6B7088;
  --shadow-sm: 0 1px 2px rgb(0 0 0 / .5);
  --shadow: 0 1px 2px rgb(0 0 0 / .5), 0 6px 20px rgb(0 0 0 / .35);
  --shadow-lg: 0 24px 60px -12px rgb(0 0 0 / .75), 0 0 0 1px rgb(255 255 255 / .04);
  --glow: 0 10px 34px -6px hsl(var(--accent-h) 90% 60% / .55);
  color-scheme: dark;
}

/* Variantes d'accent (préférence utilisateur) */
:root[data-accent="foret"]{ --accent-h: 152; --accent-s: 48%; --accent-l: 36%; }
:root[data-accent="corail"]{ --accent-h: 14;  --accent-s: 78%; --accent-l: 52%; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"])[data-accent="foret"]{ --accent-l: 52%; }
  :root:not([data-theme="light"])[data-accent="corail"]{ --accent-l: 64%; }
}
:root[data-theme="dark"][data-accent="foret"]{ --accent-l: 52%; }
:root[data-theme="dark"][data-accent="corail"]{ --accent-l: 64%; }

/* css/base.css */
/* ==========================================================================
   Base : remise à zéro, typographie, accessibilité, utilitaires
   ========================================================================== */
*,*::before,*::after{ box-sizing: border-box; }
html{ -webkit-text-size-adjust: 100%; text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body{
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--text);
  font: 400 var(--fs-base)/1.55 var(--font-body);
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv11", "ss01";
}
h1,h2,h3,h4{ font-family: var(--font-title); letter-spacing: -.02em; line-height: 1.2; margin: 0; font-weight: 600; }
p{ margin: 0; }
a{ color: var(--accent); text-decoration: none; }
a:hover{ text-decoration: underline; text-underline-offset: 3px; }
img,svg{ display: block; max-width: 100%; }
button,input,select,textarea{ font: inherit; color: inherit; }
button{ cursor: pointer; }
:focus-visible{ outline: 2px solid var(--accent); outline-offset: 2px; }
::selection{ background: var(--accent-soft); }
code{ font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .9em; }

svg.i{
  width: 18px; height: 18px; flex: none; display: inline-block;
  stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
svg.i.is-small{ width: 15px; height: 15px; }
svg.i.is-large{ width: 22px; height: 22px; }

/* Barres de défilement discrètes */
*{ scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar{ width: 10px; height: 10px; }
::-webkit-scrollbar-thumb{ background: var(--border-strong); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }

/* Utilitaires */
.sr-only{ position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted{ color: var(--text-2); }
.subtle{ color: var(--text-3); }
.eyebrow{ font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .09em; color: var(--text-3); font-weight: 600; }
.stack{ display: grid; gap: var(--space-4); }
.row{ display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.spacer{ flex: 1; }
[hidden]{ display: none !important; }

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{ animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* css/components.css */
/* ==========================================================================
   Composants réutilisables
   ========================================================================== */

/* Boutons ----------------------------------------------------------------- */
.btn{
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 40px; padding: 0 var(--space-4); border-radius: var(--radius);
  border: 1px solid transparent; background: transparent;
  font-weight: 500; font-size: var(--fs-sm); line-height: 1; white-space: nowrap; text-decoration: none;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), transform 120ms var(--ease);
  user-select: none;
}
.btn:hover{ text-decoration: none; }
.btn:active{ transform: scale(.97); }
.btn:disabled, .btn.is-loading{ opacity: .6; pointer-events: none; }
.btn-primary{ background: var(--accent); color: var(--on-accent); }
.btn-primary:hover{ background: var(--accent-hover); }
.btn-secondary{ background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-secondary:hover{ background: var(--surface-2); }
.btn-ghost{ color: var(--text-2); }
.btn-ghost:hover{ background: var(--surface-2); color: var(--text); }
.btn-danger{ color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover{ background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-danger-solid{ background: var(--danger); color: #fff; }
.btn-danger-solid:hover{ background: color-mix(in srgb, var(--danger) 88%, #000); }
.btn-lg{ min-height: 48px; padding: 0 var(--space-5); font-size: var(--fs-base); border-radius: 12px; }
.btn-sm{ min-height: 32px; padding: 0 var(--space-3); font-size: var(--fs-xs); }
.btn-block{ width: 100%; }
.btn-icon{ width: 40px; padding: 0; }
.btn-icon.btn-sm{ width: 32px; }
.btn.is-loading{ position: relative; color: transparent !important; }
.btn.is-loading::after{
  content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-color: var(--on-accent) transparent var(--on-accent) transparent;
  animation: spin .7s linear infinite;
}
.btn-secondary.is-loading::after, .btn-ghost.is-loading::after{ border-color: var(--text-2) transparent var(--text-2) transparent; }
@keyframes spin{ to{ transform: rotate(360deg); } }

/* Champs ------------------------------------------------------------------ */
.field{ display: grid; gap: 6px; }
.field > label, .label{ font-size: var(--fs-sm); font-weight: 500; color: var(--text); }
.label-row{ display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); }
.input, .select, .textarea{
  width: 100%; min-height: 44px; padding: 0 var(--space-3);
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.textarea{ padding: var(--space-3); min-height: 96px; resize: vertical; line-height: 1.5; }
.select{
  appearance: none; padding-right: 36px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238A8A93' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.input::placeholder, .textarea::placeholder{ color: var(--text-3); }
.input:hover, .select:hover, .textarea:hover{ border-color: var(--text-3); }
.input:focus, .select:focus, .textarea:focus{ outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field.has-error .input, .field.has-error .select, .field.has-error .textarea{ border-color: var(--danger); }
.field.has-error .input:focus{ box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 15%, transparent); }
.field-error{ display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--danger); }
.field-error svg{ width: 14px; height: 14px; }
.hint{ font-size: var(--fs-xs); color: var(--text-3); }

/* Champ avec icône ou bouton intégré */
.input-group{ position: relative; }
.input-group > .i:first-child{ position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.input-group > .i:first-child ~ .input{ padding-left: 40px; }
.input-group .input-action{
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: 0; background: none; border-radius: 8px; color: var(--text-3);
  display: grid; place-items: center;
}
.input-group .input-action:hover{ color: var(--text); background: var(--surface-2); }
.input-group:has(.input-action) .input{ padding-right: 44px; }

/* Case à cocher */
.checkbox{ display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); cursor: pointer; user-select: none; min-height: 32px; }
.checkbox input{
  appearance: none; width: 18px; height: 18px; margin: 0; flex: none; cursor: pointer;
  border: 1.5px solid var(--border-strong); border-radius: 5px; background: var(--surface);
  display: grid; place-items: center; transition: all var(--dur) var(--ease);
}
.checkbox input:checked{ background: var(--accent); border-color: var(--accent); }
.checkbox input:checked::after{ content: ""; width: 5px; height: 9px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px,-1px); }

/* Interrupteur */
.switch{ display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); cursor: pointer; min-height: var(--tap); }
.switch input{
  appearance: none; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 24px; cursor: pointer;
  background: var(--surface-3); position: relative; transition: background var(--dur) var(--ease);
}
.switch input::after{
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease-spring);
}
.switch input:checked{ background: var(--accent); }
.switch input:checked::after{ transform: translateX(16px); }

/* Choix segmenté (thème, accent…) */
.segmented{ display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: var(--radius); padding: 3px; gap: 2px; }
.segmented label{ position: relative; }
.segmented input{ position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span{
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 12px; border-radius: 7px;
  font-size: var(--fs-sm); color: var(--text-2); transition: all var(--dur) var(--ease);
}
.segmented input:checked + span{ background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.segmented input:focus-visible + span{ outline: 2px solid var(--accent); outline-offset: 1px; }

/* Indicateur de robustesse du mot de passe */
.strength{ display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 2px; }
.strength i{ height: 4px; border-radius: 4px; background: var(--surface-3); transition: background var(--dur) var(--ease); }
.strength[data-score="1"] i:nth-child(-n+1){ background: var(--danger); }
.strength[data-score="2"] i:nth-child(-n+2){ background: var(--p-high); }
.strength[data-score="3"] i:nth-child(-n+3){ background: var(--p-medium); }
.strength[data-score="4"] i{ background: var(--success); }

/* Alertes ----------------------------------------------------------------- */
.alert{
  display: flex; gap: var(--space-3); align-items: flex-start;
  padding: var(--space-3) var(--space-4); border-radius: var(--radius); font-size: var(--fs-sm);
  --c: var(--accent); background: color-mix(in srgb, var(--c) 10%, transparent); color: color-mix(in srgb, var(--c) 75%, var(--text));
}
.alert .i{ color: var(--c); margin-top: 1px; }
.alert-error{ --c: var(--danger); }
.alert-success{ --c: var(--success); }
.alert-warning{ --c: var(--warning); }

/* Cartes ------------------------------------------------------------------ */
.card{ background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: var(--space-5); }
.card-head{ display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.card-head h2{ font-size: var(--fs-md); }
.card-head p{ font-size: var(--fs-sm); color: var(--text-2); margin-top: 2px; }
.card-danger{ border-color: color-mix(in srgb, var(--danger) 30%, var(--border)); }

/* Avatar ------------------------------------------------------------------ */
.avatar{
  --size: 32px;
  width: var(--size); height: var(--size); border-radius: 50%; flex: none; overflow: hidden;
  display: grid; place-items: center; background: var(--accent); color: var(--on-accent);
  font: 600 calc(var(--size) * .38)/1 var(--font-body); letter-spacing: .02em;
}
.avatar img{ width: 100%; height: 100%; object-fit: cover; }
.avatar-lg{ --size: 72px; }

/* Menu déroulant ---------------------------------------------------------- */
.dropdown{ position: relative; }
.menu{
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; min-width: 220px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: var(--space-1); display: grid; gap: 1px;
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity 140ms var(--ease), transform 140ms var(--ease);
}
.dropdown.is-open .menu{ opacity: 1; transform: none; pointer-events: auto; }
.menu-item{
  display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: 36px; padding: 0 var(--space-3);
  border: 0; background: none; border-radius: 7px; font-size: var(--fs-sm); color: var(--text); text-align: left; text-decoration: none;
}
.menu-item:hover{ background: var(--surface-2); text-decoration: none; }
.menu-item .i{ color: var(--text-3); }
.menu-item.is-danger{ color: var(--danger); }
.menu-item.is-danger .i{ color: var(--danger); }
.menu-sep{ height: 1px; background: var(--border); margin: var(--space-1) 0; }
.menu-head{ padding: var(--space-2) var(--space-3); display: grid; font-size: var(--fs-sm); }
.menu-head small{ color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Divers ------------------------------------------------------------------ */
.divider{ display: flex; align-items: center; gap: var(--space-3); color: var(--text-3); font-size: var(--fs-xs); }
.divider::before, .divider::after{ content: ""; flex: 1; height: 1px; background: var(--border); }

.list-rows{ list-style: none; margin: 0; padding: 0; }
.list-rows > li{ display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.list-rows > li:first-child{ border-top: 0; }

.badge{
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px;
  border-radius: var(--radius-full); font-size: var(--fs-xs); font-weight: 500;
  --c: var(--text-3);
  background: color-mix(in srgb, var(--c) 12%, transparent); color: color-mix(in srgb, var(--c) 82%, var(--text));
}

/* Toasts ------------------------------------------------------------------ */
.toasts{
  position: fixed; z-index: 100; left: 50%; bottom: calc(var(--space-5) + env(safe-area-inset-bottom));
  transform: translateX(-50%); display: grid; gap: var(--space-2); justify-items: center;
  width: min(440px, 100% - 2rem); pointer-events: none;
}
.toast{
  display: flex; align-items: center; gap: var(--space-3); pointer-events: auto;
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  background: var(--text); color: var(--bg); border-radius: var(--radius); box-shadow: var(--shadow-lg);
  font-size: var(--fs-sm); animation: toast-in 260ms var(--ease-spring);
}
.toast .i{ flex: none; }
.toast.is-error .i{ color: #FF8589; }
.toast.is-success .i{ color: #5BD69A; }
.toast button{ background: transparent; border: 0; color: inherit; font-weight: 600; padding: 6px 10px; border-radius: 6px; }
.toast button:hover{ background: color-mix(in srgb, var(--bg) 18%, transparent); }
.toast.is-leaving{ animation: toast-out 200ms var(--ease) forwards; }
@keyframes toast-in{ from{ opacity: 0; transform: translateY(12px) scale(.96); } }
@keyframes toast-out{ to{ opacity: 0; transform: translateY(8px); } }
.menu-item:disabled{ opacity: .4; cursor: default; background: none; }

/* css/brand.css */
/* ==========================================================================
   Identité « L'anneau » (charte Tatasko v1) — couleurs + logo uniquement.
   Chargé en dernier dans l'application : il ne change aucune structure.
   Pour revenir à l'ancien style, retirer 'css/brand.css' de views/layouts/app.php
   et remettre icon('check') dans .brand-mark.
   ========================================================================== */

/* ---------- Couleurs : clair ---------- */
:root{
  /* teinte jaune pour les halos et anneaux de focus calculés en hsl(var(--accent-h)…) */
  --accent-h: 44; --accent-s: 96%; --accent-l: 48%;
  --sun: #F2B705; --sun-soft: #FBEDBE; --sun-ink: #8A6400;

  --accent: #1B1A17;          /* boutons, liens, éléments actifs : charbon */
  --accent-hover: #000;
  --accent-soft: rgb(242 183 5 / .16);
  --on-accent: #FAF7F0;

  --grad: var(--accent);
  --grad-text: linear-gradient(var(--text), var(--text));
  --glow: none;
  --ring: 0 0 0 3px rgb(242 183 5 / .38);

  --bg: #F7F4EC;
  --surface: #FFFDF9;
  --surface-2: #F1ECE1;
  --surface-3: #E8E1D3;
  --border: #E4DDCF;
  --border-strong: #CFC6B4;
  --text: #1B1A17;
  --text-2: #5A554B;
  --text-3: #8C8579;

  --st-progress: #C99700;
  --st-done: #2F8F5B;
  --success: #2F8F5B;
  --warning: #C99700;
  --p-medium: #C99700;
}

/* ---------- Couleurs : sombre (jaune devient l'accent) ---------- */
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    --accent: #F2B705; --accent-hover: #FFC61A; --on-accent: #1B1A17;
    --accent-soft: rgb(242 183 5 / .14);
    --bg: #12110F; --surface: #1A1916; --surface-2: #211F1B; --surface-3: #2A2823;
    --border: #2C2A25; --border-strong: #3D3A33;
    --text: #F3EEE2; --text-2: #B8B1A2; --text-3: #807A6E;
    --grad-text: linear-gradient(var(--sun), var(--sun));
    --glow: none;
  }
}
:root[data-theme="dark"]{
  --accent: #F2B705; --accent-hover: #FFC61A; --on-accent: #1B1A17;
  --accent-soft: rgb(242 183 5 / .14);
  --bg: #12110F; --surface: #1A1916; --surface-2: #211F1B; --surface-3: #2A2823;
  --border: #2C2A25; --border-strong: #3D3A33;
  --text: #F3EEE2; --text-2: #B8B1A2; --text-3: #807A6E;
  --grad-text: linear-gradient(var(--sun), var(--sun));
  --glow: none;
}

/* Les variantes d'accent (forêt, corail) restent possibles en surcouche */
:root[data-accent="foret"]{ --accent: hsl(152 48% 32%); --accent-hover: hsl(152 48% 26%); }
:root[data-accent="corail"]{ --accent: hsl(14 78% 50%); --accent-hover: hsl(14 78% 44%); }

/* ---------- Fond : papier uni, plus de halos colorés ---------- */
body.app,
:root[data-theme="dark"] body.app{ background: var(--bg); }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) body.app{ background: var(--bg); } }

/* ---------- Textes sur fond d'accent : suivent le thème ---------- */
.btn-primary, .btn-primary:hover, .fab, .ai-action-ico, .ai-bubble.is-user, .tour-step-ico, .tour-badge{
  color: var(--on-accent);
}
.btn-primary{ box-shadow: inset 0 1px 0 rgb(255 255 255 / .1), 0 1px 2px rgb(0 0 0 / .18); }
.btn-primary:hover{ background: var(--accent-hover); filter: none; }
.fab{ box-shadow: 0 8px 22px -8px rgb(27 26 23 / .55); }

/* ---------- Navigation : repère jaune, fond neutre ---------- */
.nav-item.is-active{
  background: var(--surface-3);
  box-shadow: none;
  color: var(--text);
}
.nav-item.is-active::before{ background: var(--sun); box-shadow: none; }

/* ---------- Petits rappels jaunes ---------- */
::selection{ background: var(--sun-soft); color: #1B1A17; }
.markdown .md-task.is-done .md-box{ background: var(--sun); border-color: var(--sun); }
.view-title .big-date{ background: none; color: var(--text-3); -webkit-text-fill-color: currentColor; }

/* ---------- Logo ---------- */
.sidebar-brand{
  gap: 8px;
  font: 500 19px/1 "Fraunces", Georgia, serif;
  letter-spacing: -.03em;
}
.sidebar-brand b{
  font: 500 10px/1 var(--font-body); letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-3); margin-left: 2px; align-self: center;
}
.brand-mark{
  width: 26px; height: 26px; border-radius: 0; background: none; box-shadow: none; color: var(--text);
}
.brand-mark .i{ width: 26px; height: 26px; }

/* css/auth.css */
/* ==========================================================================
   Pages de connexion, inscription, mot de passe et invitation
   Identité « L'anneau » : papier, charbon, une touche de jaune.
   Léger : aucun canvas, aucun flou d'arrière-plan, aucune animation en boucle.
   Les couleurs viennent de tokens.css + brand.css.
   ========================================================================== */
.auth{
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sun: #F2B705; --ink: #1B1A17; --cream: #F3EEE2;
  --side-line: rgba(243, 238, 226, .12); --side-mute: #A39C8E;
  --ease-out: cubic-bezier(.16, 1, .3, 1);

  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100dvh;
  background: var(--bg); color: var(--text);
}

/* ---------- Logo ---------- */
.auth-brand{ display: inline-flex; align-items: center; gap: 9px; font: 500 21px/1 var(--serif); letter-spacing: -.03em; color: inherit; text-decoration: none; }
.auth-brand:hover{ text-decoration: none; }
.brand-mark{ width: 28px; height: 28px; flex: none; display: grid; place-items: center; color: currentColor; }
.brand-mark .i{ width: 28px; height: 28px; }

/* ---------- Panneau éditorial (PC) ---------- */
.auth-side{
  position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; justify-content: space-between; gap: 40px;
  padding: 40px clamp(32px, 5vw, 72px); background: var(--ink); color: var(--cream); overflow: hidden;
}
.auth-side::after{ /* anneau en filigrane */
  content: ""; position: absolute; width: 560px; height: 560px; right: -220px; bottom: -220px; border-radius: 50%;
  border: 64px solid rgba(243, 238, 226, .04); pointer-events: none;
}
.auth-pitch h2{ font: 400 clamp(2.6rem, 1.4rem + 3.2vw, 4.6rem)/.98 var(--serif); letter-spacing: -.04em; }
.auth-pitch h2 i{ font-style: italic; color: var(--sun); }
.auth-pitch p{ margin-top: 20px; max-width: 40ch; color: var(--side-mute); font-size: 16px; line-height: 1.6; }

.auth-demo{
  position: relative; z-index: 1; width: min(380px, 100%); padding: 18px 20px 10px; border-radius: 16px;
  background: #24221E; border: 1px solid var(--side-line); font-size: 14px;
}
.ad-head{ display: flex; justify-content: space-between; align-items: center; padding-bottom: 12px; border-bottom: 1px solid var(--side-line); }
.ad-head b{ display: block; font: 400 20px/1.1 var(--serif); letter-spacing: -.02em; }
.ad-head small{ color: var(--side-mute); font-size: 12px; }
.ad-ring{ width: 38px; height: 38px; }
.ad-ring svg{ width: 100%; height: 100%; transform: rotate(-90deg); }
.ad-ring circle{ fill: none; stroke: var(--side-line); stroke-width: 3.5; }
.ad-ring .v{ stroke: var(--sun); stroke-linecap: round; stroke-dasharray: 94.25; stroke-dashoffset: 94.25; animation: ad-fill 1.4s var(--ease-out) .4s forwards; }
@keyframes ad-fill{ to{ stroke-dashoffset: 47; } }
.auth-demo ul{ list-style: none; margin: 0; padding: 0; }
.auth-demo li{ display: flex; align-items: center; gap: 11px; padding: 10px 0; border-top: 1px solid rgba(243, 238, 226, .06); }
.auth-demo li:first-child{ border-top: 0; }
.auth-demo li i{ width: 17px; height: 17px; flex: none; border-radius: 50%; border: 1.5px solid #6F695E; position: relative; }
.auth-demo li.done{ color: #807A6E; text-decoration: line-through; text-decoration-color: #5A554B; }
.auth-demo li.done i{ background: var(--sun); border-color: var(--sun); }
.auth-demo li.done i::after{ content: ""; position: absolute; left: 5px; top: 2px; width: 4px; height: 8px; border: solid var(--ink); border-width: 0 1.8px 1.8px 0; transform: rotate(45deg); }
.auth-demo li.next{ color: var(--cream); }
.auth-demo li.next i{ border-color: var(--sun); }
.auth-demo em{ margin-left: auto; font: normal 11.5px ui-monospace, Consolas, monospace; color: var(--side-mute); }

.auth-perks{ display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; color: var(--side-mute); }
.auth-perks li{ display: inline-flex; align-items: center; gap: 7px; }
.auth-perks .i{ width: 16px; height: 16px; color: var(--sun); }

/* ---------- Formulaire ---------- */
.auth-main{ display: flex; flex-direction: column; align-items: center; padding: 32px 24px; gap: 28px; }
.auth-top{ width: min(420px, 100%); display: flex; justify-content: flex-end; align-items: center; }
.auth-brand-mobile{ display: none; color: var(--text); }
.auth-back{
  display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 0 14px; border-radius: 10px;
  font-size: 13.5px; color: var(--text-2); text-decoration: none; border: 1px solid var(--border); transition: border-color .2s, color .2s;
}
.auth-back:hover{ color: var(--text); border-color: var(--text); text-decoration: none; }
.auth-back .i{ width: 15px; height: 15px; }

.auth-panel{ width: min(420px, 100%); margin: auto 0; animation: auth-in .6s var(--ease-out) both; }
@keyframes auth-in{ from{ opacity: 0; transform: translateY(12px); } }
.auth-panel h1{ font: 400 clamp(2.2rem, 1.8rem + 1.4vw, 2.8rem)/1.05 var(--serif); letter-spacing: -.035em; }
.auth-panel .lead{ color: var(--text-2); margin-top: 10px; font-size: 15.5px; }
.auth-panel .lead strong{ color: var(--text); font-weight: 600; overflow-wrap: anywhere; }
.auth-panel .lead a{ color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.auth-panel .alert{ margin-top: 22px; }
.auth-form{ display: grid; gap: 18px; margin-top: 30px; }
.auth-form .btn .i{ width: 18px; height: 18px; }

.auth .field > label, .auth .label-row label{ color: var(--text); font-size: 13.5px; font-weight: 500; }
.auth .input{
  min-height: 48px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border-strong);
  transition: border-color .2s, box-shadow .2s;
}
.auth .input:hover{ border-color: #A39C8E; }
.auth .input:focus{ border-color: var(--text); box-shadow: 0 0 0 3px rgba(242, 183, 5, .35); outline: none; }
.auth .input:-webkit-autofill{ -webkit-text-fill-color: var(--text); -webkit-box-shadow: 0 0 0 100px var(--surface) inset; }
.auth .input-group:focus-within > .i:first-child{ color: var(--text); }
.auth .hint{ color: var(--text-2); }
.auth .label-row a.hint:hover{ color: var(--text); }
.auth .checkbox{ color: var(--text-2); }
.auth .checkbox input:checked{ background-color: var(--text); border-color: var(--text); }

.auth .btn-primary{ min-height: 50px; margin-top: 6px; border-radius: 10px; font-weight: 600; background: var(--ink); color: var(--cream); box-shadow: 0 1px 2px rgba(0, 0, 0, .2); }
.auth .btn-primary:hover{ background: #000; }
.auth .btn-primary:active{ transform: translateY(1px); }
.auth .btn-secondary{ background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.auth .btn-secondary:hover{ border-color: var(--text); }
.auth .btn-ghost{ color: var(--text-2); }
.auth .btn-ghost:hover{ color: var(--text); background: var(--surface-2); }

.auth-switch{ margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); text-align: center; font-size: 14px; color: var(--text-2); }
.auth-switch a{ color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.auth-switch a:hover{ text-decoration-color: var(--text); }
.auth-foot{ font-size: 12.5px; color: var(--text-3); }

/* Robustesse du mot de passe */
.auth .strength i{ background: var(--surface-3); transition: background .3s; }
.auth .strength[data-score="1"] i:nth-child(-n+1){ background: #B8432F; }
.auth .strength[data-score="2"] i:nth-child(-n+2){ background: #D9822B; }
.auth .strength[data-score="3"] i:nth-child(-n+3){ background: #F2B705; }
.auth .strength[data-score="4"] i{ background: #2F8F5B; }

/* Page d'invitation */
.invite-badge{ width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); margin-bottom: 18px; }
.invite-badge .i{ width: 26px; height: 26px; }

/* Page « Vérifiez vos e-mails » */
.verify-change{ margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.verify-change summary{ cursor: pointer; font-size: 14px; color: var(--text); font-weight: 500; list-style: none; text-align: center; }
.verify-change summary::-webkit-details-marker{ display: none; }
.verify-change summary:hover{ text-decoration: underline; text-decoration-color: var(--sun); }
.verify-change .auth-form{ margin-top: 16px; }
.hp-field{ position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px){
  .auth{ grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); }
  .auth-demo{ display: none; }
}
@media (max-width: 860px){
  .auth{ grid-template-columns: 1fr; }
  .auth-side{ display: none; }
  .auth-main{ padding: 16px 20px 24px; gap: 24px; }
  .auth-top{ justify-content: space-between; }
  .auth-brand-mobile{ display: inline-flex; }
  .auth-back span{ display: none; }
  .auth-back{ width: 42px; padding: 0; justify-content: center; }
  .auth-panel{ margin: 8px 0 auto; }
}
@media (prefers-reduced-motion: reduce){
  .auth *, .auth *::before, .auth *::after{ animation: none !important; transition: none !important; }
  .ad-ring .v{ stroke-dashoffset: 47; }
}

