/* grabe-storage — styles de base, DA GRABE (épuré : pas d'ombre, pas de bordure, panneaux arrondis, dégradés à 135°).
   Couleurs et rayons repris du Design System GRABE. Toute couleur passe par une variable ci-dessous. */

@font-face { font-family: "Source Sans 3"; src: url("/fonts/SourceSans3-VF.woff") format("woff"); font-weight: 200 900; font-style: normal; font-display: swap; }
@font-face { font-family: "ABeeZee"; src: url("/fonts/ABeeZee-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "ABeeZee"; src: url("/fonts/ABeeZee-Italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  /* Couleurs GRABE */
  --red-500: #ec1546; --red-700: #b8173e; --red-ink: #e0304a;
  --navy-500: #2b3546; --navy-900: #141c27;
  --ink: #26303f; --ink-2: #5b6472; --ink-3: #8a9099;
  --grey-50: #f6f6f5; --grey-100: #ececea; --grey-200: #e0e1de; --grey-300: #d0d2cf;
  --paper: #ffffff; --on-dark: #edf3f0;
  --on-accent: #ffffff; /* texte sur fond rouge ou marine (reste blanc dans le thème sombre) */
  --ok: #1f7a4d; --ok-bg: #e3f1e9; --warn: #9a5b00; --warn-bg: #f8eedc;
  --rule: rgba(38, 48, 63, .12);
  --focus: #2b3546;

  --grad-red: linear-gradient(135deg, var(--red-500), var(--red-700));
  --grad-navy: linear-gradient(135deg, var(--navy-500), var(--navy-900));
  --grad-grey: linear-gradient(135deg, var(--grey-100), var(--grey-300));

  /* Typo : titres = police d'affichage (Neulis quand la licence web est réglée, sinon Source Sans 3 en italique) */
  --font-display: "Neulis", "Source Sans 3", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-ui: "ABeeZee", "Source Sans 3", system-ui, sans-serif;

  /* Échelle (écran) */
  --fs-hero: clamp(28px, 4vw, 40px);
  --fs-title: 24px; --fs-accroche: 19px; --fs-sub: 15px; --fs-label: 13px;
  --fs-text: 15px; --fs-desc: 13px; --fs-mention: 12px;

  --radius-panel: 40px; --radius-card: 16px; --radius-field: 12px; --radius-pill: 999px;
  --gap: 16px; --pad: 24px;
  --maxw: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-body); font-size: var(--fs-text); line-height: 1.45; -webkit-font-smoothing: antialiased; }
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--red-500); color: var(--on-accent); }

/* ---------- Typo ---------- */
.t-hero, .t-title, .t-accroche, .t-sub, .t-label { font-family: var(--font-display); font-style: italic; font-weight: 600; margin: 0; letter-spacing: -.005em; }
.t-hero { font-size: var(--fs-hero); line-height: 1.1; }
.t-title { font-size: var(--fs-title); line-height: 1.2; }
.t-accroche { font-size: var(--fs-accroche); line-height: 1.25; }
.t-sub { font-size: var(--fs-sub); line-height: 1.25; }
.t-label { font-size: var(--fs-label); line-height: 1.2; }
.t-desc { font-family: var(--font-ui); font-size: var(--fs-desc); line-height: 1.35; color: var(--ink-2); }
.t-mention { font-family: var(--font-ui); font-style: italic; font-size: var(--fs-mention); line-height: 1.3; color: var(--ink-3); }
.t-muted { color: var(--ink-2); }
.t-num { font-variant-numeric: tabular-nums; }
p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

/* ---------- Mise en page ---------- */
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.stack { display: flex; flex-direction: column; gap: var(--gap); }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.grow { flex: 1 1 auto; min-width: 0; }
.center { display: grid; place-items: center; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Barre du haut */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; }
.topbar__logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.topbar__logo img { height: 26px; width: auto; }
.topbar__logo span { font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); letter-spacing: .04em; }

/* ---------- Panneaux et cartes (aucune ombre, aucune bordure) ---------- */
.panel { border-radius: var(--radius-panel); padding: 32px; background: var(--grad-grey); }
.panel--navy { background: var(--grad-navy); color: var(--on-dark); }
.panel--navy .t-hero, .panel--navy .t-title, .panel--navy .t-accroche, .panel--navy .t-sub { color: var(--on-accent); }
.panel--plain { background: var(--grey-50); }
.card { border-radius: var(--radius-card); padding: 16px; background: var(--grey-50); }
.card--grey { background: var(--grad-grey); }
.card--navy { background: var(--grad-navy); color: var(--on-dark); }
.card--red { background: var(--grad-red); color: var(--on-accent); }
.card--paper { background: var(--paper); }

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 20px; border: 0; border-radius: var(--radius-pill);
  background: var(--grad-navy); color: var(--on-accent); font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 15px; line-height: 1;
  cursor: pointer; text-decoration: none; white-space: nowrap; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.2); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; filter: none; }
.btn--red { background: var(--grad-red); }               /* décision attendue : valider, signer le BAT */
.btn--ghost { background: var(--grey-100); color: var(--ink); }
.btn--ghost:hover { filter: none; background: var(--grey-200); }
.btn--light { background: var(--paper); color: var(--ink); }
.btn--sm { min-height: 32px; padding: 6px 14px; font-size: 13px; }
.btn--lg { min-height: 52px; padding: 12px 28px; font-size: 17px; }
.btn--icon { width: 40px; padding: 0; }
.btn--icon.btn--sm { width: 32px; }
.btn--block { width: 100%; }
.linkbtn { border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }

