/* ==========================================================================
   La Preuve Informatique — feuille de style
   Palette tirée du logo : encre #0C1C27 et vert #00703C.
   Thème clair par défaut, thème sombre via <html data-theme="dark"> (voir theme.js).
   Aucune ressource externe : police et icônes sont embarquées.
   ========================================================================== */

/* ---------- Police embarquée : IBM Plex Sans (licence SIL OFL, voir fonts/OFL.txt) ---------- */

@font-face {
    font-family: "IBM Plex Sans";
    src: url("./fonts/ibm-plex-sans-400.woff") format("woff");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("./fonts/ibm-plex-sans-500.woff") format("woff");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("./fonts/ibm-plex-sans-600.woff") format("woff");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "IBM Plex Sans";
    src: url("./fonts/ibm-plex-sans-700.woff") format("woff");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

/* ---------- Variables ---------- */

:root {
    color-scheme: light;
    --text-strong: #0c1c27;
    --text: #2e3b46;
    --muted: #5e6b75;
    --line: #dde2e6;
    --line-strong: #c5cdd3;
    --canvas: #f3f5f6;
    --surface: #ffffff;
    --input-bg: #ffffff;
    --accent: #00703c;
    --accent-hover: #005a31;
    --accent-text: #00703c;
    --accent-tint: #e4f3ec;
    --on-accent: #ffffff;
    --ring: rgba(0, 112, 60, 0.22);
    --danger: #b3261e;
    --danger-hover: #8f1d17;
    --danger-text: #b3261e;
    --danger-tint: #fbecea;
    --ring-danger: rgba(179, 38, 30, 0.22);
    --warn: #8a5a00;
    --notice-ok-text: #00492a;
    --notice-error-text: #7a1c16;
    --panel: #0b1a24;
    --avatar-bg: #0c1c27;
    --overlay: rgba(20, 32, 42, 0.45);
    --shadow-pop: 0 12px 32px rgba(20, 32, 42, 0.18), 0 1px 3px rgba(20, 32, 42, 0.1);
    --font: "IBM Plex Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --radius: 6px;
    --radius-lg: 8px;
}

    :root[data-theme="dark"] {
        color-scheme: dark;
        --text-strong: #eef3f6;
        --text: #c6d0d7;
        --muted: #8f9ca6;
        --line: #27333c;
        --line-strong: #3a4853;
        --canvas: #0e1418;
        --surface: #151d24;
        --input-bg: #0f161c;
        --accent: #00844a;
        --accent-hover: #009a56;
        --accent-text: #3fd186;
        --accent-tint: rgba(63, 209, 134, 0.13);
        --on-accent: #ffffff;
        --ring: rgba(63, 209, 134, 0.3);
        --danger: #c93c32;
        --danger-hover: #d94a40;
        --danger-text: #f2877f;
        --danger-tint: rgba(242, 135, 127, 0.13);
        --ring-danger: rgba(242, 135, 127, 0.3);
        --warn: #f0b84a;
        --notice-ok-text: #b9ecd2;
        --notice-error-text: #f6bdb8;
        --panel: #08141b;
        --avatar-bg: #2a3945;
        --overlay: rgba(0, 0, 0, 0.62);
        --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5), 0 1px 3px rgba(0, 0, 0, 0.4);
    }

/* ---------- Base ---------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    font-family: var(--font);
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text);
    background: var(--canvas);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1,
h2,
h3 {
    color: var(--text-strong);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.25;
}

h1 {
    font-size: 1.625rem;
}

img {
    display: block;
    max-width: 100%;
}

button,
input {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 2px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.icon {
    width: 20px;
    height: 20px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Logos : une version pour chaque thème */
.logo--dark {
    display: none;
}

:root[data-theme="dark"] .logo--light {
    display: none;
}

:root[data-theme="dark"] .logo--dark {
    display: block;
}

