/**
 * AFRICA POST PRO — feuille de style du poste de travail.
 *
 * Ce n'est pas le site : c'est un outil qu'on utilise debout, derriere un
 * comptoir, sur un telephone, parfois d'une seule main pendant qu'on tient un
 * colis de l'autre. Les choix suivent cet usage, pas l'esthetique du site
 * public.
 *
 *   · Fond CLAIR. Un ecran sombre est illisible sous un neon de boutique ou
 *     derriere une vitrine en plein jour. La console de direction a fait le
 *     meme choix pour la meme raison.
 *   · Cibles tactiles de 48 px minimum, et champs a 16 px : en dessous, iOS
 *     zoome tout seul a chaque fois qu'on entre dans un champ.
 *   · Les bandeaux d'etat passent AVANT le contenu et ne se referment pas.
 *     Un depot en attente d'envoi n'est pas une notification : c'est un fait
 *     qui doit rester sous les yeux.
 */

:root {
  --vert: #047857;
  --vert-clair: #E6F2EC;
  --vert-vif: #059669;
  --encre: #14201B;
  --encre-douce: #5B6B62;
  --papier: #F7F6F2;
  --surface: #FFFFFF;
  --trait: #E1DED4;
  --trait-fort: #C7C2B3;
  --ambre: #8A5B12;
  --ambre-fond: #FBF0DA;
  --brique: #96301F;
  --brique-fond: #FBE7E2;
  --rayon: 10px;
  /* Retouches validees par Ange le 12/10 (maquette MQ9e23TcLxJ6GZtKTkBQH8) :
     un appui se sent, meme avec des gants. Courbe forte, 120 ms. */
  --appui: cubic-bezier(0.23, 1, 0.32, 1);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--papier);
  color: var(--encre);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: rgba(5, 150, 105, .15);
}

#app { max-width: 720px; margin: 0 auto; padding: 0 16px 64px; }
/* viewport-fit=cover (index.html) : l'encoche et la barre d'accueil de
   l'iPhone ne recouvrent pas le contenu (audit du 13/10). max() garde 16 px
   partout ou l'ecran n'a pas d'encoche. */
@supports (padding: max(0px)) {
  #app { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); padding-bottom: max(64px, calc(env(safe-area-inset-bottom) + 24px)); }
}

h1 { font-size: 26px; line-height: 1.15; margin: 0 0 6px; letter-spacing: -.02em; }
h2 { font-size: 20px; line-height: 1.2; margin: 22px 0 12px; letter-spacing: -.01em; }
p { margin: 0 0 12px; }

.q { color: var(--encre-douce); font-size: 14px; font-weight: 400; }
.pastille {
  display: inline-grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--vert); color: #fff; font-weight: 800; font-size: 13px;
  letter-spacing: .02em; flex: none;
}

/* ── Connexion ─────────────────────────────────────────────────────────── */
body.connexion { display: grid; place-items: center; min-height: 100vh; min-height: 100dvh; }
body.connexion #app { width: 100%; padding: 24px 16px; }

.conn-carte {
  background: var(--surface); border: 1px solid var(--trait);
  border-radius: 14px; padding: 26px 22px;
  box-shadow: 0 1px 2px rgba(20,32,27,.04), 0 14px 40px -20px rgba(20,32,27,.28);
}
.conn-marque {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; color: var(--encre-douce); margin-bottom: 18px;
}
.conn-marque b { color: var(--encre); }
.conn-sous { color: var(--encre-douce); margin-bottom: 20px; }
.conn-note {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--trait);
  color: var(--encre-douce); font-size: 14px;
}

label {
  display: block; font-size: 14px; font-weight: 600;
  margin: 16px 0 6px; color: var(--encre);
}
input, select, textarea {
  width: 100%; font: inherit; font-size: 16px;   /* 16px : iOS ne zoome pas */
  padding: 13px 14px; border: 1px solid var(--trait-fort);
  border-radius: var(--rayon); background: var(--surface); color: var(--encre);
  min-height: 48px;
}
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--vert-vif); outline-offset: 1px; border-color: var(--vert-vif);
}

button { font: inherit; cursor: pointer; }
.principal {
  display: block; width: 100%; margin-top: 22px;
  min-height: 52px; padding: 14px 20px;
  background: var(--vert); color: #fff; border: none;
  border-radius: var(--rayon); font-size: 17px; font-weight: 700;
}
.principal { transition: transform 120ms var(--appui), background-color 120ms ease; }
.principal:active { transform: scale(0.97); }
/* Le survol seulement avec une souris : sur telephone, il restait colle. */
@media (hover: hover) and (pointer: fine) { .principal:not(:disabled):hover { background: var(--vert-vif); } }
/* Desactive LISIBLE : texte fonce sur fond clair (le blanc sur beige faisait 1,8). */
.principal:disabled { background: var(--trait); color: var(--encre-douce); cursor: not-allowed; transform: none; }
.principal:focus-visible, .lien:focus-visible, .onglet:focus-visible {
  outline: 2px solid var(--vert-vif); outline-offset: 2px;
}
.lien {
  background: none; border: none; color: var(--vert);
  font-weight: 600; font-size: 14px; padding: 8px 4px;
  text-decoration: underline; text-underline-offset: 2px;
}

.alerte {
  background: var(--brique-fond); border: 1px solid var(--brique);
  color: var(--brique); border-radius: var(--rayon);
  padding: 12px 14px; margin: 14px 0; font-size: 15px;
}

