/* =====================================================================
   Feuio — socle visuel commun (vitrine, compte client, admin)
   Les couleurs de marque, les polices et les rayons ne se règlent QU'ICI.
   ===================================================================== */

@font-face { font-family: "Fraunces"; src: url("../vendor/fonts/fraunces-var.woff2") format("woff2"); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../vendor/fonts/fraunces-var-italic.woff2") format("woff2"); font-weight: 300 900; font-style: italic; font-display: swap; }
@font-face { font-family: "Inter Tight"; src: url("../vendor/fonts/intertight-var.woff2") format("woff2"); font-weight: 300 800; font-style: normal; font-display: swap; }

:root {
  /* Marque */
  --brand-name: "Feuio";
  --brand: #0F5C57;            /* vert lagon profond : couleur principale */
  --brand-ink: #FFFFFF;        /* texte posé sur --brand */
  --brand-soft: #E3F0EE;       /* fond léger teinté marque */
  --accent: #E8833A;           /* orange papaye : appels à l'action secondaires, surlignages */
  --accent-soft: #FDEBDD;

  /* Neutres « papier » */
  --bg: #FAF8F4;               /* papier crème */
  --bg-2: #F3EFE7;
  --surface: #FFFFFF;
  --surface-2: #FBFAF7;
  --ink: #17191C;              /* encre */
  --ink-2: #3D424A;
  --muted: #6E7480;
  --line: #E6E1D7;
  --line-2: #D8D1C3;

  /* États */
  --ok: #1F8A5B;   --ok-soft: #E2F4EA;
  --warn: #B7791F; --warn-soft: #FBF0D9;
  --err: #C2412D;  --err-soft: #FBE6E2;
  --info: #2F6FB3; --info-soft: #E3EEFA;

  /* Typographie */
  --font-display: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-text: "Inter Tight", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  --fs-xs: 12px; --fs-sm: 13.5px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 20px;
  --fs-2xl: clamp(24px, 2.2vw, 30px); --fs-3xl: clamp(30px, 3.6vw, 44px); --fs-4xl: clamp(38px, 5.6vw, 72px);
  --lh-tight: 1.08; --lh: 1.5;

  /* Espacements, formes, ombres, mouvements */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;
  --r-sm: 8px; --r: 12px; --r-lg: 18px; --r-xl: 28px; --r-pill: 999px;
  --sh-1: 0 1px 2px rgba(23,25,28,.06), 0 1px 1px rgba(23,25,28,.04);
  --sh-2: 0 6px 18px -6px rgba(23,25,28,.14), 0 2px 6px rgba(23,25,28,.05);
  --sh-3: 0 24px 60px -18px rgba(23,25,28,.28), 0 8px 20px -8px rgba(23,25,28,.12);
  --ease: cubic-bezier(.2,.7,.2,1); --ease-out: cubic-bezier(.16,1,.3,1);
  --t-fast: 140ms; --t: 240ms; --t-slow: 520ms;
  --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 35%, transparent);
  --maxw: 1180px;
  color-scheme: light;
}

/* Mode sombre : automatique, ou forcé par data-theme */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #4FB7AC; --brand-ink: #0B1413; --brand-soft: #14302D;
    --accent: #F29A57; --accent-soft: #3A2516;
    --bg: #121416; --bg-2: #181B1E; --surface: #1B1E22; --surface-2: #202429;
    --ink: #EEF0F2; --ink-2: #C9CDD3; --muted: #9AA1AC; --line: #2A2F35; --line-2: #353B42;
    --ok-soft: #13291F; --warn-soft: #2E2410; --err-soft: #331713; --info-soft: #132235;
    --sh-1: 0 1px 2px rgba(0,0,0,.4); --sh-2: 0 8px 22px -8px rgba(0,0,0,.6); --sh-3: 0 28px 70px -20px rgba(0,0,0,.75);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #4FB7AC; --brand-ink: #0B1413; --brand-soft: #14302D;
  --accent: #F29A57; --accent-soft: #3A2516;
  --bg: #121416; --bg-2: #181B1E; --surface: #1B1E22; --surface-2: #202429;
  --ink: #EEF0F2; --ink-2: #C9CDD3; --muted: #9AA1AC; --line: #2A2F35; --line-2: #353B42;
  --ok-soft: #13291F; --warn-soft: #2E2410; --err-soft: #331713; --info-soft: #132235;
  --sh-1: 0 1px 2px rgba(0,0,0,.4); --sh-2: 0 8px 22px -8px rgba(0,0,0,.6); --sh-3: 0 28px 70px -20px rgba(0,0,0,.75);
  color-scheme: dark;
}