/* ---------- Boutons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 120ms, border-color 120ms;
}

    .btn:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.btn--primary {
    background: var(--accent);
    color: var(--on-accent);
}

    .btn--primary:hover:not(:disabled) {
        background: var(--accent-hover);
    }

.btn--danger {
    background: var(--danger);
    color: #fff;
}

    .btn--danger:hover:not(:disabled) {
        background: var(--danger-hover);
    }

.btn--secondary {
    background: var(--surface);
    border-color: var(--line-strong);
    color: var(--text-strong);
}

    .btn--secondary:hover:not(:disabled) {
        background: var(--canvas);
    }

.btn--block {
    width: 100%;
}

.btn--sm {
    height: 36px;
    padding: 0 14px;
    font-size: 0.875rem;
}

.btn.is-loading,
.btn.is-loading:hover:not(:disabled) {
    color: transparent;
    cursor: progress;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px 20px;
}

.btn--primary.is-loading,
.btn--primary.is-loading:hover:not(:disabled) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9' stroke-opacity='.25'/%3E%3Cpath d='M21 12a9 9 0 0 0-9-9'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
}

.btn--danger.is-loading,
.btn--danger.is-loading:hover:not(:disabled) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='3' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9' stroke-opacity='.25'/%3E%3Cpath d='M21 12a9 9 0 0 0-9-9'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
}

.btn--secondary.is-loading,
.btn--secondary.is-loading:hover:not(:disabled) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555b66' stroke-width='3' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9' stroke-opacity='.25'/%3E%3Cpath d='M21 12a9 9 0 0 0-9-9'%3E%3CanimateTransform attributeName='transform' type='rotate' from='0 12 12' to='360 12 12' dur='0.8s' repeatCount='indefinite'/%3E%3C/path%3E%3C/svg%3E");
}

form.is-submitting .btn,
form.is-submitting input[type="file"] {
    pointer-events: none;
}

.link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-text);
    font-weight: 600;
    text-decoration: none;
}

    .link:hover {
        text-decoration: underline;
        text-underline-offset: 3px;
    }

.icon-btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: none;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--muted);
    text-decoration: none;
}

    .icon-btn:hover {
        background: var(--canvas);
        color: var(--text-strong);
    }

.theme-toggle .i-sun {
    display: none;
}

:root[data-theme="dark"] .theme-toggle .i-sun {
    display: block;
}

:root[data-theme="dark"] .theme-toggle .i-moon {
    display: none;
}

/* ---------- Champs ---------- */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

    .field label,
    .field__label {
        color: var(--text-strong);
        font-size: 0.875rem;
        font-weight: 600;
    }

.input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--input-bg);
    color: var(--text-strong);
    transition: border-color 120ms, box-shadow 120ms;
}

    .input::placeholder {
        color: var(--muted);
        opacity: 0.8;
    }

    .input:hover {
        border-color: var(--muted);
    }

    .input:focus {
        outline: none;
        border-color: var(--accent-text);
        box-shadow: 0 0 0 3px var(--ring);
    }

    .input[aria-invalid="true"] {
        border-color: var(--danger-text);
    }

        .input[aria-invalid="true"]:focus {
            box-shadow: 0 0 0 3px var(--ring-danger);
        }

.input-wrap {
    position: relative;
}

    .input-wrap .input {
        padding-right: 92px;
    }

.input-wrap__toggle {
    position: absolute;
    top: 6px;
    right: 6px;
    height: 30px;
    padding: 0 10px;
    border: 0;
    border-radius: 4px;
    background: none;
    color: var(--accent-text);
    font-size: 0.875rem;
    font-weight: 600;
}

    .input-wrap__toggle:hover {
        background: var(--accent-tint);
    }