/* ---------- Champs ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .field > label { font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 13px; }
.field small { font-family: var(--font-ui); font-size: 12px; color: var(--ink-3); }
.input, .select, .textarea { width: 100%; min-height: 44px; padding: 10px 14px; border: 0; border-radius: var(--radius-field); background: var(--grey-100); color: var(--ink); outline: none; }
.panel .input, .panel .select, .panel .textarea, .card--grey .input { background: var(--paper); }
.input:focus, .select:focus, .textarea:focus { box-shadow: 0 0 0 2px var(--focus); }
.textarea { min-height: 88px; resize: vertical; line-height: 1.4; }
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.check { display: inline-flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--red-500); flex: none; }
.seg { display: inline-flex; padding: 3px; border-radius: var(--radius-pill); background: var(--grey-100); gap: 2px; }
.seg button { border: 0; background: none; padding: 6px 14px; border-radius: var(--radius-pill); cursor: pointer; font-family: var(--font-ui); font-size: 13px; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--paper); color: var(--ink); }

/* ---------- Pastilles d'état ---------- */
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--radius-pill); background: var(--grey-100); color: var(--ink-2);
  font-family: var(--font-ui); font-size: 12px; line-height: 1.3; white-space: nowrap; }
.tag--ok { background: var(--ok-bg); color: var(--ok); }
.tag--warn { background: var(--warn-bg); color: var(--warn); }
.tag--red { background: var(--grad-red); color: var(--on-accent); }
.tag--navy { background: var(--grad-navy); color: var(--on-accent); }
.dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }

/* Pastille numérotée d'annotation */
.pin { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: var(--radius-pill);
  background: var(--grad-red); color: var(--on-accent); font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 12px; line-height: 1; }
.pin--done { background: var(--grey-300); color: var(--ink); }
.pin--admin { background: var(--grad-navy); }

/* ---------- Liste ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: var(--radius-card); background: var(--grey-50); text-decoration: none; color: inherit; }
a.list-item:hover, button.list-item:hover { background: var(--grey-100); }
button.list-item { border: 0; width: 100%; text-align: left; cursor: pointer; }
.thumb { width: 56px; height: 56px; border-radius: 12px; background: var(--grad-grey); overflow: hidden; flex: none; display: grid; place-items: center;
  font-family: var(--font-display); font-style: italic; font-weight: 600; font-size: 11px; color: var(--ink-2); text-transform: uppercase; }
.thumb img, .thumb video { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Barre de progression ---------- */
.progress { height: 6px; border-radius: var(--radius-pill); background: var(--grey-200); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--grad-red); border-radius: inherit; transition: width .2s; }

/* ---------- Zone de dépôt ---------- */
.drop { position: relative; display: grid; place-items: center; text-align: center; gap: 10px; min-height: 220px; padding: 32px; border-radius: var(--radius-panel);
  background: var(--grad-grey); cursor: pointer; transition: background .15s; }
.drop:hover, .drop.is-over { background: linear-gradient(135deg, var(--grey-200), var(--grey-300)); }
.drop.is-over::after { content: ""; position: absolute; inset: 10px; border-radius: 32px; outline: 2px dashed var(--ink-3); pointer-events: none; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop__plus { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-red); color: var(--on-accent); font-size: 28px; line-height: 1; }

/* ---------- Fenêtre (dialog) ---------- */
dialog.modal { border: 0; padding: 0; border-radius: 28px; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 32px); background: var(--paper); color: var(--ink); }
dialog.modal::backdrop { background: rgba(20, 28, 39, .55); }
.modal__body { padding: 28px; display: flex; flex-direction: column; gap: 16px; overflow: auto; max-height: calc(100vh - 32px); }
.modal__actions { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }

/* ---------- Message temporaire ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 1000; pointer-events: none; }
.toast { pointer-events: auto; padding: 12px 20px; border-radius: var(--radius-pill); background: var(--grad-navy); color: var(--on-accent); font-family: var(--font-ui); font-size: 14px; max-width: calc(100vw - 32px); }
.toast--error { background: var(--grad-red); }

/* ---------- États vides, chargement ---------- */
.empty { text-align: center; padding: 48px 16px; color: var(--ink-2); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--grey-300); border-top-color: var(--red-500); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--grey-100), var(--grey-50), var(--grey-100)); background-size: 200% 100%; animation: sk 1.2s ease-in-out infinite; border-radius: 12px; }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Divers ---------- */
.hr { height: 1px; background: var(--rule); border: 0; margin: 4px 0; }
.kbd { font-family: var(--font-ui); font-size: 11px; padding: 1px 6px; border-radius: 6px; background: var(--grey-100); color: var(--ink-2); }
.copy { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 14px; border-radius: var(--radius-pill); background: var(--grey-100); }
.copy code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-ui); font-size: 13px; }
.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; }
.icon { width: 18px; height: 18px; flex: none; }

@media (max-width: 640px) {
  .panel { padding: 22px; border-radius: 28px; }
  .drop { border-radius: 28px; min-height: 180px; }
  .topbar { padding: 16px; }
}

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