/* ---------- Remise à zéro douce ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: var(--fs-md)/var(--lh) var(--font-text);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; font-feature-settings: "ss01", "cv11"; }
img, svg, video, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
[hidden] { display: none !important; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
::selection { background: color-mix(in srgb, var(--accent) 35%, transparent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Mouvement réduit : partout SAUF dans le lecteur (.fr, que reader.js pose sur son hôte). Le lecteur gère
   lui-même le mouvement réduit (reader.css), comme sur v.php qui ne charge pas base.css. Avec 0,01 ms
   imposé, StPageFlip mesurait mal ses pages (113 px au lieu de 269, vitrine, 29/10/2026).
   :where() garde la spécificité nulle de * ; un navigateur sans :not() complexe ignore la règle. */
@media (prefers-reduced-motion: reduce) {
  :where(:not(.fr, .fr *)), :where(:not(.fr, .fr *))::before, :where(:not(.fr, .fr *))::after {
    animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Typographie ---------- */
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 560; letter-spacing: -.02em; line-height: var(--lh-tight); margin: 0; font-variation-settings: "opsz" 96, "SOFT" 30; }
h1 { font-size: var(--fs-4xl); } h2 { font-size: var(--fs-3xl); } h3 { font-size: var(--fs-2xl); }
h4 { font-size: var(--fs-lg); font-weight: 650; margin: 0; letter-spacing: -.01em; }
p { margin: 0 0 var(--s4); }
.lead { font-size: var(--fs-lg); color: var(--ink-2); max-width: 62ch; }
.muted { color: var(--muted); }
.eyebrow { font-size: var(--fs-xs); font-weight: 650; letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
em.serif, .serif-i { font-family: var(--font-display); font-style: italic; font-weight: 420; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Mise en page ---------- */
.wrap { width: min(var(--maxw), 100% - 32px); margin-inline: auto; }
.stack > * + * { margin-top: var(--s4); }
.row { display: flex; align-items: center; gap: var(--s3); }
.row.wrap-ok { flex-wrap: wrap; }
.spacer { flex: 1; }
.grid { display: grid; gap: var(--s5); }

/* ---------- Boutons ---------- */
.btn { --b-bg: var(--surface); --b-ink: var(--ink); --b-line: var(--line-2);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 42px; padding: 0 18px; border-radius: var(--r-pill); border: 1px solid var(--b-line);
  background: var(--b-bg); color: var(--b-ink); font-weight: 600; font-size: var(--fs-md); line-height: 1;
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast), border-color var(--t-fast), box-shadow var(--t) var(--ease); }
.btn:hover { border-color: var(--ink-2); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn[disabled], .btn.is-loading { opacity: .55; pointer-events: none; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { --b-bg: var(--brand); --b-ink: var(--brand-ink); --b-line: var(--brand); box-shadow: 0 6px 16px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn-primary:hover { --b-bg: color-mix(in srgb, var(--brand) 88%, #000); border-color: transparent; box-shadow: 0 10px 22px -10px color-mix(in srgb, var(--brand) 80%, transparent); }
.btn-accent { --b-bg: var(--accent); --b-ink: #1A0F06; --b-line: var(--accent); }
.btn-ghost { --b-bg: transparent; --b-line: transparent; }
.btn-ghost:hover { --b-bg: var(--bg-2); border-color: transparent; }
.btn-danger { --b-bg: var(--err); --b-ink: #fff; --b-line: var(--err); }
.btn-lg { min-height: 52px; padding: 0 26px; font-size: var(--fs-lg); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: var(--fs-sm); }
.btn-icon { width: 40px; min-height: 40px; padding: 0; border-radius: var(--r); }
.btn.is-loading::after { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Champs ---------- */
.field { display: grid; gap: 6px; }
.field > label, .label { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.hint { font-size: var(--fs-xs); color: var(--muted); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 14px; border-radius: var(--r); border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:hover, .select:hover, .textarea:hover { border-color: var(--muted); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand); box-shadow: var(--focus); }
.input[aria-invalid="true"] { border-color: var(--err); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); margin-top: 2px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--line-2); transition: background var(--t); pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: var(--sh-1); transition: transform var(--t) var(--ease-out); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }

/* ---------- Cartes, badges, séparateurs ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--sh-1); }
.card.hover { transition: transform var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out), border-color var(--t); }
.card.hover:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.badge { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: var(--fs-xs); font-weight: 650; background: var(--bg-2); color: var(--ink-2); white-space: nowrap; }
.badge.brand { background: var(--brand-soft); color: var(--brand); }
.badge.accent { background: var(--accent-soft); color: color-mix(in srgb, var(--accent) 70%, var(--ink)); }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.err { background: var(--err-soft); color: var(--err); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
hr, .sep { border: 0; border-top: 1px solid var(--line); margin: var(--s5) 0; }
.kbd { font: 600 11px/1 var(--font-text); padding: 3px 6px; border-radius: 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; background: var(--surface); }

/* ---------- Alertes ---------- */
.alert { display: flex; gap: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r); background: var(--info-soft); color: var(--ink); font-size: var(--fs-sm); }
.alert.ok { background: var(--ok-soft); } .alert.warn { background: var(--warn-soft); } .alert.err { background: var(--err-soft); }

/* ---------- Fenêtre (modal) et volet ---------- */
.modal-back { position: fixed; inset: 0; z-index: 80; background: color-mix(in srgb, #0B0D10 55%, transparent); backdrop-filter: blur(6px);
  display: grid; place-items: center; padding: var(--s4); animation: fade var(--t) var(--ease); }
.modal { width: min(520px, 100%); max-height: calc(100dvh - 32px); overflow: auto; background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--sh-3); padding: var(--s6); animation: rise var(--t-slow) var(--ease-out); }
.modal h3 { margin-bottom: var(--s3); }
.modal .actions { display: flex; justify-content: flex-end; gap: var(--s2); margin-top: var(--s5); }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98); } }

/* ---------- Notification (toast) ---------- */
.toasts { position: fixed; z-index: 90; left: 50%; bottom: 24px; transform: translateX(-50%); display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.toast { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r); background: var(--ink); color: var(--bg);
  box-shadow: var(--sh-3); font-size: var(--fs-sm); animation: rise var(--t) var(--ease-out); }
.toast.ok::before { content: "✓"; color: #7EE2B0; font-weight: 800; } .toast.err::before { content: "!"; color: #FF9C8A; font-weight: 800; }

/* ---------- Squelette de chargement ---------- */
.skel { background: linear-gradient(90deg, var(--bg-2) 0%, var(--surface-2) 50%, var(--bg-2) 100%); background-size: 200% 100%; animation: shimmer 1.3s infinite linear; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Tableaux ---------- */
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.table th { text-align: left; font-weight: 650; color: var(--muted); font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .06em; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.table td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:hover td { background: var(--surface-2); }

/* ---------- Onglets ---------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: var(--bg-2); }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: var(--r-pill); font-weight: 600; font-size: var(--fs-sm); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--sh-1); }

/* ---------- État vide ---------- */
.empty { text-align: center; padding: var(--s8) var(--s5); border: 1.5px dashed var(--line-2); border-radius: var(--r-xl); background: var(--surface-2); }
.empty h3 { margin-bottom: var(--s2); }