/* Code à 6 chiffres en six cases */
.otp {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.input.otp__box {
    height: 56px;
    padding: 0;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    caret-color: var(--accent-text);
}

.notice {
    margin: 0 0 18px;
    padding: 10px 12px;
    border-left: 3px solid;
    border-radius: 0 var(--radius) var(--radius) 0;
    font-size: 0.875rem;
}

.notice--error {
    background: var(--danger-tint);
    border-color: var(--danger-text);
    color: var(--notice-error-text);
}

.notice--ok {
    background: var(--accent-tint);
    border-color: var(--accent-text);
    color: var(--notice-ok-text);
}

/* ==========================================================================
   Page de connexion
   ========================================================================== */

.auth {
    display: grid;
    grid-template-columns: minmax(360px, 46%) 1fr;
    min-height: 100vh;
}

.auth__aside {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 56px 64px 64px;
    background: var(--panel);
    color: #fff;
}

.auth__art {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding-bottom: 32px;
}

    .auth__art svg {
        width: 100%;
        max-width: 560px;
        height: auto;
        max-height: 100%;
    }

.auth__aside h2 {
    max-width: 15em;
    color: #fff;
    font-size: 2rem;
    line-height: 1.18;
}

.auth__points {
    max-width: 30rem;
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

    .auth__points li {
        padding: 13px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.16);
        color: rgba(255, 255, 255, 0.78);
    }

.auth__main {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 32px;
    background: var(--surface);
}

.auth__theme {
    position: absolute;
    top: 20px;
    right: 24px;
}

.auth__box {
    width: 100%;
    max-width: 380px;
}

.auth__logo {
    width: 236px;
    height: auto;
    margin-bottom: 44px;
}

.auth__head {
    margin-bottom: 28px;
}

    .auth__head p {
        margin-top: 6px;
        color: var(--muted);
    }

.auth__links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 22px;
    font-size: 0.875rem;
}

/* ==========================================================================
   Coffre-fort : barre de navigation du haut
   ========================================================================== */

:root {
    --header-h: 64px;
    --page-w: 1320px;
}

.topnav {
    position: sticky;
    top: 0;
    z-index: 40;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

.topnav__inner {
    display: flex;
    align-items: center;
    gap: 32px;
    height: var(--header-h);
    max-width: var(--page-w);
    margin: 0 auto;
    padding: 0 40px;
}

.brand {
    display: block;
    flex: none;
}

    .brand img {
        width: auto;
        height: 40px;
    }

/* ---------- Menu principal ---------- */

.nav {
    display: flex;
    flex: 1;
    align-items: stretch;
    align-self: stretch;
    gap: 2px;
    min-width: 0;
}

.nav__item {
    position: relative;
    display: flex;
}

.nav__link,
.nav__trigger {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 14px;
    border: 0;
    background: none;
    color: var(--text);
    font-size: 0.9375rem;
    text-decoration: none;
    white-space: nowrap;
}

    .nav__link:hover,
    .nav__trigger:hover,
    .nav__trigger[aria-expanded="true"] {
        background: var(--canvas);
        color: var(--text-strong);
    }

    .nav__link[aria-current="page"],
    .nav__trigger.is-current {
        color: var(--text-strong);
    }

        /* Trait vert sous l'entrée de la page courante */
        .nav__link[aria-current="page"]::after,
        .nav__trigger.is-current::after {
            content: "";
            position: absolute;
            right: 14px;
            bottom: -1px;
            left: 14px;
            height: 3px;
            border-radius: 3px 3px 0 0;
            background: var(--accent-text);
        }

    .nav__trigger .chevron {
        width: 14px;
        height: 14px;
        color: var(--muted);
        transform: rotate(90deg);
        transition: transform 120ms;
    }

    .nav__trigger[aria-expanded="true"] .chevron {
        transform: rotate(-90deg);
    }

.nav__panel {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 50;
    margin-top: 1px;
    padding: 8px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-pop);
    animation: panel-in 120ms ease-out;
}

@keyframes panel-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
}

.nav__cols {
    display: flex;
    gap: 8px;
}

.nav__col {
    width: 290px;
}

