/* Suivi de commande GLAAZ — même identité que GlaazBoard (refonte 2027) */
:root {
  --navy: #003955; --navy-700: #002C42; --navy-50: #E8EEF2;
  --cream: #E9E4E0; --cream-50: #F7F5F2; --cream-100: #F2EFEB; --cream-200: #EEEAE5;
  --gold: #E3A23B; --gold-50: #FBF1E0; --gold-700: #B86E12;
  --ink: #0C2433; --muted: #6E7F8A; --line: rgba(0, 57, 85, .10);
  --ok: #2F8F5B; --ok-50: #E6F3EB; --alerte: #C2452F; --alerte-50: #FBEAE5;
  --display: Unbounded, "Arial Black", system-ui, sans-serif;
  --r-carte: 26px;
  color-scheme: light;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: Geist, ui-sans-serif, system-ui, -apple-system, sans-serif;
  background: var(--cream-50); color: var(--ink);
  font-size: 15px; line-height: 1.5; min-height: 100dvh;
  display: flex; flex-direction: column;
  font-variant-numeric: tabular-nums;
}
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--navy); }
:focus-visible { outline: 3px solid rgba(227, 162, 59, .55); outline-offset: 2px; border-radius: 10px; }

/* ── En-tête bleu ─────────────────────────────────────────── */
.hero {
  position: relative; overflow: hidden;
  background: var(--navy); color: var(--cream-50);
  border-radius: 0 0 34px 34px;
  padding: max(22px, env(safe-area-inset-top)) 20px 62px;
}
.hero-in { max-width: 728px; margin: 0 auto; position: relative; z-index: 1; }
.logo { display: block; height: 34px; width: auto; margin-bottom: 30px; }
.hero-texte { min-height: 86px; padding-right: 76px; }
.hero-bonjour { font-size: 14px; color: rgba(233, 228, 224, .72); }
.hero-projet { font-family: var(--display); font-weight: 600; font-size: clamp(24px, 6.4vw, 34px); line-height: 1.15; letter-spacing: -.01em; margin-top: 6px; overflow-wrap: anywhere; }
.hero-societe { font-size: 14px; color: rgba(233, 228, 224, .72); margin-top: 8px; }
.viking {
  position: absolute; right: 18px; bottom: -30px; width: 86px; height: 102px;
  /* Viking caché, avec son tour crème : affiché tel quel (deux couleurs) */
  background: url(/vik-cache.svg) no-repeat right bottom / contain;
}

