/* Studio : interface blanche, reprise de la direction artistique du cockpit (toujours claire, police du système,
   grands titres, cartes arrondies, onglets fixes en bas avec flou, couleur seulement pour l'état).
   Aucun style en ligne ni police externe : la CSP les refuse. */
:root {
  color-scheme: light;
  --noir: #1c1c1e; --gris: #8e8e93; --gris2: #c7c7cc; --gris3: #e5e5ea; --fond: #f2f2f7; --blanc: #ffffff;
  --bleu: #007aff; --vert: #34c759; --orange: #ff9500; --rouge: #ff3b30;
  --vert-clair: #e8f8ec; --orange-clair: #fff4e5; --rouge-clair: #ffecec;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--fond); }
body {
  margin: 0; background: var(--fond); color: var(--noir);
  font: 17px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Arial, sans-serif;
  padding-bottom: calc(84px + env(safe-area-inset-bottom));
}
main { max-width: 720px; margin: 0 auto; padding: 4px 16px 32px; }
a { color: var(--bleu); text-decoration: none; }
code { font-size: .85em; background: var(--gris3); padding: 1px 5px; border-radius: 5px; overflow-wrap: anywhere; }
h1 { font-size: 28px; line-height: 1.15; letter-spacing: -0.02em; margin: 8px 4px 12px; }
h1.grand, .grand { font-size: 34px; font-weight: 700; letter-spacing: -0.02em; margin: 8px 4px 12px; line-height: 1.15; }
h2 { font-size: 21px; font-weight: 700; letter-spacing: -0.01em; margin: 20px 4px 8px; }
.intro, .discret, .note, small { color: var(--gris); font-size: 15px; }
.ok { color: #1f8a3a; }
.bad { color: var(--rouge); }

/* barre du haut, discrète */
.barre { position: sticky; top: 0; z-index: 5; background: rgba(242, 242, 247, .92);
         -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.ligne-barre { max-width: 720px; margin: 0 auto; padding: 10px 16px; display: flex; justify-content: space-between; align-items: center; }
.marque { margin: 0; font-weight: 600; font-size: 15px; color: var(--noir); }
.haut { display: flex; gap: 16px; align-items: center; font-size: 15px; }
.enligne { display: inline; margin: 0; }
button.lien { background: none; border: 0; padding: 0; color: var(--bleu); font: inherit; cursor: pointer; }

/* onglets en bas */
.onglets { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-around;
           background: rgba(255, 255, 255, .96); border-top: 1px solid var(--gris3);
           padding: 7px 4px calc(7px + env(safe-area-inset-bottom));
           -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.onglets a { flex: 1; max-width: 120px; text-align: center; font-size: 11px; color: var(--gris); }
.onglets a i { display: block; font-style: normal; font-size: 22px; line-height: 1.2; }
.onglets a[aria-current="page"] { color: var(--bleu); }

/* cartes et formulaires */
main > form, main > table { background: var(--blanc); border-radius: 18px; padding: 8px 16px; margin: 0 0 10px; }
main > table { padding: 0; border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
td, th { padding: 10px 14px; border-bottom: 1px solid var(--gris3); text-align: left; vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--gris); text-transform: uppercase; letter-spacing: .05em; }
label { font-size: 15px; font-weight: 600; }
input[type="text"], input[type="password"], input:not([type]), select, textarea {
  font: inherit; color: var(--noir); background: var(--fond); border: 0; border-radius: 12px; padding: 11px 14px; max-width: 100%; }
input.code { font: 600 22px/1.2 ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; letter-spacing: 0.3em; text-align: center; }
button, .bouton { font: inherit; cursor: pointer; }
button[type="submit"] { background: var(--bleu); color: #fff; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 600; }
button.second { background: var(--fond); color: var(--bleu); }
button.lien { background: none; color: var(--bleu); padding: 0; border-radius: 0; font-weight: 400; }
button:disabled { background: var(--gris3); color: var(--gris); cursor: default; }
:focus-visible { outline: 2px solid var(--bleu); outline-offset: 2px; }
.alerte { color: #c4271b; background: var(--rouge-clair); border-radius: 14px; padding: 12px 16px; margin: 10px 0; font-size: 15px; font-weight: 600; }
.warn { color: #b26100; background: var(--orange-clair); border-radius: 14px; padding: 12px 16px; font-size: 15px; }
details { margin: 8px 0; }
summary { cursor: pointer; color: var(--bleu); }

/* page seule : connexion, double authentification, mot de passe provisoire */
body.feuille { padding-bottom: 24px; }
body.feuille main { max-width: 27rem; margin: 8vh auto 24px; padding: 24px 22px 20px; background: var(--blanc); border-radius: 18px; }
body.feuille h1 { font-size: 30px; font-weight: 700; margin: 6px 0 12px; }
body.feuille h2 { font-size: 19px; margin: 0 0 6px; }
body.feuille form { background: none; padding: 0; }
body.feuille p { margin: 10px 0; }
body.feuille label { font-size: 14px; }
body.feuille input[type="text"], body.feuille input[type="password"], body.feuille input:not([type]) { width: 100%; min-width: 0; margin-top: 4px; font-size: 17px; }
body.feuille button[type="submit"] { width: 100%; padding: 14px; font-size: 17px; }
body.feuille .marque { color: var(--gris); }
ol.etapes { margin: 0; padding-left: 1.4em; }
ol.etapes > li { margin-bottom: 18px; }
svg.qr { display: block; width: 200px; height: 200px; margin: 12px 0; border-radius: 12px; border: 1px solid var(--gris3); }
ul.secours { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, max-content); gap: 6px 24px; }

@media (max-width: 560px) {
  body.feuille main { margin: 16px auto; width: calc(100% - 32px); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* écran Presentation */
.choix { display: flex; gap: 8px; margin: 4px 0 12px; }
.choix a { padding: 7px 14px; border-radius: 999px; background: var(--blanc); font-size: 15px; font-weight: 600; }
.choix a[aria-current="page"] { background: var(--bleu); color: #fff; }
.info { background: var(--vert-clair); border-radius: 14px; padding: 12px 16px; font-size: 15px; font-weight: 600; }
details details.sous { margin-left: 14px; }
label.bloc, label.tout { display: block; font-weight: 400; padding: 5px 0; }
label.tout { font-weight: 600; }
label.grise { color: var(--gris); }
label.grise small { color: var(--gris); }
.compte { font-weight: 600; }
textarea { width: 100%; }

ul.demandes { list-style: none; margin: 0 0 10px; padding: 0; }
li.demande { background: var(--blanc); border-radius: 18px; padding: 12px 16px; margin: 0 0 10px; }
li.demande p { margin: 4px 0; overflow-wrap: anywhere; }
li.demande .etat { font-size: 15px; font-weight: 600; color: var(--gris); }
li.demande .etat.ok { color: #1f8a3a; }
li.demande .etat.warn { color: #b26100; background: none; padding: 0; }
.sorties { display: flex; gap: 8px; flex-wrap: wrap; }
a.bouton { background: var(--bleu); color: #fff; border-radius: 999px; padding: 8px 16px; font-weight: 600; font-size: 15px; }

/* Mode simulé (banc) : bandeau discret, au-dessus de tout */
.mode-test { margin: 0; padding: 4px 16px; text-align: center; font-size: 12px; font-weight: 600; color: #b26100; background: var(--orange-clair); }