.nav__group {
    padding: 8px 12px 4px;
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.nav__row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 12px;
    border-radius: var(--radius);
    color: inherit;
    text-decoration: none;
}

    .nav__row:hover {
        background: var(--canvas);
    }

    .nav__row[aria-current="page"] {
        background: var(--accent-tint);
    }

    .nav__row .icon {
        color: var(--muted);
    }

    .nav__row[aria-current="page"] .icon {
        color: var(--accent-text);
    }

.nav__row-label {
    display: block;
    color: var(--text-strong);
    font-weight: 600;
    line-height: 1.3;
}

.nav__row-desc {
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
    line-height: 1.3;
}

.nav__row.is-danger:hover {
    background: var(--danger-tint);
}

    .nav__row.is-danger:hover .icon,
    .nav__row.is-danger:hover .nav__row-label {
        color: var(--danger-text);
    }

.nav__foot {
    display: none;
}

/* ---------- Outils (thème, utilisateur) ---------- */

.topnav__tools {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.topnav__user {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 10px;
    line-height: 1.3;
}

.topnav__user-name {
    color: var(--text-strong);
    font-weight: 600;
    white-space: nowrap;
}

.topnav__user-role {
    color: var(--muted);
    font-size: 0.8125rem;
}

.topnav__burger {
    display: none;
}

.avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    background: var(--avatar-bg);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---------- Contenu ---------- */

.content {
    width: 100%;
    max-width: var(--page-w);
    margin: 0 auto;
    padding: 40px;
}

    .content > .view {
        animation: view-in 140ms ease-out;
    }

@keyframes view-in {
    from {
        opacity: 0;
    }
}

.crumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 0.875rem;
}

    .crumbs a {
        color: inherit;
        text-decoration: none;
    }

        .crumbs a:hover {
            color: var(--text-strong);
            text-decoration: underline;
            text-underline-offset: 3px;
        }

    .crumbs .icon {
        width: 14px;
        height: 14px;
    }

    .crumbs [aria-current="page"] {
        color: var(--text-strong);
        font-weight: 600;
    }

.page-head {
    margin-bottom: 32px;
}

    .page-head h1:focus {
        outline: none;
    }

    .page-head p {
        max-width: 60ch;
        margin-top: 6px;
        color: var(--muted);
    }

/* ---------- Accueil ---------- */

.overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    align-items: start;
}

.panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.panel__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

    .panel__head .icon {
        width: 22px;
        height: 22px;
        color: var(--accent-text);
    }

    .panel__head h2 {
        font-size: 1.0625rem;
    }

.panel__group {
    padding: 12px 20px 6px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.8125rem;
    font-weight: 600;
}

.row {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 11px 20px;
    color: inherit;
    text-decoration: none;
}

    .row:hover {
        background: var(--canvas);
    }

    .row:last-child {
        border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    }

    .row > .icon {
        color: var(--muted);
    }

.row__text {
    flex: 1;
    min-width: 0;
    line-height: 1.35;
}

.row__label {
    display: block;
    color: var(--text-strong);
    font-weight: 600;
}

.row__desc {
    display: block;
    color: var(--muted);
    font-size: 0.875rem;
}

.row .chevron {
    width: 16px;
    height: 16px;
    color: var(--line-strong);
}

.row:hover .chevron {
    color: var(--muted);
}

.row.is-danger:hover .row__label,
.row.is-danger:hover > .icon {
    color: var(--danger-text);
}

/* ---------- Page de fonction ---------- */

.action-panel {
    display: flex;
    margin-bottom: 24px;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 20px 24px;
}

    .action-panel h2 {
        font-size: 1.0625rem;
    }

    .action-panel p {
        max-width: 56ch;
        margin-top: 4px;
        color: var(--muted);
    }

.placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 64px 24px;
    background: var(--surface);
    border: 1px dashed var(--line-strong);
    border-radius: var(--radius-lg);
    color: var(--muted);
    text-align: center;
}

    .placeholder p {
        max-width: 44ch;
    }

    .placeholder strong {
        color: var(--text-strong);
    }

