/* Espace client Cleanix (Loïc, 18.11.2026)
   Les fonctionnalités de Benito, un dessin à nous : une app iOS plutôt qu'une
   page web. Cinq onglets en bas, des titres larges, des listes groupées, les
   détails dans des feuilles qui montent du bas. Police du système (SF sur
   iPhone), la marine et le cyan de Cleanix, clair et sombre. */

:root {
  --marine: #03084F;
  --bleu: #2D2C86;
  --cyan: #00BAE8;
  --cyan-pale: #E3F7FD;
  --fond: #F2F3F8;
  --carte: #FFFFFF;
  --encre: #0E1330;
  --doux: #5A6180;
  --pale: #8A90AA;
  --trait: rgba(14, 19, 48, .09);
  --ok: #148A5B; --ok-pale: #E3F4EC;
  --attention: #B26B00; --attention-pale: #FFF3DC;
  --alerte: #C1362D; --alerte-pale: #FCE9E7;
  --neutre-pale: #EEF0F6;
  --ombre: 0 1px 2px rgba(3, 8, 79, .05), 0 6px 20px rgba(3, 8, 79, .06);
  --barre: rgba(255, 255, 255, .86);
  --logo-encre: #2D2C86; --logo-cyan: #3EC0F0;
  --r: 14px;
  --haut: env(safe-area-inset-top, 0px);
  --bas: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --marine: #A9B4FF; --bleu: #8E9BFF; --cyan: #3CCBF0; --cyan-pale: rgba(60, 203, 240, .14);
    --fond: #0B0D18; --carte: #161927; --encre: #EEF0F8; --doux: #A3A9C2; --pale: #747A93;
    --trait: rgba(255, 255, 255, .08);
    --ok: #4CC793; --ok-pale: rgba(76, 199, 147, .14);
    --attention: #F0B44C; --attention-pale: rgba(240, 180, 76, .14);
    --alerte: #FF7A70; --alerte-pale: rgba(255, 122, 112, .14);
    --neutre-pale: rgba(255, 255, 255, .07);
    --ombre: none; --barre: rgba(22, 25, 39, .86);
    --logo-encre: #FFFFFF;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { background: var(--fond); -webkit-text-size-adjust: 100%; }
body {
  font: 17px/1.35 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", system-ui, sans-serif;
  color: var(--encre); background: var(--fond);
  min-height: 100dvh; overscroll-behavior-y: none;
}
button, input, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; text-align: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--cyan) 70%, transparent); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.nombre { font-variant-numeric: tabular-nums; }

