/* Allwayz — charte v1. Cahier de chantier : fond papier, une seule couleur d'accent, pas de dégradé.
   Rayon 4 px, bordure 1 px, grille de 8 px, cibles tactiles de 48 px. */

@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-sans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("fonts/ibm-plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/ibm-plex-mono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/ibm-plex-mono-500.woff2") format("woff2"); }

:root {
  --paper: #F5F3EE;
  --surface: #FFFFFF;
  --ink: #1F2328;
  --slate: #5B6470;
  --line: #D9D5CC;
  --accent: #C2410C;
  --accent-hover: #9A3412;
  --success: #3F7D4E;
  --warning: #B7791F;
  --danger: #B42318;
  --texte: "IBM Plex Sans", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --large: 1080px;
  --rayon: 4px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--texte); font-size: 16px; line-height: 1.5; font-weight: 400; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1em; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--rayon); }

.conteneur { width: 100%; max-width: var(--large); margin: 0 auto; padding: 0 20px; }
@media (min-width: 760px) { .conteneur { padding: 0 32px; } }

/* Blocs : papier par défaut, blanc en alternance */
.bloc { padding: 48px 0; }
@media (min-width: 760px) { .bloc { padding: 56px 0; } }
.bloc.creme { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* Typographie */
.etiquette { display: block; margin: 0 0 12px; font-family: var(--mono); font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--slate); }
.titre { margin: 0; font-weight: 600; letter-spacing: -0.025em; line-height: 1.12; text-wrap: balance; }
h1.titre { font-size: clamp(32px, 5vw, 44px); }
h2.titre { font-size: clamp(24px, 3vw, 26px); letter-spacing: -0.02em; }
.orange { color: var(--accent); }
.pale { color: var(--slate); font-weight: 500; }
.chapo { max-width: 520px; margin: 16px 0 24px; font-size: 18px; line-height: 1.5; color: var(--slate); }

/* Marque + en-tête (blanc, collant, filet dessous) */
.marque { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; letter-spacing: -0.01em; font-size: 16px; line-height: 1; text-decoration: none; white-space: nowrap; color: var(--ink); }
.marque .carre { width: 14px; height: 14px; background: var(--accent); display: block; flex: none; }
.entete { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.entete .conteneur { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.nav { display: flex; align-items: center; gap: 28px; }
.nav .lien { color: var(--slate); text-decoration: none; font-size: 15px; }
.nav .lien:hover { color: var(--ink); }
@media (max-width: 680px) { .nav .lien { display: none; } }

/* Boutons : orange (principal) et à ligne (secondaire) */
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: var(--rayon); font-family: var(--texte); font-size: 15px; font-weight: 500; text-decoration: none; cursor: pointer; border: 1px solid transparent; transition: background-color .15s ease, border-color .15s ease; }
.bouton:active { transform: translateY(1px); }
.bouton:disabled { opacity: .45; cursor: not-allowed; }
.bouton-orange { background: var(--accent); color: #fff; }
.bouton-orange:hover { background: var(--accent-hover); }
.bouton-ligne { background: var(--surface); color: var(--ink); border-color: var(--line); }
.bouton-ligne:hover { border-color: var(--ink); }

/* Champs */
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 4px; }
input, select, textarea { width: 100%; min-height: 48px; font: inherit; font-size: 16px; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); padding: 10px 12px; }
input:hover, select:hover, textarea:hover { border-color: var(--slate); }
textarea { min-height: 96px; resize: vertical; }
.champ { margin-bottom: 16px; }