/* ==========================================================================
   Boîte de confirmation
   ========================================================================== */

.dialog {
    width: calc(100% - 32px);
    max-width: 460px;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-pop);
}

    .dialog::backdrop {
        background: var(--overlay);
    }

    .dialog[open] {
        animation: dialog-in 140ms ease-out;
    }

@keyframes dialog-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.dialog__body {
    padding: 24px 24px 8px;
}

.dialog__icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: var(--accent-tint);
    color: var(--accent-text);
}

    .dialog__icon.is-danger {
        background: var(--danger-tint);
        color: var(--danger-text);
    }

.dialog h2 {
    font-size: 1.1875rem;
}

.dialog__text {
    margin-top: 8px;
    color: var(--muted);
}

.dialog__points {
    margin: 14px 0 0;
    padding-left: 18px;
    color: var(--text);
}

    .dialog__points li + li {
        margin-top: 4px;
    }

.dialog__confirm {
    margin: 20px 0 0;
}

.dialog__foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 20px 24px 24px;
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.toasts {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: min(380px, calc(100vw - 32px));
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 8px 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-pop);
    color: var(--text-strong);
    pointer-events: auto;
    animation: toast-in 160ms ease-out;
}

    .toast.is-leaving {
        opacity: 0;
        transform: translateY(6px);
        transition: opacity 160ms, transform 160ms;
    }

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

.toast > .icon {
    margin-top: 1px;
}

.toast--success > .icon {
    color: var(--accent-text);
}

.toast--error > .icon {
    color: var(--danger-text);
}

.toast--info > .icon {
    color: var(--muted);
}

.toast__text {
    flex: 1;
    padding-top: 1px;
}

.toast .icon-btn {
    width: 28px;
    height: 28px;
}

    .toast .icon-btn .icon {
        width: 16px;
        height: 16px;
    }

/* ==========================================================================
   Pages d'erreur
   ========================================================================== */

.err {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.err__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
    padding: 0 32px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
}

    .err__bar img {
        width: auto;
        height: 40px;
    }

.err__main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
}

.err__content {
    width: 100%;
    max-width: 540px;
}

.err__icon {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin-bottom: 24px;
    border-radius: 12px;
    background: var(--accent-tint);
    color: var(--accent-text);
}

    .err__icon .icon {
        width: 26px;
        height: 26px;
    }

.err__icon--danger {
    background: var(--danger-tint);
    color: var(--danger-text);
}

.err__code {
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 0.875rem;
}

.err h1 {
    font-size: 2rem;
}

.err__text {
    max-width: 50ch;
    margin-top: 12px;
    color: var(--muted);
    font-size: 1rem;
}

.err__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

.err__help {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.875rem;
}

    .err__help strong {
        color: var(--text-strong);
    }

/* ==========================================================================
   Ajustements IBM Plex Sans : graisse 500 pour la navigation
   ========================================================================== */

.nav-link,
.nav-toggle,
.nav-sub,
.nav__link,
.nav__trigger {
    font-weight: 500;
}

/* ==========================================================================
   Adaptatif
   ========================================================================== */

@media (max-width: 1100px) {
    .topnav__user-text {
        display: none;
    }
}