/* ── Écran d'entrée ──────────────────────────────────────────────────────── */
.entree { min-height: 100dvh; display: grid; align-content: start; justify-items: center; padding: calc(var(--haut) + 9vh) 24px calc(var(--bas) + 24px); }
.entree .logo { width: 150px; height: auto; margin-bottom: 30px; }
.entree h1 { font-size: 28px; font-weight: 700; letter-spacing: -.3px; text-align: center; text-wrap: balance; }
.entree .sous { color: var(--doux); text-align: center; margin: 8px 0 26px; max-width: 30ch; text-wrap: balance; }
.entree form { width: 100%; max-width: 360px; display: grid; gap: 12px; }
.champ { width: 100%; height: 54px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--trait); background: var(--carte); outline: none; font-size: 17px; }
.champ:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px var(--cyan-pale); }
.champ.code { text-align: center; font-size: 30px; letter-spacing: 12px; font-weight: 600; height: 64px; font-variant-numeric: tabular-nums; }
.principal { height: 54px; border-radius: 14px; background: var(--marine); color: #fff; font-weight: 600; text-align: center; transition: transform .12s, opacity .12s; }
@media (prefers-color-scheme: dark) { .principal { background: var(--cyan); color: #04122a; } }
.principal:active { transform: scale(.98); opacity: .9; }
.principal:disabled { opacity: .4; }
.lien { color: var(--bleu); font-weight: 500; text-align: center; padding: 10px; }
.erreur { color: var(--alerte); font-size: 15px; text-align: center; min-height: 20px; }
.note { color: var(--pale); font-size: 13px; text-align: center; line-height: 1.4; }
.choix { width: 100%; max-width: 360px; display: grid; gap: 10px; }
.choix button { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; background: var(--carte); box-shadow: var(--ombre); font-weight: 600; }
.choix button span { flex: 1; }

/* L'aperçu du bureau : un bandeau qui ne se confond pas avec l'espace. */
.apercu { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; padding: calc(var(--haut) + 8px) 16px 8px;
  background: #F0B44C; color: #2A1A00; font-size: 14px; }
.apercu span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.apercu button { font-weight: 700; padding: 6px 12px; border-radius: 999px; background: rgba(0, 0, 0, .12); }
.apercu + .app { padding-top: 10px; }

/* ── Cadre de l'espace ───────────────────────────────────────────────────── */
.app { max-width: 720px; margin: 0 auto; padding: calc(var(--haut) + 10px) 16px calc(var(--bas) + 96px); }
.tete { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.tete .qui { flex: 1; min-width: 0; font-size: 15px; color: var(--doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rond { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--carte); box-shadow: var(--ombre); color: var(--marine); font-weight: 700; font-size: 14px; flex: none; }
.grand-titre { font-size: 34px; font-weight: 700; letter-spacing: -.5px; margin: 6px 0 18px; }
.vue { animation: entre .22s ease-out; }
@keyframes entre { from { opacity: 0; transform: translateY(6px); } }

.section { margin-top: 26px; }
.section > h2 { font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .6px; color: var(--pale); margin: 0 4px 8px; }
.section > .pied { font-size: 13px; color: var(--pale); margin: 8px 4px 0; line-height: 1.4; }

.liste { background: var(--carte); border-radius: var(--r); box-shadow: var(--ombre); overflow: hidden; }
.ligne { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 56px; width: 100%; position: relative; }
.ligne + .ligne::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--trait); }
.ligne.icone + .ligne.icone::before { left: 60px; }
button.ligne:active, a.ligne:active { background: var(--neutre-pale); }
.ligne .corps { flex: 1; min-width: 0; }
.ligne .t { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ligne .s { font-size: 14px; color: var(--doux); margin-top: 2px; }
.ligne .droite { text-align: right; flex: none; display: grid; justify-items: end; gap: 4px; }
.ligne .montant { font-weight: 600; font-variant-numeric: tabular-nums; }
.ligne .chevron { color: var(--pale); flex: none; }
.pastille-ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; background: var(--cyan-pale); color: var(--bleu); }

.etat { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.etat.ok { background: var(--ok-pale); color: var(--ok); }
.etat.attention { background: var(--attention-pale); color: var(--attention); }
.etat.alerte { background: var(--alerte-pale); color: var(--alerte); }
.etat.neutre { background: var(--neutre-pale); color: var(--doux); }
.etat.info { background: var(--cyan-pale); color: var(--bleu); }

.vide { padding: 28px 20px; text-align: center; color: var(--doux); font-size: 15px; line-height: 1.45; }

/* ── Accueil ─────────────────────────────────────────────────────────────── */
.solde { border-radius: 20px; padding: 20px; background: var(--marine); color: #fff; display: grid; gap: 4px; box-shadow: 0 10px 30px rgba(3, 8, 79, .18); }
@media (prefers-color-scheme: dark) { .solde { background: #1E2350; } }
.solde .lbl { font-size: 14px; opacity: .75; }
.solde .val { font-size: 34px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; }
.solde .act { display: flex; gap: 10px; margin-top: 12px; }
.solde .act button { flex: 1; height: 44px; border-radius: 12px; background: rgba(255, 255, 255, .14); color: #fff; font-weight: 600; text-align: center; font-size: 15px; }
.solde .act button.fort { background: var(--cyan); color: #04122a; }
.solde.calme { background: var(--carte); color: var(--encre); box-shadow: var(--ombre); }
.solde.calme .lbl { opacity: 1; color: var(--doux); }

.prochain { border-radius: 20px; padding: 18px; background: var(--carte); box-shadow: var(--ombre); display: flex; gap: 16px; align-items: center; }
.calendrier { width: 58px; flex: none; border-radius: 14px; overflow: hidden; text-align: center; background: var(--cyan-pale); }
.calendrier .m { background: var(--cyan); color: #04122a; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; padding: 3px 0; }
.calendrier .j { font-size: 26px; font-weight: 700; padding: 4px 0 6px; color: var(--marine); font-variant-numeric: tabular-nums; }
.prochain .quand { font-weight: 700; font-size: 17px; }
.prochain .quoi { color: var(--doux); font-size: 15px; margin-top: 2px; }

.raccourcis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.raccourci { background: var(--carte); border-radius: var(--r); box-shadow: var(--ombre); padding: 14px; display: grid; gap: 10px; min-height: 92px; align-content: space-between; }
.raccourci:active { transform: scale(.985); }
.raccourci .n { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.raccourci .l { font-size: 14px; color: var(--doux); }

/* ── Passages ────────────────────────────────────────────────────────────── */
.mois { font-size: 20px; font-weight: 700; margin: 24px 4px 8px; text-transform: capitalize; }
.jour-bloc { width: 46px; flex: none; text-align: center; }
.jour-bloc .js { font-size: 12px; color: var(--pale); text-transform: uppercase; font-weight: 600; }
.jour-bloc .jn { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.credit { background: var(--carte); border-radius: var(--r); box-shadow: var(--ombre); padding: 16px; display: grid; gap: 10px; }
.jauge { height: 8px; border-radius: 99px; background: var(--neutre-pale); overflow: hidden; }
.jauge i { display: block; height: 100%; background: var(--cyan); border-radius: inherit; }
.credit.epuise .jauge i { background: var(--alerte); }
.credit.epuise .phrase { color: var(--alerte); }

/* ── Documents ───────────────────────────────────────────────────────────── */
.segments { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; background: var(--neutre-pale); border-radius: 10px; padding: 2px; margin-bottom: 18px; }
.segments button { height: 34px; border-radius: 8px; font-size: 14px; font-weight: 600; color: var(--doux); text-align: center; }
.segments button[aria-pressed="true"] { background: var(--carte); color: var(--encre); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }

/* ── Demander ────────────────────────────────────────────────────────────── */
.tuiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.tuile { background: var(--carte); border-radius: var(--r); box-shadow: var(--ombre); padding: 14px; display: grid; gap: 6px; align-content: start; min-height: 132px; }
.tuile:active { transform: scale(.985); }
.tuile .pastille-ic { margin-bottom: 4px; }
.tuile .n { font-weight: 700; }
.tuile .q { font-size: 13px; color: var(--doux); line-height: 1.35; }
.tuile .sa { font-size: 12px; color: var(--bleu); font-weight: 600; margin-top: auto; }

/* ── Messages ────────────────────────────────────────────────────────────── */
.message { background: var(--carte); border-radius: var(--r); box-shadow: var(--ombre); padding: 16px; display: grid; gap: 6px; }
.message + .message { margin-top: 10px; }
.message .g { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: var(--bleu); display: flex; gap: 8px; align-items: center; }
.message .g time { color: var(--pale); font-weight: 500; text-transform: none; letter-spacing: 0; margin-left: auto; }
.message .ti { font-weight: 700; }
.message .tx { color: var(--doux); white-space: pre-line; font-size: 15px; line-height: 1.45; }
.message.nouveau .g::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); }

/* ── Barre d'onglets ─────────────────────────────────────────────────────── */
.onglets { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 4px calc(var(--bas) + 4px); background: var(--barre); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 1px solid var(--trait); }
.onglets button { display: grid; justify-items: center; gap: 2px; padding: 4px 0; font-size: 10.5px; font-weight: 600; color: var(--pale); position: relative; }
.onglets button[aria-current="page"] { color: var(--bleu); }
@media (prefers-color-scheme: dark) { .onglets button[aria-current="page"] { color: var(--cyan); } }
.onglets svg { width: 26px; height: 26px; }
.badge { position: absolute; top: 0; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--alerte); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
@media (min-width: 760px) {
  .onglets { left: 50%; right: auto; transform: translateX(-50%); bottom: 16px; width: 520px; border-radius: 22px; border: 1px solid var(--trait); box-shadow: 0 10px 30px rgba(3, 8, 79, .12); padding-bottom: 6px; }
}

/* ── Feuilles ────────────────────────────────────────────────────────────── */
.voile { position: fixed; inset: 0; z-index: 40; background: rgba(5, 8, 30, .38); opacity: 0; transition: opacity .25s; }
.voile.ouvert { opacity: 1; }
.feuille { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; max-height: calc(100dvh - var(--haut) - 24px); overflow: auto; overscroll-behavior: contain;
  background: var(--fond); border-radius: 22px 22px 0 0; padding: 8px 16px calc(var(--bas) + 24px); transform: translateY(100%); transition: transform .32s cubic-bezier(.2, .9, .25, 1); }
.feuille.ouvert { transform: none; }
@media (min-width: 760px) { .feuille { left: 50%; right: auto; width: 560px; margin-left: -280px; bottom: 24px; border-radius: 22px; max-height: calc(100dvh - 48px); } }
.poignee { width: 38px; height: 5px; border-radius: 9px; background: var(--trait); margin: 2px auto 10px; }
.feuille .barre-f { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.feuille .barre-f h3 { flex: 1; font-size: 20px; font-weight: 700; }
.fermer { width: 32px; height: 32px; border-radius: 50%; background: var(--neutre-pale); display: grid; place-items: center; color: var(--doux); }
.grand-montant { text-align: center; padding: 6px 0 14px; }
.grand-montant .val { font-size: 40px; font-weight: 700; letter-spacing: -.6px; font-variant-numeric: tabular-nums; }
.grand-montant .lbl { color: var(--doux); font-size: 14px; }
.qr { display: block; background: #fff; border-radius: 18px; padding: 14px; width: 220px; margin: 0 auto; box-shadow: var(--ombre); cursor: pointer; transition: transform .12s; }
.qr:active { transform: scale(.97); }
.qr svg { width: 100%; height: auto; display: block; }
.paire { display: flex; justify-content: space-between; gap: 12px; padding: 13px 16px; }
.paire + .paire { border-top: 1px solid var(--trait); }
.paire .k { color: var(--doux); }
.paire .v { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.copier { color: var(--bleu); font-weight: 600; font-size: 14px; margin-left: 8px; }
.bouton-ligne { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 50px; border-radius: 14px; background: var(--carte); box-shadow: var(--ombre); font-weight: 600; color: var(--bleu); margin-top: 10px; }

/* Le formulaire de demande */
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos .ph { aspect-ratio: 1; border-radius: 12px; overflow: hidden; position: relative; background: var(--neutre-pale); }
.photos .ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photos .ph button { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; display: grid; place-items: center; }
.photos label.ajout { aspect-ratio: 1; border-radius: 12px; border: 1.5px dashed color-mix(in srgb, var(--bleu) 40%, transparent); display: grid; place-items: center; align-content: center; gap: 4px; color: var(--bleu); font-size: 13px; font-weight: 600; cursor: pointer; }
.zone { width: 100%; min-height: 96px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--trait); background: var(--carte); resize: vertical; outline: none; font-size: 16px; line-height: 1.4; }
.zone:focus, .champ-f:focus { border-color: var(--cyan); box-shadow: 0 0 0 4px var(--cyan-pale); }
.champ-f { width: 100%; height: 50px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--trait); background: var(--carte); outline: none; font-size: 16px; }
.etiquette { display: block; font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--pale); margin: 20px 4px 8px; }

.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(var(--bas) + 88px); transform: translate(-50%, 20px); opacity: 0; background: var(--encre); color: var(--fond);
  padding: 12px 18px; border-radius: 14px; font-size: 15px; font-weight: 600; transition: all .25s; pointer-events: none; max-width: calc(100% - 32px); text-align: center; }
.toast.ouvert { opacity: 1; transform: translate(-50%, 0); }

.chargement { display: grid; place-items: center; min-height: 60dvh; color: var(--pale); }
.anneau { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--trait); border-top-color: var(--cyan); animation: tourne .8s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.bandeau { background: var(--attention-pale); color: var(--attention); border-radius: 12px; padding: 10px 14px; font-size: 14px; margin-bottom: 12px; }
.contact { display: grid; gap: 4px; text-align: center; color: var(--pale); font-size: 13px; margin-top: 32px; }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ── Une autre installation (Basel, 03.12.2026) ──────────────────────────────
   Classe « instance » sur <html>, posée par espace.js : jamais pour Cleanix.
   Les couleurs de l'entreprise remplacent --marine/--bleu/--cyan (style posé
   par le script) ; --sur-accent est le texte lisible sur sa couleur d'accent. */
.instance .entree .logo-instance { width: auto; max-width: 200px; max-height: 84px; object-fit: contain; }
.instance .entree .marque { width: auto; display: grid; justify-items: center; gap: 12px; }
.marque .initiale { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; background: var(--marine); color: #fff; font-size: 30px; font-weight: 700; box-shadow: var(--ombre); }
.marque .nom-marque { font-size: 18px; font-weight: 700; color: var(--encre); text-align: center; }
.instance .calendrier .m, .instance .solde .act button.fort { color: var(--sur-accent, #04122a); }
@media (prefers-color-scheme: dark) { .instance .principal { color: var(--sur-accent, #04122a); } }
.langues { display: inline-flex; gap: 2px; padding: 2px; border-radius: 10px; background: var(--neutre-pale); }
.langues button { min-width: 40px; height: 30px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--doux); text-align: center; }
.langues button[aria-pressed="true"] { background: var(--carte); color: var(--encre); box-shadow: var(--ombre); }
.instance .entree { position: relative; }
.entree > .langues { position: absolute; top: calc(var(--haut) + 14px); right: 16px; }