/* ── Contenu ─────────────────────────────────────────────── */
.contenu { flex: 1; width: 100%; max-width: 760px; margin: -38px auto 0; padding: 0 16px 28px; position: relative; z-index: 2; display: flex; flex-direction: column; gap: 14px; }
.carte { background: #fff; border: 1px solid var(--line); border-radius: var(--r-carte); padding: 22px 20px; box-shadow: 0 18px 40px -28px rgba(0, 30, 45, .35); }
.carte-titre { font-family: var(--display); font-weight: 500; font-size: 17px; letter-spacing: -.005em; }
.carte-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sur-titre { font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.discret { font-size: 13px; color: var(--muted); }

/* ── Avancement ──────────────────────────────────────────── */
.etape-actuelle { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.etape-nom { font-family: var(--display); font-weight: 600; font-size: 22px; margin-top: 4px; }
.etape-phrase { font-size: 14.5px; color: var(--muted); margin-top: 4px; }
.frise { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 20px; }
.frise li { display: flex; flex-direction: column; gap: 8px; font-size: 11.5px; color: var(--muted); min-width: 0; }
.frise .barre { height: 6px; border-radius: 99px; background: var(--cream-200); }
.frise .fait .barre { background: var(--navy); }
.frise .actuel .barre { background: linear-gradient(90deg, var(--navy) 0 55%, var(--gold) 55%); }
.frise .actuel { color: var(--ink); font-weight: 600; }
.frise span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 480px) { .frise span:last-child { display: none; } .frise .actuel span:last-child { display: block; overflow: visible; } }
.infos { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.puce { display: inline-flex; align-items: center; gap: 7px; padding: 8px 12px; border-radius: 99px; background: var(--cream-100); font-size: 13.5px; font-weight: 500; text-decoration: none; color: var(--ink); }
a.puce:hover { background: var(--cream-200); }
.puce svg { flex-shrink: 0; }

/* ── BAT ─────────────────────────────────────────────────── */
.statut { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.statut::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.statut-attente { background: var(--gold-50); color: var(--gold-700); }
.statut-ok { background: var(--ok-50); color: var(--ok); }
.statut-refus { background: var(--alerte-50); color: var(--alerte); }
.statut-remplacee { background: var(--cream-200); color: var(--muted); }
.note { border-left: 3px solid var(--gold); background: var(--cream-50); border-radius: 10px; padding: 12px 14px; font-size: 14px; margin-bottom: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note b { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
.apercu { border-radius: 18px; overflow: hidden; background: var(--cream-100); border: 1px solid var(--line); }
.apercu img { display: block; width: 100%; height: auto; max-height: 70vh; object-fit: contain; background: var(--cream-100); }
.apercu iframe { display: block; width: 100%; height: min(72vh, 760px); border: 0; background: var(--cream-100); }
.apercu-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.decision { margin-top: 16px; padding: 14px 16px; border-radius: 16px; font-size: 14px; }
.decision-ok { background: var(--ok-50); }
.decision-refus { background: var(--alerte-50); }
.decision p + p { margin-top: 6px; }
.decision .citation { white-space: pre-wrap; overflow-wrap: anywhere; }
.actions { display: grid; grid-template-columns: 1fr 1.25fr; gap: 10px; margin-top: 16px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 12px 18px; border-radius: 16px; border: 1px solid transparent; font-size: 15px; font-weight: 600; text-decoration: none; transition: filter .15s, background .15s; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-or { background: var(--gold); color: #1d1405; }
.btn-or:not(:disabled):hover { filter: brightness(1.05); }
.btn-bleu { background: var(--navy); color: var(--cream-50); }
.btn-bleu:not(:disabled):hover { background: var(--navy-700); }
.btn-ligne { background: #fff; border-color: var(--line); color: var(--ink); }
.btn-ligne:hover { background: var(--cream-50); }
.btn-petit { min-height: 38px; padding: 8px 14px; font-size: 13.5px; border-radius: 12px; }
.lien { background: none; border: 0; color: var(--navy); font-weight: 500; font-size: 13.5px; text-decoration: underline; text-underline-offset: 3px; }

/* Barre d'actions collée en bas sur téléphone */
@media (max-width: 640px) {
  .actions.collee { position: sticky; bottom: max(10px, env(safe-area-inset-bottom)); z-index: 5; background: rgba(255, 255, 255, .92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); padding: 10px; margin: 16px -10px -10px; border-radius: 22px; border: 1px solid var(--line); box-shadow: 0 12px 32px -12px rgba(0, 30, 45, .35); }
}

.versions { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.versions summary { cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--muted); list-style: none; }
.versions summary::-webkit-details-marker { display: none; }
.versions summary::before { content: "＋ "; }
.versions[open] summary::before { content: "－ "; }
.versions ul { list-style: none; margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.versions li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; background: var(--cream-50); font-size: 13.5px; }

/* ── Messages ────────────────────────────────────────────── */
.fil { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.bulle { max-width: 86%; padding: 10px 14px; border-radius: 18px; font-size: 14.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bulle small { display: block; font-size: 11.5px; margin-top: 4px; opacity: .7; }
.bulle-glaaz { align-self: flex-start; background: var(--cream-100); border-bottom-left-radius: 6px; }
.bulle-client { align-self: flex-end; background: var(--navy); color: var(--cream-50); border-bottom-right-radius: 6px; }
.vide { font-size: 14px; color: var(--muted); margin-bottom: 14px; }
.ecrire { display: flex; gap: 8px; align-items: flex-end; }
.champ { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: #fff; font-size: 16px; outline: none; resize: none; }
.champ:focus { border-color: rgba(0, 57, 85, .4); box-shadow: 0 0 0 3px rgba(0, 57, 85, .1); }
textarea.champ { min-height: 48px; max-height: 180px; }
textarea.champ-haut { min-height: 130px; max-height: none; resize: vertical; }
.version-droite { display: flex; gap: 8px; align-items: center; }
.envoyer { width: 48px; height: 48px; flex-shrink: 0; border-radius: 16px; border: 0; background: var(--navy); color: var(--cream-50); display: grid; place-items: center; }
.envoyer:disabled { opacity: .4; }

/* ── Panneau du bas (sheet) ──────────────────────────────── */
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet[hidden] { display: none; }
.sheet-fond { position: absolute; inset: 0; background: rgba(0, 44, 66, .42); animation: fadeIn .2s ease; }
.sheet-panneau { position: relative; width: 100%; max-width: 520px; max-height: 90dvh; overflow-y: auto; background: #fff; border-radius: 28px 28px 0 0; padding: 10px 20px max(22px, env(safe-area-inset-bottom)); animation: sheetUp .28s cubic-bezier(.2, .8, .2, 1); }
@media (min-width: 641px) { .sheet { align-items: center; } .sheet-panneau { border-radius: 28px; padding-bottom: 24px; } }
.sheet-poignee { width: 40px; height: 6px; border-radius: 99px; background: rgba(110, 127, 138, .3); margin: 0 auto 6px; }
@media (min-width: 641px) { .sheet-poignee { display: none; } }
.sheet-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0 14px; }
.sheet-tete h2 { font-family: var(--display); font-weight: 500; font-size: 19px; line-height: 1.3; }
.rond { width: 36px; height: 36px; flex-shrink: 0; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--muted); display: grid; place-items: center; }
.sheet-corps { display: flex; flex-direction: column; gap: 14px; }
.liste-verif { list-style: none; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: 16px; background: var(--cream-50); font-size: 14px; }
.liste-verif li { display: flex; gap: 10px; align-items: flex-start; }
.liste-verif li::before { content: "✓"; color: var(--navy); font-weight: 700; }
.etiquette { display: block; font-size: 12.5px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.case { display: flex; gap: 12px; align-items: flex-start; font-size: 14px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; cursor: pointer; }
.case input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--navy); flex-shrink: 0; }
.erreur { font-size: 13.5px; color: var(--alerte); }

/* ── États ───────────────────────────────────────────────── */
.sk { display: block; border-radius: 10px; background: rgba(233, 228, 224, .18); animation: pulse 1.4s ease-in-out infinite; }
.sk-sm { width: 120px; height: 14px; }
.sk-lg { width: 70%; height: 34px; margin-top: 10px; }
.carte-sk { height: 160px; animation: pulse 1.4s ease-in-out infinite; background: #fff; }
.invalide { text-align: center; padding: 40px 24px; }
.invalide h1 { font-family: var(--display); font-weight: 500; font-size: 20px; margin-bottom: 8px; }
.toast { position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--cream-50); padding: 12px 18px; border-radius: 16px; font-size: 14px; font-weight: 500; box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .5); animation: sheetUp .25s ease; max-width: calc(100% - 32px); }

.pied { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 8px 16px max(22px, env(safe-area-inset-bottom)); font-size: 12.5px; color: var(--muted); }
.viking-mini { width: 22px; height: 28px; background: var(--muted); opacity: .6; -webkit-mask: url(/viking-cachette.svg) no-repeat center / contain; mask: url(/viking-cachette.svg) no-repeat center / contain; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes sheetUp { from { transform: translateY(24px); opacity: 0; } }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
