/* =====================================================================================================
   Couche « Apple » (chargée après style.css) : typographie système, matières en verre, ressorts,
   apparitions en cascade, transitions entre pages.
   Les plaquettes (.plaquette) ne sont volontairement PAS touchées (validées par Tom).
   Tout mouvement s'éteint avec « réduire les animations » (prefers-reduced-motion).
   ===================================================================================================== */
:root {
  --ressort: cubic-bezier(.2, .9, .25, 1.15);   /* léger dépassement, comme iOS */
  --doux: cubic-bezier(.22, .8, .2, 1);
  --rayon: 18px;
  --rayon-petit: 12px;
  --verre: rgba(22, 24, 30, .62);
  --ombre: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .28);
  --ombre-haute: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 6px rgba(0, 0, 0, .3), 0 22px 48px rgba(0, 0, 0, .38);
}
html { scroll-behavior: smooth; }
body {
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", Inter, Roboto, sans-serif;
  letter-spacing: -0.006em;
  background:
    radial-gradient(1100px 520px at 88% -12%, rgba(124, 108, 255, .16), transparent 60%),
    radial-gradient(900px 480px at -10% 110%, rgba(78, 161, 255, .08), transparent 60%),
    var(--fond);
  background-attachment: fixed;
}
h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; }
h2 { letter-spacing: -0.015em; }
[id] { scroll-margin-top: 90px; }

/* ---------- Barre du haut : verre dépoli, ombre quand on défile ---------- */
.barre {
  background: var(--verre);
  backdrop-filter: saturate(180%) blur(22px); -webkit-backdrop-filter: saturate(180%) blur(22px);
  transition: box-shadow .3s var(--doux), background .3s var(--doux);
}
.barre.defile { box-shadow: 0 8px 30px rgba(0, 0, 0, .35); background: rgba(16, 17, 22, .8); }
.barre nav a, .barre nav .lien { border-radius: 999px; padding: 7px 13px; transition: background .25s var(--doux), color .25s var(--doux); }
.barre nav a.actif { background: rgba(255, 255, 255, .1); box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset; }
.disque { animation: tourne 14s linear infinite; }

/* ---------- Cartes : verre, relief au survol ---------- */
.carte {
  border-radius: var(--rayon);
  background: linear-gradient(180deg, rgba(255, 255, 255, .03), transparent 40%), var(--surface);
  border-color: rgba(255, 255, 255, .07);
  transition: transform .45s var(--ressort), box-shadow .35s var(--doux), border-color .3s;
}
.ligne-commande, .proposition, .fournisseur, .expedition-ligne {
  transition: transform .45s var(--ressort), box-shadow .35s var(--doux), border-color .3s, background .3s;
}
.carte.cliquable:hover, .ligne-commande:hover, .proposition:hover {
  transform: translateY(-3px); box-shadow: var(--ombre-haute); border-color: rgba(255, 255, 255, .14);
}
.fournisseur, .ligne-commande, .proposition, .adresse-resume, .bordereau, .comparateur, .apercu { border-radius: var(--rayon); }

/* ---------- Boutons : appui qui s'enfonce, retour en ressort ---------- */
.bouton {
  border-radius: 999px; padding: 10px 18px; letter-spacing: -0.005em;
  background: linear-gradient(180deg, #8d80ff, var(--accent));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 8px 22px rgba(124, 108, 255, .32);
  transition: transform .35s var(--ressort), box-shadow .25s var(--doux), filter .2s, background .2s;
}
.bouton:hover { filter: brightness(1.08); transform: translateY(-1px); }
.bouton:active { transform: scale(.96); transition-duration: .08s; }
.bouton:disabled { transform: none; filter: none; }
.bouton.grand { border-radius: 999px; padding: 13px 24px; }
.bouton.secondaire { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1); }
.bouton.secondaire:hover { background: rgba(255, 255, 255, .1); }
.bouton.discret-bouton { background: transparent; }
.lien { transition: color .2s, opacity .2s; }
.lien:active { opacity: .6; }

/* ---------- Champs : halo de focus animé ---------- */
input, select, textarea {
  border-radius: var(--rayon-petit); background: rgba(255, 255, 255, .045); border-color: rgba(255, 255, 255, .1);
  transition: border-color .25s var(--doux), box-shadow .3s var(--doux), background .25s;
}
input:hover, select:hover, textarea:hover { border-color: rgba(255, 255, 255, .18); }
input:focus, select:focus, textarea:focus { background: rgba(255, 255, 255, .065); box-shadow: 0 0 0 4px rgba(124, 108, 255, .22); }
input[type=checkbox] { transition: transform .3s var(--ressort); }
input[type=checkbox]:active { transform: scale(.85); }