/* Lignes de tâches (liste d'éléments avec icône et état) */
.taches { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.tache { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 8px 12px; background: var(--paper); color: var(--ink); border-radius: var(--rayon); border: 1px solid var(--line); }
.tache .icone { flex: none; width: 32px; height: 32px; border-radius: var(--rayon); display: grid; place-items: center; background: var(--surface); color: var(--slate); border: 1px solid var(--line); }
.tache .libelle { flex: 1; font-weight: 500; }
.tache .etat { flex: none; padding: 3px 8px; border-radius: var(--rayon); font-size: 12px; font-weight: 500; background: var(--surface); color: var(--slate); border: 1px solid var(--line); }
.tache.fait { border-color: #c9dccf; }
.tache.fait .icone, .tache.fait .etat { color: var(--success); border-color: #c9dccf; }
.tache.alerte .etat { color: var(--warning); border-color: #ead7b0; }
.tache.erreur .etat { color: var(--danger); border-color: #f0c9c6; }

/* Cartes : collées, filets partagés, numéro mono orange */
.cartes { display: grid; gap: 0; margin-top: 24px; grid-template-columns: 1fr; border: 1px solid var(--line); background: var(--surface); }
@media (min-width: 760px) { .cartes { grid-template-columns: 1fr 1fr 1fr; } }
.carte { padding: 20px 22px 22px; background: var(--surface); border-bottom: 1px solid var(--line); }
.carte:last-child { border-bottom: 0; }
@media (min-width: 760px) { .carte { border-bottom: 0; border-right: 1px solid var(--line); } .carte:last-child { border-right: 0; } }
.carte .num { font-family: var(--mono); font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--accent); }
.carte h3 { margin: 10px 0 6px; font-weight: 600; letter-spacing: -0.02em; font-size: 17px; line-height: 1.25; }
.carte p { margin: 0; color: var(--slate); font-size: 15px; }

/* Étapes numérotées */
.etapes { list-style: none; padding: 0; margin: 0; display: grid; border: 1px solid var(--line); background: var(--surface); }
.etapes li { display: grid; grid-template-columns: auto 1fr; column-gap: 16px; row-gap: 4px; padding: 20px 22px; border-bottom: 1px solid var(--line); }
.etapes li:last-child { border-bottom: 0; }
.etapes .num { grid-row: span 2; padding-top: 2px; font-family: var(--mono); font-size: 13px; font-weight: 500; color: var(--accent); }
.etapes strong { font-size: 17px; font-weight: 600; letter-spacing: -0.02em; }
.etapes p { margin: 0; color: var(--slate); font-size: 15px; }

/* Encadré (filet orange à gauche) */
.encadre { margin-top: 24px; padding: 4px 0 4px 16px; border-left: 3px solid var(--accent); color: var(--slate); }
.encadre p:last-child { margin-bottom: 0; }

/* Tableaux */
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); font-size: 15px; }
th, td { text-align: left; vertical-align: top; padding: 10px 14px; border-bottom: 1px solid var(--line); }
th { font-weight: 500; color: var(--slate); background: var(--paper); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Onglets (colonne sur grand écran, bande sur mobile) */
.onglets { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.onglet { flex: none; min-height: 48px; padding: 12px 14px; text-align: left; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); transition: border-color .15s ease; }
.onglet:hover { border-color: var(--slate); }
.onglet[aria-selected="true"] { border-color: var(--ink); }
.onglet[aria-selected="true"] .num { color: var(--accent); }

/* Bloc de mesure : avant (gris) / après (vert) */
.mesure { margin: 0; padding: 18px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--rayon); }
.mesure figcaption { margin-bottom: 14px; font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); }
.barre { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: baseline; margin-bottom: 14px; }
.barre .qui { font-size: 14px; color: var(--slate); }
.barre .valeur { font-weight: 600; font-size: 17px; }
.barre .piste { grid-column: 1 / -1; height: 8px; border-radius: 4px; background: #EEEBE4; overflow: hidden; }
.barre .piste span { display: block; height: 100%; border-radius: 4px; background: #CFCAC0; transform: scaleX(var(--part)); transform-origin: left; }
.barre.apres .piste span { background: var(--success); min-width: 8px; }
.barre.apres .valeur { color: var(--success); }
.gain { display: inline-block; padding: 4px 10px; border-radius: var(--rayon); background: #E6F0E8; color: var(--success); font-size: 13px; font-weight: 600; }

/* Pied de page */
.pied { border-top: 1px solid var(--line); color: var(--slate); font-size: 13px; background: var(--paper); }
.pied .conteneur { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; padding-top: 16px; padding-bottom: 16px; }

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