/* ==========================================================================
   SiMobeo — charte graphique (kit d'identité V5)
   Bleu principal #153B73 · bleu secondaire #2563A5 · bleu clair #4EA0E8
   bleu de fond #E6F0FF · rouge accent #E63946 (accent uniquement) · bleu nuit #092446
   Chargé après app.css / web.css : même mise en page, couleurs et détails de la marque.
   ========================================================================== */

@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../vendor/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url("../vendor/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root, html.site {
  --sm-blue: #153B73; --sm-blue-2: #2563A5; --sm-sky: #4EA0E8; --sm-ice: #E6F0FF; --sm-red: #E63946; --sm-night: #092446;
  --sm-grad: linear-gradient(125deg, #092446 0%, #153B73 48%, #2563A5 100%);
  --sm-ribbon: linear-gradient(90deg, #4EA0E8 0%, #2563A5 45%, #153B73 75%, #E63946 100%);
  --bg: #F6F9FD; --surface: #fff; --surface-2: #EEF3FA; --border: #DAE5F0; --border-strong: #A9BBD3;
  --text: #142438; --text-2: #34465E; --muted: #5E7088;
  --accent: #153B73; --accent-hover: #2563A5; --accent-soft: #E6F0FF; --accent-softer: #F2F7FF;
  --marianne: #E63946; --radius: 6px; --shadow: 0 1px 2px rgba(9, 36, 70, .06);
  color-scheme: light;
}
html.site { --bg: #fff; --radius: 6px; --input: #EEF3FA; }
@media (prefers-color-scheme: dark) { html.site:not([data-theme="light"]) { --input: #132C4F; } }
html.site[data-theme="dark"] { --input: #132C4F; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]), html.site:not([data-theme="light"]) {
    --bg: #071528; --surface: #0D213D; --surface-2: #132C4F; --border: #1E3A62; --border-strong: #3A5C8A;
    --text: #EAF2FF; --text-2: #C3D3EA; --muted: #8FA6C6;
    --accent: #4EA0E8; --accent-hover: #7AB9F0; --accent-soft: #12305A; --accent-softer: #0F2748; --marianne: #FF5C68;
    --shadow: 0 1px 3px rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"], html.site[data-theme="dark"] {
  --bg: #071528; --surface: #0D213D; --surface-2: #132C4F; --border: #1E3A62; --border-strong: #3A5C8A;
  --text: #EAF2FF; --text-2: #C3D3EA; --muted: #8FA6C6;
  --accent: #4EA0E8; --accent-hover: #7AB9F0; --accent-soft: #12305A; --accent-softer: #0F2748; --marianne: #FF5C68;
  --shadow: 0 1px 3px rgba(0, 0, 0, .45); color-scheme: dark;
}

body, html.site body { font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; font-feature-settings: "cv11", "ss01"; }

/* ---------- Composants : coins adoucis, bleu principal, accent rouge ---------- */
.btn, .icon-btn, .site .btn, .fab, .quick button, .search, .f input, .f select, .f textarea, .sheet, .cal .d, .tick, .seg, .md blockquote { border-radius: var(--radius); }
.f input, .f select, .f textarea, .search { border-radius: var(--radius) var(--radius) 0 0; border-bottom-color: var(--sm-blue); }
.f input:focus, .f select:focus, .f textarea:focus { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--sm-sky); }
.btn.primary { background: var(--accent); border-color: var(--accent); }
.site .btn.primary:hover, .btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn:not(.primary) { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.btn.danger { border-color: var(--danger); color: var(--danger); }
.fab { background: var(--sm-grad); box-shadow: 0 8px 22px rgba(21, 59, 115, .35); border-radius: 16px; }
.fab::after { content: ""; position: absolute; right: 9px; top: 9px; width: 7px; height: 7px; border-radius: 50%; background: var(--sm-red); }
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.pill { border-radius: 4px; }
.pill.violet { background: color-mix(in srgb, var(--sm-sky) 18%, transparent); color: var(--sm-blue-2); }
.stat { border-bottom: 1px solid var(--border); background-image: var(--sm-ribbon); background-size: 100% 3px; background-repeat: no-repeat; background-position: bottom; }
.stat.alert { background-image: linear-gradient(var(--danger), var(--danger)); }
.stat .n { color: var(--accent); }
.sheet-h { border-bottom: 1px solid var(--border); background-image: var(--sm-ribbon); background-size: 100% 3px; background-repeat: no-repeat; background-position: bottom; }
.seg button.on { box-shadow: inset 0 -3px 0 var(--sm-red); }
.section a, .link { color: var(--accent); }
.hint.ok { color: var(--ok); } .hint.bad { color: var(--danger); }
.card.warn { border-left: 4px solid var(--warn); }
:root[data-theme="dark"] .btn.primary, :root[data-theme="dark"] .fab, :root[data-theme="dark"] .chip.on { color: #071528; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.primary, :root:not([data-theme="light"]) .chip.on { color: #071528; } :root:not([data-theme="light"]) .fab { color: #fff; } }
:root[data-theme="dark"] .fab { color: #fff; }

/* ---------- Appli : en-tête avec le symbole, ruban de couleur, barre d'onglets ---------- */
.top { position: sticky; }
.top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--sm-ribbon); opacity: .9; }
.top-mark { width: 26px; height: 28px; flex: none; margin-right: 2px; }
.top #back:not([hidden]) ~ .top-mark { display: none; }
.site .top-mark, .site .top::after { display: none; }
.tabbar a.on { color: var(--accent); }
.tabbar a.on::before { background: var(--sm-red); left: 38%; right: 38%; height: 3px; border-radius: 0 0 3px 3px; }
.app-logo { width: 220px; background: transparent; padding: 0; }
:root[data-theme="dark"] .app-logo { content: url("../icons/logo-slogan-dark.svg"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .app-logo { content: url("../icons/logo-slogan-dark.svg"); } }

/* ---------- Site : en-tête, marque, menu latéral, pied de page ---------- */
.site .w-header { border-top: 0; }
.site .w-header::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--sm-ribbon); }
.site .w-brand__mark { background: transparent; border: 0; padding: 0; width: 3rem; height: 3.2rem; }
.site .w-brand__name { font-size: 1.6rem; font-weight: 800; letter-spacing: -.03em; color: var(--sm-blue); line-height: 1.05; }
.site .w-brand__name .o, .public .w-brand__name .o { color: var(--sm-red); }
:root[data-theme="dark"] .site .w-brand__name { color: #fff; }
@media (prefers-color-scheme: dark) { html.site:not([data-theme="light"]) .w-brand__name { color: #fff; } }
.site .w-brand__tagline { color: var(--muted); }
.site .sidemenu__link.is-active { border-left-color: var(--sm-red); background: var(--accent-softer); color: var(--accent); }
.site .sidemenu__avatar { background: var(--sm-grad) !important; color: #fff !important; }
.site .w-footer { background: var(--sm-night); color: #C9D8EE; border-top: 0; position: relative; }
.site .w-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--sm-ribbon); }
.site .w-footer a { color: #fff; }
.site .w-footer__logo { height: 54px; width: auto; content: url("../icons/logo-slogan-dark.svg"); margin-bottom: .25rem; }
.site .w-footer__brand span { color: #9DB4D3; }
.site .w-footer__bottom { border-top-color: rgba(255, 255, 255, .12); color: #9DB4D3; background: transparent; }
.site .top h1 { color: var(--text); letter-spacing: -.02em; }

/* ---------- Connexion / accueil : panneau de marque + formulaire ---------- */
body.auth .top-mark { display: none; }
.auth-wrap { max-width: 440px; margin: 6px auto 0; display: grid; gap: 18px; }
.auth-hero { display: none; }
.auth-panel { min-width: 0; }
.auth-logo { display: block; width: min(300px, 82%); height: auto; margin: 8px auto 14px; background: transparent; padding: 0; }
:root[data-theme="dark"] .auth-logo { content: url("../icons/logo-slogan-dark.svg"); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .auth-logo { content: url("../icons/logo-slogan-dark.svg"); } }
.auth-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; background-image: var(--sm-ribbon); background-size: 100% 3px; background-repeat: no-repeat; background-position: top; }
.auth-card .f { margin: 0; }
.auth-row { display: flex; justify-content: flex-end; margin-top: -4px; }
.auth-row .link { font-size: 13px; }
.auth-seg { margin-bottom: 12px; }
.auth-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.auth-choice button { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); cursor: pointer; color: var(--text); font: inherit; }
.auth-choice button .ic { color: var(--accent); }
.auth-choice button strong { font-size: 14px; }
.auth-choice button span { font-size: 12px; color: var(--muted); line-height: 1.35; }
.auth-choice button.on { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent); }
.code-in { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 20px !important; letter-spacing: .18em; text-transform: uppercase; text-align: center; }
.auth-server { display: flex; align-items: center; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.auth-server .ic { width: 16px; height: 16px; }
.auth-local { display: block; margin: 16px auto 0; }
.auth-note { text-align: center; margin: 6px 0 0; }
.auth-done { text-align: center; }
.auth-done h2 { margin: 6px 0 4px; font-size: 20px; color: var(--accent); }
.auth-done__ic { width: 56px; height: 56px; margin: 4px auto 6px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.auth-done__ic.bad { background: var(--danger-soft); color: var(--danger); }
.auth-done__ic .ic { width: 28px; height: 28px; }
.invite-head { display: flex; gap: 12px; align-items: center; padding: 4px 0 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.invite-head strong { font-size: 18px; color: var(--accent); }
.invite-org { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--sm-grad); color: #fff; flex: none; }
.radio-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; background: var(--surface); }
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.radio-card span { display: flex; flex-direction: column; } .radio-card small { color: var(--muted); }
.auth-wrap.single { max-width: 460px; }

/* Grand écran (site) : panneau de marque bleu à gauche, formulaire à droite */
@media (min-width: 900px) {
  .site body.auth .w-admin { max-width: 1180px; }
  .site body.auth .auth-wrap:not(.single) { max-width: none; grid-template-columns: 1.05fr 1fr; gap: 0; align-items: stretch; margin-top: 8px; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 50px -24px rgba(9, 36, 70, .45); border: 1px solid var(--border); }
  .site body.auth .auth-wrap:not(.single) .auth-hero { display: flex; }
  .site body.auth .auth-wrap:not(.single) .auth-panel { background: var(--surface); padding: 34px 42px; }
  .site body.auth .auth-wrap:not(.single) .auth-card { box-shadow: none; border: 0; padding: 0; background: transparent; }
  .site body.auth .auth-wrap:not(.single) .auth-panel .auth-logo { display: none; }
  .site body.auth .top { display: none; }
}
.auth-hero { flex-direction: column; gap: 22px; padding: 38px 40px; color: #DCE8F8; background: var(--sm-grad); position: relative; overflow: hidden; }
.auth-hero::after { content: ""; position: absolute; right: -120px; bottom: -140px; width: 420px; height: 420px; background: url("../icons/symbol-white.svg") center / contain no-repeat; opacity: .06; pointer-events: none; }
.auth-hero__logo { width: 300px; max-width: 90%; height: auto; }
.auth-hero h2 { margin: 0; font-size: 1.55rem; line-height: 1.25; color: #fff; font-weight: 700; letter-spacing: -.02em; max-width: 26ch; }
.auth-feats { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.auth-feats li { display: flex; gap: 12px; align-items: flex-start; }
.auth-feats .ic { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .1); color: #fff; flex: none; }
.auth-feats li:first-child .ic { background: var(--sm-red); }
.auth-feats strong { display: block; color: #fff; font-size: .98rem; }
.auth-feats span { font-size: .9rem; line-height: 1.4; }
.auth-hero__links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: auto; }
.auth-hero__links a { color: #fff; font-weight: 600; text-decoration: none; display: inline-flex; gap: 6px; align-items: center; }
.auth-hero__links a:hover { text-decoration: underline; }
.site .auth-logo { display: block; }
.site .auth-wrap form.card.auth-card { box-shadow: none; }
.site .portal-home + .auth-wrap { margin-top: 1.5rem; }

/* ---------- Établissement : code, stockage, demandes ---------- */
.org-head { padding: 14px; display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-end; border-left: 4px solid var(--accent); }
.org-head__main { flex: 1 1 260px; min-width: 0; }
.org-head__name { flex: 1; font-size: 18px; }
.org-head__usage { flex: 1 1 240px; min-width: 200px; }
.join-card { display: flex; gap: 18px; flex-wrap: wrap; }
.join-card__code { flex: 0 1 260px; padding: 14px; border-radius: var(--radius); background: var(--sm-grad); color: #DCE8F8; }
.join-card__code .hint { color: #B9CDEA; }
.join-card__code .btns { margin-top: 10px; }
.join-card__code .btn { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .35); color: #fff; height: 38px; min-height: 0; padding: 0 12px; font-size: 14px; }
.code-big { font: 800 30px/1.1 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .12em; color: #fff; margin-top: 4px; }
.join-card__txt { flex: 1 1 280px; }
.req .req-note { font-size: 13px; color: var(--text-2); font-style: italic; margin-top: 2px; white-space: normal; }
.req-act { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.req-act select { height: 40px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); padding: 0 8px; }
.req-act .btn { height: 40px; min-height: 0; padding: 0 12px; }
.invite-link { word-break: break-all; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.mt-s { margin-top: 6px; }

/* Barre d'occupation de l'espace de stockage */
.usage { margin-top: 4px; }
.usage__bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.usage__bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--sm-sky), var(--sm-blue-2)); }
.usage.high .usage__bar i { background: linear-gradient(90deg, #f0a43a, #d97706); }
.usage.full .usage__bar i { background: var(--sm-red); }
.usage__txt { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.usage__txt strong { color: var(--text); }

/* ---------- Plateforme ---------- */
.plat-hero { display: flex; gap: 14px; align-items: center; padding: 16px; background: var(--sm-grad); color: #DCE8F8; border: 0; }
.plat-hero img { width: 44px; height: 48px; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .25)); }
.plat-hero strong { display: block; color: #fff; font-size: 17px; }
.plat-hero span { font-size: 13.5px; }
.plat-stats { margin-top: 12px; }
.plat-org .main { white-space: normal; }
.plat-org .usage { max-width: 420px; }