/* ── Application ───────────────────────────────────────────────────────── */
.tete {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0 14px; border-bottom: 1px solid var(--trait); margin-bottom: 12px;
}
.tete-site { display: flex; align-items: center; gap: 11px; min-width: 0; }
.tete-site b { display: block; font-size: 16px; line-height: 1.2; }
.tete-site .q { display: block; font-size: 13px; }
.tete-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px 14px; }

.onglets {
  display: flex; gap: 4px; margin: 0 0 8px;
  border-bottom: 1px solid var(--trait); overflow-x: auto;
}
.onglet {
  flex: 1 1 auto; min-height: 48px; padding: 12px 14px; white-space: nowrap;
  background: none; border: none; border-bottom: 3px solid transparent;
  color: var(--encre-douce); font-size: 15px; font-weight: 600;
}
.onglet.actif { color: var(--vert); border-bottom-color: var(--vert); }
.onglet { transition: transform 120ms var(--appui); }
.onglet:active { transform: scale(0.97); }

/* ── Bandeaux d'etat ───────────────────────────────────────────────────── */
.bandeau {
  border-radius: var(--rayon); padding: 13px 15px; margin: 10px 0;
  font-size: 15px; border: 1px solid;
}
.bandeau b { font-weight: 700; }
.bandeau ul { margin: 8px 0 0; padding-left: 18px; }
.bandeau li { margin: 3px 0; }
.bandeau.hors-ligne { background: var(--ambre-fond); border-color: var(--ambre); color: var(--ambre); }
.bandeau.attente    { background: var(--vert-clair); border-color: var(--vert); color: var(--vert); }
.bandeau.refuse     { background: var(--brique-fond); border-color: var(--brique); color: var(--brique); }
.bandeau .lien { color: inherit; }

.fraicheur {
  background: var(--ambre-fond); color: var(--ambre);
  border: 1px solid var(--ambre); border-radius: var(--rayon);
  padding: 10px 13px; font-size: 14px; margin: 10px 0 4px;
}

/* ── Formulaire de depot ───────────────────────────────────────────────── */
.formulaire fieldset {
  border: 1px solid var(--trait); border-radius: var(--rayon);
  padding: 4px 16px 18px; margin: 0 0 16px; background: var(--surface);
}
.formulaire legend {
  font-size: 13px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--encre-douce); padding: 0 6px;
}

/* ── Listes ────────────────────────────────────────────────────────────── */
.liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.liste li {
  background: var(--surface); border: 1px solid var(--trait);
  border-radius: var(--rayon); padding: 13px 15px;
}
.l-principal { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.etiquette {
  font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  background: var(--vert-clair); color: var(--vert);
  border-radius: 100px; padding: 3px 10px; white-space: nowrap;
}
.compte {
  font-size: 14px; font-weight: 700; color: var(--vert);
  background: var(--vert-clair); border-radius: 100px; padding: 2px 10px;
  vertical-align: middle;
}
.vide { color: var(--encre-douce); padding: 20px 0; }
.patiente { color: var(--encre-douce); padding: 28px 0; }

/* ── Chiffres ──────────────────────────────────────────────────────────── */
.chiffres {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1px; background: var(--trait);
  border: 1px solid var(--trait); border-radius: var(--rayon); overflow: hidden;
  margin-bottom: 16px;
}
.chiffre { background: var(--surface); padding: 15px 16px; }
.chiffre .n {
  display: block; font-size: 24px; font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; margin-bottom: 3px;
}
.chiffre .l { display: block; font-size: 13px; color: var(--encre-douce); line-height: 1.35; }

/* ── Confirmation ──────────────────────────────────────────────────────── */
.confirme {
  text-align: center; background: var(--surface);
  border: 1px solid var(--trait); border-radius: 14px; padding: 32px 22px; margin-top: 16px;
}
.coche {
  width: 58px; height: 58px; margin: 0 auto 14px;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--vert-clair); color: var(--vert); font-size: 30px; font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .principal:active, .onglet:active, .tou-touche:active { transform: none; }
}

/* ── Livraison a domicile : le pave du code (10/10) ───────────────────────
   Des variables du theme seulement : aucune couleur posee en dur. */
.tou-afficheur { display: flex; gap: 10px; justify-content: center; margin: 10px 0; }
.tou-chiffre {
  width: 48px; height: 56px; display: grid; place-items: center;
  background: var(--surface); border: 2px solid var(--trait-fort); border-radius: var(--rayon);
  font-size: 26px; font-weight: 800; color: var(--encre);
  font-variant-numeric: tabular-nums;
}
.tou-pave { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 8px 0; }
.tou-touche {
  min-height: 56px; border-radius: var(--rayon); border: 1px solid var(--trait-fort);
  background: var(--surface); color: var(--encre); font-size: 22px; font-weight: 700;
  transition: transform 120ms var(--appui), background-color 120ms ease;
}
.tou-touche:active { transform: scale(0.97); background: var(--vert-clair); }
.tou-touche[data-touche="ok"] { background: var(--vert); color: var(--surface); border-color: var(--vert); font-size: 17px; }
.tou-touche:focus-visible { outline: 2px solid var(--vert-vif); outline-offset: 2px; }
.tou-touche[data-touche="ok"]:active { background: var(--vert); }