@media (max-width: 900px) {
    .auth {
        grid-template-columns: 1fr;
    }

    .auth__aside {
        display: none;
    }

    /* Menu principal : panneau plein écran sous la barre */
    .topnav__inner {
        gap: 8px;
        padding: 0 16px;
    }

    .topnav__user,
    .topnav__logout {
        display: none;
    }

    .topnav__burger {
        display: grid;
    }

    .nav {
        position: fixed;
        top: var(--header-h);
        right: 0;
        bottom: 0;
        left: 0;
        display: none;
        flex-direction: column;
        align-items: stretch;
        align-self: auto;
        gap: 0;
        padding: 8px 16px 24px;
        overflow-y: auto;
        background: var(--surface);
        border-top: 1px solid var(--line);
    }

    .topnav.is-open .nav {
        display: flex;
    }

    .nav__item {
        display: block;
    }

    .nav__link,
    .nav__trigger {
        width: 100%;
        height: 48px;
        padding: 0 12px;
        border-radius: var(--radius);
    }

    .nav__trigger {
        justify-content: space-between;
    }

    .nav__link[aria-current="page"] {
        background: var(--accent-tint);
    }

        .nav__link[aria-current="page"]::after,
        .nav__trigger.is-current::after {
            display: none;
        }

    .nav__panel {
        position: static;
        margin: 0 0 8px 12px;
        padding: 0 0 0 8px;
        border: 0;
        border-left: 1px solid var(--line);
        border-radius: 0;
        box-shadow: none;
        animation: none;
    }

    .nav__cols {
        flex-direction: column;
        gap: 0;
    }

    .nav__col {
        width: auto;
    }

    .nav__row-desc {
        display: none;
    }

    .nav__foot {
        display: flex;
        align-items: center;
        gap: 12px;
        margin-top: auto;
        padding-top: 16px;
        border-top: 1px solid var(--line);
        line-height: 1.3;
    }

        .nav__foot .btn {
            margin-left: auto;
        }

    .content {
        padding: 24px 16px 40px;
    }

    .action-panel {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
    }

    .toasts {
        right: 16px;
        bottom: 16px;
    }

    .err__bar {
        padding: 0 16px;
    }

    h1 {
        font-size: 1.4375rem;
    }

    .err h1 {
        font-size: 1.625rem;
    }
}

@media (max-width: 380px) {
    .otp {
        gap: 6px;
    }

    .input.otp__box {
        height: 50px;
        font-size: 1.25rem;
    }
}

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

/* ==========================================================================
   Chargements, profil, menu utilisateur, session, filigrane
   ========================================================================== */

.muted {
    color: var(--muted);
}

.note {
    max-width: 60ch;
    margin-top: 16px;
    color: var(--muted);
    font-size: 0.875rem;
}

/* ---------- Chargements (squelettes) ---------- */

.skel {
    display: block;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--line) 0%, var(--canvas) 50%, var(--line) 100%);
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
}

@keyframes shimmer {
    from {
        background-position: 200% 0;
    }

    to {
        background-position: -200% 0;
    }
}

.skel--line {
    height: 14px;
    margin-top: 14px;
}

.slot-skel {
    padding: 24px;
}

    .slot-skel .skel--line:first-of-type {
        margin-top: 0;
    }

/* ---------- Jauge (compte à rebours de session) ---------- */

.meter {
    height: 8px;
    margin-top: 12px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--line);
}

.meter__bar {
    height: 100%;
    border-radius: 4px;
    background: var(--accent-text);
}

/* ---------- Profil et mot de passe ---------- */

.dl {
    margin: 0;
    padding: 4px 24px;
}

.dl__row {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 16px;
    padding: 14px 0;
    border-top: 1px solid var(--line);
}

    .dl__row:first-child {
        border-top: 0;
    }

.dl dt {
    color: var(--muted);
}

.dl dd {
    margin: 0;
    color: var(--text-strong);
}

.form {
    max-width: 520px;
    padding: 24px;
}

.form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.rules {
    display: grid;
    gap: 8px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: 0.875rem;
}

    .rules li {
        display: flex;
        align-items: center;
        gap: 10px;
    }

.rules__mark {
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    flex: none;
    border: 1.5px solid var(--line-strong);
    border-radius: 50%;
    color: transparent;
}

    .rules__mark .icon {
        width: 12px;
        height: 12px;
        stroke-width: 2.6;
    }

.rules li.is-ok {
    color: var(--text-strong);
}

    .rules li.is-ok .rules__mark {
        background: var(--accent);
        border-color: var(--accent);
        color: #fff;
    }

