/* Écran de connexion TE05 — repris de demo-te05-data/login.html */
    @font-face {
      font-family: 'Titillium TE05';
      src: url('/assets/te05/fonts/Titillium-Regular.otf') format('opentype');
      font-weight: 400;
      font-style: normal;
      font-display: swap;
    }
    @font-face {
      font-family: 'Titillium TE05';
      src: url('/assets/te05/fonts/Titillium-Bold.otf') format('opentype');
      font-weight: 700 900;
      font-style: normal;
      font-display: swap;
    }
    *, *::before, *::after { box-sizing: border-box; }
    html, body {
      margin: 0; padding: 0;
      font-family: 'Titillium TE05', 'Trebuchet MS', ui-sans-serif, system-ui, sans-serif;
      min-height: 100vh;
    }
    body {
      background: #f0f2f5;
      display: flex; align-items: center; justify-content: center;
      padding: 24px 16px;
    }
    /* ── Wrapper two-column card ── */
    .login-wrapper {
      width: 100%; max-width: 880px;
      display: grid; grid-template-columns: 1fr 1fr;
      border-radius: 22px;
      box-shadow: 0 24px 70px rgba(0,0,0,.11), 0 4px 14px rgba(0,0,0,.06);
      overflow: hidden;
    }

    /* ── Left brand panel ── */
    .login-left {
      background:
        radial-gradient(ellipse 85% 65% at 50% 42%, #ffffff 22%, #eefcff 58%, rgba(160,50,140,.14) 100%),
        linear-gradient(135deg, rgba(50,185,200,.16), rgba(160,50,140,.10));
      border-right: 1px solid rgba(50,185,200,.16);
      display: flex; flex-direction: column;
      align-items: center; justify-content: center;
      padding: 52px 44px;
      gap: 20px;
    }
    .login-logo {
      width: 286px;
      max-width: 92%;
      filter: drop-shadow(0 10px 18px rgba(70,80,90,.12));
    }
    .login-brand-line {
      width: 48px; height: 3px;
      background: linear-gradient(90deg, #32b9c8, #a0328c);
      border-radius: 4px;
    }
    .login-tagline {
      font-size: 13px; font-weight: 500;
      color: #46505a; letter-spacing: .3px; text-align: center;
    }
    .login-version {
      font-size: 11px; color: #8c96a0; letter-spacing: .4px;
    }

    /* ── Right form panel ── */
    .login-right {
      background: #ffffff;
      padding: 52px 48px;
      display: flex; flex-direction: column; justify-content: center;
    }
    .login-title {
      font-size: 28px; font-weight: 800; color: #1e293b;
      letter-spacing: -.5px; margin-bottom: 6px;
    }
    .login-subtitle {
      font-size: 13.5px; color: #64748b; margin-bottom: 18px; line-height: 1.5;
    }

    .demo-accounts {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-bottom: 22px;
    }
    .demo-account {
      position: relative;
      min-width: 0;
      padding: 10px 11px;
      border: 1.5px solid #e2e8f0;
      border-radius: 11px;
      color: #475569;
      text-align: left;
      background: #f8fafc;
      cursor: pointer;
      font-family: inherit;
      transition: border-color .16s, background .16s, transform .16s;
    }
    .demo-account:hover,
    .demo-account.active { border-color: #32b9c8; background: #eefcff; transform: translateY(-1px); }
    .demo-account strong { display: block; color: #1e293b; font-size: 12px; }
    .demo-account span { display: block; margin-top: 2px; overflow: hidden; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
    .demo-account em { display: inline-block; margin-top: 6px; padding: 2px 6px; border-radius: 5px; color: #187f8b; background: rgba(50,185,200,.12); font-size: 9px; font-style: normal; font-weight: 700; text-transform: uppercase; }
    .demo-account.enterprise em { color: #493474; background: rgba(73,52,116,.1); }

    .account-picker { position: relative; margin-bottom: 22px; }
    .account-picker-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
    .account-picker-label strong { color: #334155; font-size: 11.5px; letter-spacing: .45px; text-transform: uppercase; }
    .account-picker-label span { color: #94a3b8; font-size: 10.5px; }
    .account-picker-control { position: relative; }
    .account-picker-control .sdea-field { padding-right: 42px; cursor: text; }
    .account-picker-toggle { position: absolute; right: 5px; top: 50%; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; transform: translateY(-50%); color: #64748b; border: 0; border-radius: 8px; background: transparent; cursor: pointer; }
    .account-picker-toggle:hover { color: #187f8b; background: rgba(50,185,200,.1); }
    .account-picker-toggle svg { width: 16px; height: 16px; transition: transform .16s; }
    .account-picker.open .account-picker-toggle svg { transform: rotate(180deg); }
    .account-options { position: absolute; z-index: 20; top: calc(100% - 1px); right: 0; left: 0; display: none; max-height: 260px; padding: 6px; overflow-y: auto; border: 1.5px solid rgba(50,185,200,.4); border-radius: 11px; background: #fff; box-shadow: 0 18px 38px rgba(30,41,59,.16); }
    .account-picker.open .account-options { display: grid; gap: 4px; }
    .account-option { display: grid; grid-template-columns: 34px minmax(0,1fr) auto; align-items: center; gap: 9px; width: 100%; padding: 8px 9px; color: #475569; text-align: left; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-family: inherit; }
    .account-option:hover, .account-option.selected { background: #eefbfc; }
    .account-option.enterprise:hover, .account-option.enterprise.selected { background: rgba(73,52,116,.07); }
    .account-option-initials { display: grid; place-items: center; width: 32px; height: 32px; color: #fff; border-radius: 9px; background: linear-gradient(135deg,#187f8b,#32b9c8); font-size: 10px; font-weight: 800; }
    .account-option.enterprise .account-option-initials { background: linear-gradient(135deg,#493474,#7556a8); }
    .account-option-copy { display: grid; min-width: 0; }
    .account-option-copy strong { overflow: hidden; color: #1e293b; font-size: 11.5px; text-overflow: ellipsis; white-space: nowrap; }
    .account-option-copy small { overflow: hidden; color: #7b8a9a; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
    .account-option em { padding: 2px 6px; color: #187f8b; border-radius: 5px; background: rgba(50,185,200,.12); font-size: 8.5px; font-style: normal; font-weight: 800; text-transform: uppercase; }
    .account-option.enterprise em { color: #493474; background: rgba(73,52,116,.1); }
    .account-picker-empty { padding: 18px 12px; color: #94a3b8; text-align: center; font-size: 11px; }
    .selected-account { display: none; grid-template-columns: minmax(0,1fr) auto; gap: 12px; margin-top: 8px; padding: 9px 11px; border: 1px solid rgba(50,185,200,.2); border-radius: 9px; background: rgba(50,185,200,.055); }
    .selected-account.visible { display: grid; }
    .selected-account strong { display: block; color: #17344a; font-size: 11px; }
    .selected-account span { display: block; color: #70828f; font-size: 10px; }
    .selected-account em { align-self: center; color: #187f8b; font-size: 9px; font-style: normal; font-weight: 800; text-transform: uppercase; }
    .selected-account.enterprise { border-color: rgba(73,52,116,.18); background: rgba(73,52,116,.055); }
    .selected-account.enterprise em { color: #493474; }

    /* Fields */
    .field-group { margin-bottom: 18px; }
    label.f-label {
      display: block; font-size: 11.5px; font-weight: 600;
      color: #94a3b8; margin-bottom: 7px;
      text-transform: uppercase; letter-spacing: .55px;
    }
    .field-wrap { position: relative; }
    .field-ico {
      position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
      color: #cbd5e1; pointer-events: none; display: flex;
    }
    .field-ico svg { width: 17px; height: 17px; }
    .sdea-field {
      width: 100%; padding: 12px 14px 12px 41px;
      background: #f8fafc;
      border: 1.5px solid #e2e8f0;
      border-radius: 11px;
      font-size: 14px; font-family: 'Titillium TE05', 'Trebuchet MS', sans-serif;
      color: #0f172a;
      outline: none; transition: border .18s, box-shadow .18s;
    }
    .sdea-field::placeholder { color: #c0ccdb; }
    .sdea-field:focus {
      border-color: #32b9c8;
      box-shadow: 0 0 0 3px rgba(50,185,200,.12);
      background: #fff;
    }
    .eye-btn {
      position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
      background: none; border: none; cursor: pointer;
      color: #94a3b8; padding: 3px; display: flex; align-items: center;
    }
    .eye-btn:hover { color: #32b9c8; }
    .eye-btn svg { width: 17px; height: 17px; }

    .forgot-link {
      font-size: 12.5px; color: #32b9c8; font-weight: 500;
      text-decoration: none; text-align: right; display: block;
      margin-top: -6px; margin-bottom: 28px;
    }
    .forgot-link:hover { text-decoration: underline; }

    #login-error {
      display: none; align-items: center; gap: 8px;
      background: #fef2f2; border: 1px solid #fecaca;
      border-radius: 10px; padding: 10px 14px;
      font-size: 12.5px; color: #dc2626;
      margin-bottom: 16px;
    }
    #login-error svg { width: 15px; height: 15px; flex-shrink: 0; }

    .btn-login {
      width: 100%; padding: 13px;
      background: linear-gradient(135deg, #32b9c8 0%, #a0328c 100%);
      border: none; border-radius: 11px;
      color: white; font-size: 15px; font-weight: 700;
      font-family: 'Titillium TE05', 'Trebuchet MS', sans-serif;
      cursor: pointer; transition: all .2s;
      letter-spacing: .2px;
      box-shadow: 0 4px 14px rgba(50,185,200,.30);
      display: flex; align-items: center; justify-content: center; gap: 8px;
    }
    .btn-login:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 22px rgba(50,185,200,.40);
    }
    .btn-login:active { transform: translateY(0); }
    .login-guide-row {
      display: flex;
      justify-content: center;
      margin-top: 14px;
    }
    .btn-guide-login {
      display: inline-flex; align-items: center; justify-content: center; gap: 7px;
      min-height: 38px;
      padding: 0 14px;
      background: #fff;
      border: 1.5px solid #e2e8f0;
      border-radius: 10px;
      color: #64748b;
      font-size: 12.5px;
      font-weight: 700;
      font-family: 'Titillium TE05', 'Trebuchet MS', sans-serif;
      cursor: pointer;
      transition: all .18s;
    }
    .btn-guide-login:hover {
      border-color: #32b9c8;
      color: #32b9c8;
      background: rgba(50,185,200,.08);
      transform: translateY(-1px);
    }
    .btn-guide-login svg { width: 15px; height: 15px; }

    .login-footer-text {
      margin-top: 36px; font-size: 11.5px; color: #c0ccdb; text-align: center;
    }
    .login-footer-text a { color: #94a3b8; text-decoration: none; }
    .login-footer-text a:hover { color: #32b9c8; }

    @keyframes spin { from{transform:rotate(0deg)} to{transform:rotate(360deg)} }
    .spinner { animation: spin .9s linear infinite; display: none; }

    @keyframes shake {
      0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-7px)} 40%,80%{transform:translateX(7px)}
    }
    .shake { animation: shake .35s ease; }

    @media (max-width: 640px) {
      .login-wrapper { grid-template-columns: 1fr; }
      .login-left { padding: 36px 28px; }
      .login-logo { width: 220px; max-width: 88%; }
      .login-right { padding: 36px 28px; }
      .demo-accounts { grid-template-columns: 1fr; }
    }

    /* ── Thème dynamique selon l'espace choisi (syndicat / entreprise) ── */
    body {
      --lg-accent: #187f8b;
      --lg-accent-2: #32b9c8;
      --lg-accent-soft: rgba(50,185,200,.12);
      --lg-accent-shadow: rgba(50,185,200,.30);
      --lg-grad: linear-gradient(135deg, #32b9c8 0%, #187f8b 100%);
    }
    body[data-space="entreprise"] {
      --lg-accent: #6d3f9c;
      --lg-accent-2: #9a5cc6;
      --lg-accent-soft: rgba(120,70,170,.12);
      --lg-accent-shadow: rgba(120,70,170,.28);
      --lg-grad: linear-gradient(135deg, #9a5cc6 0%, #6d3f9c 100%);
    }

    .login-left, .btn-login, .sdea-field, .forgot-link, .eye-btn,
    .login-brand-line, .account-picker-toggle, .login-space-badge,
    .login-title, .login-subtitle, .login-tagline {
      transition: background .3s ease, border-color .3s ease, color .3s ease, box-shadow .3s ease;
    }

    .login-brand-line { background: var(--lg-grad); }
    .btn-login {
      background: var(--lg-grad);
      box-shadow: 0 4px 14px var(--lg-accent-shadow);
    }
    .btn-login:hover { box-shadow: 0 8px 22px var(--lg-accent-shadow); }
    .sdea-field:focus {
      border-color: var(--lg-accent-2);
      box-shadow: 0 0 0 3px var(--lg-accent-soft);
    }
    .forgot-link { color: var(--lg-accent-2); }
    .eye-btn:hover { color: var(--lg-accent-2); }
    .account-picker-toggle:hover { color: var(--lg-accent); background: var(--lg-accent-soft); }
    .demo-account:hover, .demo-account.active { border-color: var(--lg-accent-2); }

    .login-space-badge {
      display: inline-flex; align-items: center; gap: 7px; align-self: flex-start;
      padding: 4px 11px; border-radius: 999px;
      font-size: 10.5px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase;
      color: var(--lg-accent); background: var(--lg-accent-soft);
      margin-bottom: 12px;
    }
    .login-space-badge::before {
      content: ""; width: 7px; height: 7px; border-radius: 50%;
      background: var(--lg-accent-2);
    }

    body[data-space="entreprise"] .login-left {
      background:
        radial-gradient(ellipse 85% 65% at 50% 42%, #ffffff 22%, #f5eefc 58%, rgba(109,63,156,.16) 100%),
        linear-gradient(135deg, rgba(154,92,198,.16), rgba(73,52,116,.12));
      border-right-color: rgba(109,63,156,.18);
    }
  
/* intégration PHP : le conteneur ajouté ne doit pas modifier la mise en page, la bannière hors-ligne du gabarit est masquée ici */
.login-body-wrap { display: contents; }
#offline-banner { display: none !important; }

/* Autres espaces (syndicat / entreprise / commune / services consultés) */
.login-spaces { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 10px; margin-top: 22px; font-size: 12px; color: #94a3b8; }
.login-spaces span { font-weight: 700; letter-spacing: .3px; text-transform: uppercase; font-size: 10.5px; }
.login-spaces a { color: #187f8b; background: #eefcff; border: 1px solid #c8eef3; border-radius: 999px; padding: 5px 12px; font-weight: 700; text-decoration: none; }
.login-spaces a:hover { background: #d9f6fa; }
.login-externe-note { margin-top: 14px; padding: 12px 14px; border: 1px dashed #c8eef3; border-radius: 12px; background: #f7fdff; color: #475569; font-size: 13px; line-height: 1.5; }

/* Charte de l'espace commune (vert) ; l'entreprise est violette, le syndicat turquoise — comme la démo */
body[data-space="commune"] { --lg-accent: #1f7a4d; --lg-accent-2: #3fb27f; --lg-accent-soft: rgba(63,178,127,.13); --lg-accent-shadow: rgba(31,122,77,.28); --lg-grad: linear-gradient(135deg, #3fb27f 0%, #1f7a4d 100%); }
body[data-space="commune"] .login-left { background: radial-gradient(ellipse 85% 65% at 50% 42%, #ffffff 22%, #effaf4 58%, rgba(31,122,77,.16) 100%), linear-gradient(135deg, rgba(63,178,127,.16), rgba(20,83,45,.12)); border-right-color: rgba(31,122,77,.18); }
body[data-space="validation"] { --lg-accent: #475569; --lg-accent-2: #94a3b8; --lg-accent-soft: rgba(148,163,184,.16); --lg-accent-shadow: rgba(71,85,105,.25); --lg-grad: linear-gradient(135deg, #94a3b8 0%, #475569 100%); }
.login-spaces a { color: var(--lg-accent, #187f8b); border-color: var(--lg-accent-soft, #c8eef3); background: var(--lg-accent-soft, #eefcff); }
.login-demande { margin-top: 16px; text-align: center; }
.login-demande button { background: none; border: 1.5px dashed var(--lg-accent-2, #32b9c8); color: var(--lg-accent, #187f8b); border-radius: 12px; padding: 10px 16px; font-weight: 800; font-size: 13px; cursor: pointer; }
.login-demande button:hover { background: var(--lg-accent-soft, #eefcff); }
.dem-modal { position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 9000; display: grid; place-items: center; padding: 16px; } .dem-modal[hidden] { display: none; }
.dem-box { background: #fff; border-radius: 20px; width: min(520px, 100%); max-height: 92vh; overflow: auto; padding: 22px 24px; box-shadow: 0 30px 80px rgba(0,0,0,.35); }
.dem-box h2 { margin: 0 0 4px; font-size: 19px; color: #0f2a35; } .dem-box p { margin: 0 0 14px; font-size: 13px; color: #64748b; line-height: 1.5; }
.dem-box label { display: block; font-size: 11.5px; font-weight: 800; color: #475569; margin-bottom: 10px; }
.dem-box input, .dem-box select, .dem-box textarea { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1px solid #cbd5e1; border-radius: 10px; font: inherit; font-size: 14px; color: #0f172a; background: #fff; }
.dem-box .piege { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.dem-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; } .dem-msg { padding: 10px 13px; border-radius: 10px; font-size: 13px; margin-top: 8px; background: #fee2e2; color: #b91c1c; } .dem-msg.ok { background: #dcfce7; color: #15803d; }
.dem-actions button { border-radius: 10px; padding: 10px 18px; font-weight: 800; cursor: pointer; border: 1.5px solid #cbd5e1; background: #fff; color: #475569; } .dem-actions .go { background: var(--lg-grad); color: #fff; border: 0; }

body[data-space="pilotage"] { --lg-accent: #3b4a6b; --lg-accent-2: #6475a8; --lg-accent-soft: rgba(100,117,168,.16); --lg-accent-shadow: rgba(59,74,107,.28); --lg-grad: linear-gradient(135deg, #6475a8 0%, #2f3b57 100%); }
body[data-space="pilotage"] .login-left { background: radial-gradient(ellipse 85% 65% at 50% 42%, #ffffff 22%, #eef1f8 58%, rgba(59,74,107,.18) 100%); border-right-color: rgba(59,74,107,.2); }