/* ---------- Puces, statuts, compteurs ---------- */
.puce { transition: background .25s var(--doux), border-color .25s, transform .35s var(--ressort), box-shadow .3s; }
.puce:active { transform: scale(.95); }
.puce:has(input:checked) { box-shadow: 0 0 0 1px var(--accent) inset, 0 6px 18px rgba(124, 108, 255, .2); }
.statut-en_cours::before, .statut-pret::before { animation: battement 1.6s ease-in-out infinite; }
.compteur.saute, .chiffre.saute { animation: saut .45s var(--ressort); }
.chiffre { font-variant-numeric: tabular-nums; display: inline-block; }
.resume-passe > div { border-radius: 16px; transition: transform .45s var(--ressort); }
.resume-passe > div:hover { transform: translateY(-2px); }
.progression span { transition: background .5s var(--doux); }

/* ---------- Dépliants : chevron qui tourne, contenu qui glisse ---------- */
summary { transition: color .2s; }
summary::before { transition: transform .35s var(--ressort); }
details[open] > :not(summary) { animation: deplier .4s var(--doux) both; }

/* ---------- Messages : arrivent en glissant, les confirmations s'effacent seules ---------- */
.flash { animation: arrivee .55s var(--ressort) both; display: flex; align-items: flex-start; gap: 12px; }
.flash .fermer { margin-left: auto; background: none; border: 0; color: inherit; opacity: .6; font-size: 20px; line-height: 1;
  cursor: pointer; padding: 0 2px; }
.flash .fermer:hover { opacity: 1; }
.flash.part { animation: depart .45s var(--doux) forwards; }

/* ---------- Apparitions en cascade (classe « anime » posée par app.js : sans JS, tout reste visible) ---------- */
.anime .apparait { opacity: 0; transform: translateY(16px) scale(.985); }
.anime .apparait.vu {
  opacity: 1; transform: none;
  transition: opacity .6s var(--doux) var(--retard, 0ms), transform .75s var(--ressort) var(--retard, 0ms);
}

/* ---------- Page client : en-tête vivant, étapes et lignes qui répondent ---------- */
.client-hero { background-size: 170% 170%; animation: aurore 16s ease-in-out infinite alternate; }
.etapes-client li { transition: transform .4s var(--ressort), background .3s; }
.etapes-client li:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .07); }
.avancement-client.ok strong { display: inline-block; animation: saut .5s var(--ressort); }
.bascule-casse, .retirer-nom { transition: background .25s, border-color .25s, color .25s, transform .35s var(--ressort); }
.bascule-casse:active, .retirer-nom:active { transform: scale(.88); }
.saisie-noms li.nouvelle { animation: arrivee .45s var(--ressort) both; }
.saisie-noms li.retire { animation: depart .3s var(--doux) forwards; }

/* ---------- Transitions entre pages (navigateurs récents) : fondu enchaîné ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .2s var(--doux) both sortie-page; }
::view-transition-new(root) { animation: .38s var(--doux) both entree-page; }

@keyframes tourne { to { transform: rotate(360deg); } }
@keyframes battement { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
@keyframes saut { 0% { transform: scale(1); } 40% { transform: scale(1.14); } 100% { transform: scale(1); } }
@keyframes deplier { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes arrivee { from { opacity: 0; transform: translateY(-10px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes depart { to { opacity: 0; transform: translateY(-6px) scale(.98); } }
@keyframes aurore { from { background-position: 0% 0%; } to { background-position: 100% 100%; } }
@keyframes sortie-page { to { opacity: 0; } }
@keyframes entree-page { from { opacity: 0; transform: translateY(10px); } }

@media (max-width: 760px) {
  h1 { font-size: 24px; }
  .carte.cliquable:hover, .ligne-commande:hover, .proposition:hover { transform: none; }  /* pas de survol au doigt */
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .anime .apparait { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}

/* ---------- Double authentification ---------- */
.champ-code { font-size: 26px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.cle-2fa { margin: 14px 0; padding: 16px; border-radius: var(--rayon-petit); background: rgba(255, 255, 255, .05);
  border: 1px dashed rgba(255, 255, 255, .2); font: 600 18px/1.4 ui-monospace, "SF Mono", Consolas, monospace;
  letter-spacing: .08em; text-align: center; word-break: break-all; user-select: all; }
.uri-2fa { display: block; margin-top: 8px; font-size: 12px; word-break: break-all; color: var(--discret); user-select: all; }
.ligne-2fa { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