/* ---------- Menu utilisateur ---------- */

.umenu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 6px 8px;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: inherit;
    text-align: left;
}

    .user-btn:hover,
    .user-btn[aria-expanded="true"] {
        background: var(--canvas);
    }

.user-btn__text {
    flex: 1;
    min-width: 0;
    line-height: 1.3;
}

.user-btn__name {
    display: block;
    overflow: hidden;
    color: var(--text-strong);
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-btn__role {
    display: block;
    color: var(--muted);
    font-size: 0.8125rem;
}

.user-btn .chevron {
    width: 16px;
    height: 16px;
    color: var(--muted);
}

.umenu__panel {
    position: absolute;
    z-index: 60;
    width: 296px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-pop);
    animation: umenu-in 120ms ease-out;
}

@keyframes umenu-in {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
}

.umenu__head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
}

.umenu__name {
    color: var(--text-strong);
    font-weight: 600;
}

.umenu__role {
    color: var(--muted);
    font-size: 0.8125rem;
}

.umenu__last {
    margin: 0 16px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    font-size: 0.875rem;
    line-height: 1.45;
}

.umenu__label {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.8125rem;
}

.umenu__device {
    color: var(--muted);
}

.umenu__list {
    padding: 8px;
}

.umenu__list--end {
    border-top: 1px solid var(--line);
}

.umenu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: var(--radius);
    color: var(--text-strong);
    text-decoration: none;
}

    .umenu__item:hover {
        background: var(--canvas);
    }

    .umenu__item .icon {
        color: var(--muted);
    }

/* ---------- Session ---------- */

.countdown {
    margin-top: 14px;
    color: var(--text-strong);
    font-size: 2.25rem;
    font-weight: 600;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.session-meter .meter__bar {
    transition: width 1s linear;
}

/* ---------- Connexion : alertes ---------- */

.hint {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
}

    .hint .icon {
        width: 18px;
        height: 18px;
    }

.hint--warn {
    color: var(--warn);
}

.link:disabled {
    color: var(--muted);
    text-decoration: none;
    cursor: not-allowed;
}

.input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ---------- Signature : π en filigrane ---------- */

body.has-mark::after {
    content: "";
    position: fixed;
    right: -5vw;
    bottom: -7vh;
    z-index: -1;
    width: min(52vw, 600px);
    aspect-ratio: 240 / 190;
    background: url("./logo-icone.png") no-repeat center / contain;
    opacity: 0.06;
    pointer-events: none;
}

:root[data-theme="dark"] body.has-mark::after {
    background-image: url("./logo-icone-blanc.png");
    opacity: 0.07;
}

@media (max-width: 900px) {
    .form {
        padding: 16px;
    }
}

@media (max-width: 600px) {
    .dl__row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* ---------- Menu en haut : zone utilisateur ---------- */

.topnav__tools .umenu {
    margin-right: 6px;
}

.topnav__tools .user-btn {
    width: auto;
    padding: 4px 8px 4px 4px;
}

    .topnav__tools .user-btn .chevron {
        transform: rotate(90deg);
    }

.topnav__tools .umenu__panel {
    top: calc(100% + 10px);
    right: 0;
}

/* Mobile : le menu utilisateur est dans le panneau de navigation */
.nav__foot .umenu__head {
    padding: 16px 4px 12px;
}

.nav__foot .umenu__last {
    margin: 0 4px;
}

.nav__foot .umenu__list {
    padding: 8px 0 0;
}

.nav__foot .umenu__list--end {
    margin-top: 4px;
}

@media (max-width: 1100px) {
    .topnav__tools .user-btn__text {
        display: none;
    }
}

@media (max-width: 900px) {
    .topnav__tools .umenu {
        display: none;
    }

    .nav__foot {
        display: block;
        margin-top: auto;
        padding-top: 8px;
        border-top: 1px solid var(--line);
    }
}
