/* Appli clients — même style que l'appli SCAVI actuelle (V3 « Verre & clarté ») : fond gris clair, cartes blanches
   arrondies, Poppins, en-tête de verre avec le logo, barre d'onglets flottante. La couleur suit la société du client. */
:root {
  --fond: #f2f2f7; --carte: #fff; --texte: #1c1c1e; --gris: #6c6c70; --ligne: rgba(60,60,67,.14);
  --ombre: 0 1px 2px rgba(0,0,0,.04), 0 6px 20px rgba(0,0,0,.06);
  --ombre-barre: 0 8px 30px rgba(0,0,0,.16), 0 1px 3px rgba(0,0,0,.08);
  --rayon: 22px;
  --marque: #f47421; --marque-texte: #b75719; --marque-doux: rgba(244,116,33,.12); --sur-marque: #1c1c1e;
}
body.cln { --marque: #a82a23; --marque-texte: #a82a23; --marque-doux: rgba(168,42,35,.10); --sur-marque: #fff; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fond); color: var(--texte); font-family: Poppins, "Segoe UI", system-ui, sans-serif; -webkit-tap-highlight-color: transparent; }
button, input, textarea { font: inherit; color: inherit; }
a { color: var(--marque-texte); }
:focus-visible { outline: 2px solid var(--marque); outline-offset: 2px; }

/* ---------- Connexion ---------- */
.ecran-connexion { min-height: 100dvh; max-width: 440px; margin: 0 auto; padding: 56px 20px 32px; display: flex; flex-direction: column; gap: 28px; }
.ecran-connexion .tete { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.ecran-connexion .tete img { width: 190px; height: auto; }
.ecran-connexion h1 { margin: 6px 0 0; font-size: 30px; letter-spacing: -.025em; }
.ecran-connexion p { margin: 0; color: var(--gris); font-size: 14px; line-height: 1.5; }
.formulaire { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.formulaire label { font-size: 12px; font-weight: 600; color: var(--gris); display: flex; flex-direction: column; gap: 6px; }
.formulaire input { height: 48px; border-radius: 14px; border: 0; background: var(--fond); padding: 0 14px; font-size: 15px; color: var(--texte); }
.erreur { background: #fdecea; color: #7a1d14; border-radius: 14px; padding: 10px 14px; font-size: 14px; }
.pied { margin-top: auto; text-align: center; font-size: 13px; color: var(--gris); line-height: 1.5; }

/* ---------- Boutons ---------- */
.btn { border: 0; border-radius: 999px; height: 44px; padding: 0 18px; font-weight: 600; font-size: 14px; cursor: pointer; }
.btn-marque { background: var(--marque); color: var(--sur-marque); }
.btn-grand { height: 52px; font-size: 15px; }
.btn-clair { background: var(--carte); box-shadow: var(--ombre); }
.btn:disabled { opacity: .55; cursor: default; }

/* ---------- Appli ---------- */
.entete { position: sticky; top: 0; z-index: 10; background: rgba(242,242,247,.78); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--ligne); padding: calc(10px + env(safe-area-inset-top)) 16px 10px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.entete img { height: 34px; width: auto; }
.entete .qui { display: flex; align-items: center; gap: 10px; text-align: right; }
.entete .qui strong { display: block; font-size: 13px; }
.entete .qui button { border: 0; background: none; padding: 0; font-size: 11px; color: var(--gris); cursor: pointer; text-decoration: underline; }
.contenu { max-width: 720px; margin: 0 auto; padding: 18px 16px calc(110px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.titre { margin: 0; font-size: 30px; font-weight: 700; letter-spacing: -.025em; line-height: 1.12; }
.sous-titre { margin: -8px 0 0; font-size: 13px; color: var(--gris); }
.carte { background: var(--carte); border-radius: var(--rayon); box-shadow: var(--ombre); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.ligne { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ligne.haut { align-items: flex-start; }
.nom { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.3; }
.info { margin: 0; font-size: 12px; color: var(--gris); }
.dispo { color: #2f7a3e; font-weight: 600; }
.indispo { color: #8a3a06; font-weight: 600; }
.prix { font-size: 16px; font-weight: 700; white-space: nowrap; }
.prix small { font-size: 11px; font-weight: 500; color: var(--gris); }
.pas { display: flex; align-items: center; gap: 4px; background: var(--fond); border-radius: 999px; padding: 0 4px; height: 44px; }
.pas button { width: 36px; height: 36px; border: 0; border-radius: 999px; background: #fff; font-size: 18px; font-weight: 600; cursor: pointer; }
.pas span { min-width: 62px; text-align: center; font-size: 13px; font-weight: 600; }
.puces { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.puce { border: 0; background: rgba(118,118,128,.12); border-radius: 999px; height: 36px; padding: 0 14px; font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.puce.actif { background: #fff; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.recherche { height: 44px; border: 0; border-radius: 14px; background: #fff; box-shadow: var(--ombre); padding: 0 14px; font-size: 15px; }
.vide { text-align: center; padding: 28px 16px; align-items: center; }
.encadre { background: var(--marque-doux); border-radius: 16px; padding: 12px 14px; font-size: 13px; line-height: 1.5; }

/* ---------- Barre d'onglets flottante ---------- */
.barre { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20; max-width: 520px; margin: 0 auto; height: 64px;
  background: rgba(255,255,255,.72); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px);
  border: .5px solid rgba(255,255,255,.6); border-radius: 999px; box-shadow: var(--ombre-barre); display: flex; align-items: center; padding: 0 8px; }
.onglet { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: 10px; font-weight: 500; letter-spacing: -.03em; color: var(--gris); cursor: pointer; position: relative; padding: 6px 0; }
.onglet svg { width: 23px; height: 23px; }
.onglet.actif { color: var(--marque-texte); font-weight: 600; }
.badge { position: absolute; top: 0; left: calc(50% + 6px); background: var(--marque); color: var(--sur-marque); font-size: 10px; font-weight: 700; border-radius: 999px; min-width: 16px; height: 16px; line-height: 16px; text-align: center; padding: 0 4px; }

.etiquette { margin: 6px 0 0; font-size: 12px; font-weight: 600; color: var(--gris); }
.zone-texte { border: 0; border-radius: 16px; padding: 12px 14px; background: #fff; box-shadow: var(--ombre); resize: vertical; font-size: 14px; min-height: 80px; }
.etapes { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.etapes li { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--gris); }
.etapes li::before { content: ""; width: 12px; height: 12px; border-radius: 999px; border: 2px solid #d9d6d1; box-sizing: border-box; flex: none; }
.etapes li.fait { color: var(--texte); font-weight: 600; }
.etapes li.fait::before { background: var(--marque); border-color: var(--marque); }
details summary { cursor: pointer; }
details p { margin: 4px 0 0; }
.grille { display: flex; flex-direction: column; gap: 12px; }
.cote { display: none; }

/* ---------- ORDINATEUR : onglets en haut, produits en grille, commande toujours visible à droite ---------- */
@media (min-width: 900px) {
  #appli { display: flex; flex-direction: column; min-height: 100vh; }
  .entete { order: 0; padding: 12px 32px; }
  .entete img { height: 40px; }
  .barre { order: 1; position: sticky; top: 64px; z-index: 9; left: auto; right: auto; bottom: auto; margin: 14px auto 0; width: auto; height: 52px;
    background: rgba(118,118,128,.12); box-shadow: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; padding: 3px; gap: 2px; }
  .onglet { flex: none; flex-direction: row; gap: 8px; font-size: 14px; letter-spacing: 0; padding: 0 18px; height: 46px; border-radius: 999px; color: #3c3c43; }
  .onglet svg { width: 19px; height: 19px; }
  .onglet.actif { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
  .badge { position: static; margin-left: 2px; }
  .cadre { order: 2; width: 100%; max-width: 1280px; margin: 0 auto; padding: 24px 32px 48px; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
  .cadre.plein { grid-template-columns: minmax(0, 760px); justify-content: center; }
  .cadre .contenu { max-width: none; margin: 0; padding: 0; }
  .grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
  .grille .carte { justify-content: space-between; }
  .cote { display: flex; position: sticky; top: 140px; }
  .cote .carte { width: 100%; }
  .cote .lignes-cote { max-height: 46vh; overflow-y: auto; }
  .titre { font-size: 34px; }
}
