/* ==========================================================================
   Portail Eonel — même identité que le portfolio (« Chambre noire »).
   Aucune ressource externe : polices et scripts sont servis par le portail.
   ========================================================================== */

@font-face {
    font-family: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif-latin-400-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: 'Instrument Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif-latin-ext-400-normal.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif-latin-400-italic.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: 'Instrument Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('../fonts/instrument-serif-latin-ext-400-italic.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Inter Tight';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-tight-latin-wght-normal.woff2') format('woff2-variations');
    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 Tight';
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url('../fonts/inter-tight-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
    --ink: #0b0a09;
    --ink-2: #141210;
    --ink-3: #1c1916;
    --paper: #f2ede5;
    --muted: #8e877d;
    --faint: rgba(242, 237, 229, 0.08);
    --line: rgba(242, 237, 229, 0.14);
    --accent: #d9b88c;
    --ok: #7fd6a0;
    --warn: #e6b657;
    --bad: #ee8b77;

    --serif: 'Instrument Serif', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
    --sans: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

    --ease: cubic-bezier(0.16, 1, 0.3, 1);
    --gutter: clamp(1.25rem, 4vw, 3rem);
    --panel: linear-gradient(160deg, rgba(30, 27, 23, 0.86), rgba(17, 15, 13, 0.86));
}

.accent-gold { --a: #d9b88c; }
.accent-sky { --a: #8fb8e0; }
.accent-rose { --a: #e59aa8; }
.accent-mint { --a: #8fd3b6; }
.accent-violet { --a: #b7a3ea; }

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

html {
    background: var(--ink);
    color-scheme: dark;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    min-height: 100svh;
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--paper);
    background: transparent;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection {
    background: var(--accent);
    color: var(--ink);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 6px;
}

a {
    color: inherit;
}

button {
    font: inherit;
    color: inherit;
}

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

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

/* ---------- Fond ---------- */

.backdrop {
    position: fixed;
    inset: 0;
    z-index: -2;
    overflow: hidden;
    background: radial-gradient(120% 90% at 50% 0%, #17130f 0%, var(--ink) 62%);
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.8;
    will-change: transform;
}

.orb-1 {
    width: 48vmax;
    height: 48vmax;
    left: -14vmax;
    top: -16vmax;
    background: radial-gradient(circle, rgba(217, 184, 140, 0.55), transparent 65%);
    animation: drift-a 40s ease-in-out infinite alternate;
}

.orb-2 {
    width: 42vmax;
    height: 42vmax;
    right: -12vmax;
    top: 18vh;
    background: radial-gradient(circle, rgba(110, 145, 200, 0.42), transparent 65%);
    animation: drift-b 48s ease-in-out infinite alternate;
}

.orb-3 {
    width: 44vmax;
    height: 44vmax;
    left: 28vw;
    bottom: -20vmax;
    background: radial-gradient(circle, rgba(170, 85, 110, 0.34), transparent 65%);
    animation: drift-c 54s ease-in-out infinite alternate;
}

@keyframes drift-a { to { transform: translate3d(16vmax, 12vmax, 0) scale(1.15); } }
@keyframes drift-b { to { transform: translate3d(-14vmax, 10vmax, 0) scale(0.9); } }
@keyframes drift-c { to { transform: translate3d(-12vmax, -14vmax, 0) scale(1.2); } }

.grain {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ---------- Éléments communs ---------- */

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 0.6rem;
    text-decoration: none;
}

.brand-mark {
    font-family: var(--serif);
    font-style: italic;
    font-size: 1.9rem;
    line-height: 1;
}

.brand-tag {
    font-size: 0.66rem;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.75em;
    margin: 0;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.eyebrow::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.35s var(--ease), border-color 0.35s var(--ease), color 0.35s var(--ease);
}

.btn-ghost:hover {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--ink);
}

.btn-mini {
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    font-size: 0.78rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.btn-mini:hover {
    background: var(--bad);
    border-color: var(--bad);
    color: var(--ink);
}

/* ---------- Connexion ---------- */

.login {
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr auto;
    justify-items: center;
    padding: 1.4rem var(--gutter) 1.1rem;
}

.login-brand {
    justify-self: start;
    animation: fade 1.2s var(--ease) both;
}

.login-card {
    position: relative;
    isolation: isolate;
    align-self: center;
    width: min(460px, 100%);
    padding: clamp(1.6rem, 4vw, 2.4rem);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(30, 27, 23, 0.7), rgba(15, 13, 11, 0.74));
    -webkit-backdrop-filter: blur(26px) saturate(140%);
    backdrop-filter: blur(26px) saturate(140%);
    box-shadow: 0 50px 120px -30px rgba(0, 0, 0, 0.85), inset 0 1px 0 rgba(255, 255, 255, 0.07);
    animation: card-in 1.1s var(--ease) both;
}

.login-card::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 0%), rgba(217, 184, 140, 0.16), transparent 60%);
    pointer-events: none;
}

.login-card.has-error {
    animation: card-in 1.1s var(--ease) both, shake 0.55s 0.15s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes card-in {
    from { opacity: 0; transform: translateY(26px) scale(0.985); }
}

@keyframes shake {
    10%, 90% { transform: translateX(-2px); }
    20%, 80% { transform: translateX(4px); }
    30%, 50%, 70% { transform: translateX(-7px); }
    40%, 60% { transform: translateX(7px); }
}

@keyframes fade {
    from { opacity: 0; }
}

.login-title {
    margin: 1rem 0 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2.3rem, 7vw, 3rem);
    line-height: 1;
    letter-spacing: -0.02em;
}

.login-title em {
    color: var(--accent);
}

.login-target {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.4rem 0 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.88rem;
    color: var(--muted);
}

.login-target strong {
    color: var(--paper);
    font-weight: 500;
}

.field {
    position: relative;
    margin-top: 1.1rem;
}

.field input {
    width: 100%;
    padding: 1.35rem 0 0.45rem;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: none;
    color: var(--paper);
    font: inherit;
    font-size: 1.08rem;
    outline: none;
}

.field label {
    position: absolute;
    left: 0;
    top: 1.35rem;
    color: var(--muted);
    pointer-events: none;
    transform-origin: left top;
    transition: transform 0.4s var(--ease), color 0.3s;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field input:-webkit-autofill + label {
    transform: translateY(-1.2rem) scale(0.72);
    color: var(--accent);
}

.field::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease);
}

.field:focus-within::after {
    transform: scaleX(1);
}

.field input:-webkit-autofill {
    -webkit-text-fill-color: var(--paper);
    box-shadow: 0 0 0 100px #1a1714 inset;
    caret-color: var(--paper);
}

.field--password input {
    padding-right: 2.6rem;
}

.reveal {
    position: absolute;
    right: -0.3rem;
    bottom: 0.2rem;
    display: grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.3s;
}

.reveal:hover {
    color: var(--paper);
}

.reveal-off,
.reveal[aria-pressed='true'] .reveal-on {
    display: none;
}

.reveal[aria-pressed='true'] .reveal-off {
    display: block;
}

.field--code input {
    font-family: var(--mono);
    font-size: 1.3rem;
    letter-spacing: 0.55em;
}

.field--code input[data-mode='recovery'] {
    font-size: 1.08rem;
    letter-spacing: 0.12em;
}

.link-btn {
    display: block;
    margin: 0.5rem 0 0;
    padding: 0;
    border: 0;
    background: none;
    font-size: 0.82rem;
    color: var(--muted);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--line);
    cursor: pointer;
    transition: color 0.3s, text-decoration-color 0.3s;
}

.link-btn:hover {
    color: var(--paper);
    text-decoration-color: var(--paper);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    margin-top: 1.1rem;
    font-size: 0.9rem;
    color: var(--muted);
    cursor: pointer;
    user-select: none;
}

.check input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.check-box {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: transparent;
    transition: background 0.3s, border-color 0.3s, color 0.3s;
}

.check input:checked + .check-box {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--ink);
}

.check input:focus-visible + .check-box {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.form-error {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin: 1.1rem 0 0;
    padding: 0.7rem 0.9rem;
    border: 1px solid rgba(238, 139, 119, 0.4);
    border-radius: 12px;
    background: rgba(238, 139, 119, 0.1);
    font-size: 0.9rem;
    color: #f5b7a9;
}

.form-error .icon {
    margin-top: 1px;
}

.btn-primary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 1.3rem;
    padding: 1rem 1.4rem;
    border: 0;
    border-radius: 999px;
    background: var(--paper);
    color: var(--ink);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), background 0.3s;
}

.btn-primary .icon {
    transition: transform 0.5s var(--ease);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px -14px rgba(217, 184, 140, 0.55);
}

.btn-primary:hover .icon {
    transform: translateX(5px);
}

.btn-primary:active {
    transform: scale(0.985);
}

.btn-primary:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary[aria-busy='true'] {
    background: linear-gradient(100deg, var(--paper) 30%, #fff 50%, var(--paper) 70%) 0 0 / 250% 100%;
    animation: shimmer 1.1s linear infinite;
}

@keyframes shimmer {
    to { background-position: -250% 0; }
}

.login-foot {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.3rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--faint);
    font-size: 0.8rem;
    color: var(--muted);
}

.login-legal {
    margin: 0;
    font-size: 0.74rem;
    color: var(--muted);
    text-align: center;
}

/* ---------- Tableau de bord : barre du haut ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem var(--gutter);
    background: rgba(11, 10, 9, 0.62);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--faint);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 1.1rem;
}

.whoami {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    font-size: 0.9rem;
}

.avatar {
    display: grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--accent), #8d6b3f);
    color: var(--ink);
    font-family: var(--serif);
    font-size: 1.2rem;
    font-style: italic;
}

/* ---------- Tableau de bord ---------- */

.dash {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 var(--gutter) 4rem;
}

.hero {
    padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(2.5rem, 5vw, 4rem);
}

.hero-title {
    margin: 1.4rem 0 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(3rem, 8.6vw, 7.4rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.hero-title em {
    color: var(--accent);
}

.hero-sub {
    margin: 1.6rem 0 0;
    font-size: clamp(1rem, 1.6vw, 1.2rem);
    color: var(--muted);
}

.section {
    padding-top: clamp(2.2rem, 5vw, 3.6rem);
    scroll-margin-top: 5rem;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem 1.5rem;
    margin-bottom: 1.6rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--faint);
}

.section-title {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(2rem, 4vw, 2.9rem);
    line-height: 1;
    letter-spacing: -0.015em;
}

.section-note {
    margin: 0;
    font-size: 0.85rem;
    color: var(--muted);
}

.section-note strong {
    font-weight: 500;
    color: var(--paper);
}

/* Applications */

.apps {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 1.1rem;
}

.app {
    --a: var(--accent);
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    min-height: 260px;
    padding: 1.7rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--panel);
    text-decoration: none;
    transition: transform 0.7s var(--ease), border-color 0.4s, box-shadow 0.7s var(--ease);
}

.app::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: radial-gradient(440px circle at var(--mx, 30%) var(--my, 0%), color-mix(in srgb, var(--a) 24%, transparent), transparent 60%);
    opacity: 0;
    transition: opacity 0.5s;
}

.app:hover,
.app:focus-visible {
    transform: translateY(-5px);
    border-color: color-mix(in srgb, var(--a) 45%, transparent);
    box-shadow: 0 34px 70px -34px color-mix(in srgb, var(--a) 40%, black);
}

.app:hover::before,
.app:focus-visible::before {
    opacity: 1;
}

.app-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.app-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    border: 1px solid color-mix(in srgb, var(--a) 38%, transparent);
    background: linear-gradient(145deg, color-mix(in srgb, var(--a) 24%, transparent), color-mix(in srgb, var(--a) 5%, transparent));
    color: var(--a);
}

.status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.78rem;
    font-weight: 500;
}

.dot {
    flex: none;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ok);
    animation: pulse 2.6s ease-out infinite;
}

.status.is-down .dot {
    background: var(--bad);
    animation: none;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(127, 214, 160, 0.55); }
    70%, 100% { box-shadow: 0 0 0 9px rgba(127, 214, 160, 0); }
}

.ms {
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.app-body {
    display: grid;
    gap: 0.5rem;
}

.app-name {
    font-family: var(--serif);
    font-size: 2.2rem;
    line-height: 1.02;
    letter-spacing: -0.01em;
}

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

.app-foot {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-top: auto;
}

.app-host {
    margin-right: auto;
    overflow: hidden;
    font-family: var(--mono);
    font-size: 0.78rem;
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.32rem 0.7rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.badge.is-protected {
    background: rgba(127, 214, 160, 0.12);
    color: var(--ok);
}

.badge.is-public {
    background: rgba(255, 255, 255, 0.06);
    color: var(--muted);
}

.app-go {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    transition: background 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s;
}

.app-go .icon {
    transition: transform 0.5s var(--ease);
}

.app:hover .app-go,
.app:focus-visible .app-go {
    background: var(--paper);
    border-color: var(--paper);
    color: var(--ink);
}

.app:hover .app-go .icon,
.app:focus-visible .app-go .icon {
    transform: translate(2px, -2px);
}

/* Serveur */

.rings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 1.1rem;
}

.ring {
    position: relative;
    display: grid;
    justify-items: center;
    gap: 1rem;
    margin: 0;
    padding: 1.7rem 1.4rem 1.5rem;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--panel);
}

.ring-svg {
    width: 150px;
    height: 150px;
    transform: rotate(-90deg);
}

.ring-track,
.ring-value {
    fill: none;
    stroke-width: 6.5;
}

.ring-track {
    stroke: var(--faint);
}

.ring-value {
    stroke: var(--accent);
    stroke-linecap: round;
    transition: stroke-dasharray 1.5s var(--ease), stroke 0.4s;
}

.ring.is-warn .ring-value { stroke: var(--warn); }
.ring.is-bad .ring-value { stroke: var(--bad); }

.ring-center {
    position: absolute;
    top: 1.7rem;
    left: 0;
    right: 0;
    display: grid;
    place-items: center;
    height: 150px;
    font-family: var(--serif);
    font-size: 2.9rem;
    line-height: 1;
}

.ring-center small {
    margin-left: 0.15rem;
    font-family: var(--sans);
    font-size: 0.85rem;
    color: var(--muted);
}

.ring figcaption {
    display: grid;
    gap: 0.15rem;
    text-align: center;
}

.ring-label {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
}

.ring-detail {
    font-size: 0.85rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

.updated {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.2rem 0 0;
    font-size: 0.78rem;
    color: var(--muted);
}

.updated .dot {
    width: 6px;
    height: 6px;
}

/* Sécurité */

.security {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 1.1rem;
}

.panel {
    padding: 1.9rem;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--panel);
}

.panel-title {
    margin: 0 0 1rem;
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.panel-title--spaced {
    margin-top: 2.2rem;
}

.checks,
.sessions,
.timeline {
    margin: 0;
    padding: 0;
    list-style: none;
}

.check-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--faint);
}

.check-row:first-child {
    border-top: 0;
}

.check-row.is-ok .icon { color: var(--ok); }
.check-row.is-warn .icon { color: var(--warn); }

.session {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 0;
    border-top: 1px solid var(--faint);
}

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

.session-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--muted);
}

.session.is-current .session-icon {
    background: rgba(127, 214, 160, 0.12);
    color: var(--ok);
}

.session-text {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.session-device {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.session-meta {
    font-size: 0.8rem;
    color: var(--muted);
}

.pill {
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    background: rgba(127, 214, 160, 0.14);
    color: var(--ok);
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

.panel-action {
    margin-top: 1.2rem;
}

.timeline {
    display: grid;
}

.tl-item {
    display: grid;
    grid-template-columns: 10px 1fr auto;
    align-items: start;
    gap: 1rem;
    padding: 0.85rem 0;
    border-top: 1px solid var(--faint);
}

.tl-item:first-child {
    border-top: 0;
}

.tl-dot {
    width: 8px;
    height: 8px;
    margin-top: 0.5rem;
    border-radius: 50%;
    background: var(--muted);
}

.tone-ok .tl-dot { background: var(--ok); }
.tone-bad .tl-dot { background: var(--bad); }

.tl-text {
    display: grid;
    gap: 0.1rem;
    min-width: 0;
}

.tl-title {
    font-weight: 500;
}

.tl-meta,
.tl-time {
    font-size: 0.8rem;
    color: var(--muted);
}

.tl-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tl-time {
    padding-top: 0.15rem;
    white-space: nowrap;
}

.empty {
    margin: 0;
    color: var(--muted);
}

.dash-foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin-top: clamp(3rem, 7vw, 5rem);
    padding-top: 1.4rem;
    border-top: 1px solid var(--faint);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted);
}

/* ---------- Erreur ---------- */

.error {
    min-height: 100svh;
    display: grid;
    grid-template-rows: auto 1fr;
    padding: 1.75rem var(--gutter);
}

.error-body {
    align-self: center;
    justify-self: start;
    display: grid;
    gap: 1.2rem;
    justify-items: start;
    max-width: 640px;
}

.error-code {
    margin: 0;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(6rem, 22vw, 15rem);
    line-height: 0.85;
    letter-spacing: -0.04em;
    color: var(--accent);
}

.error-message {
    margin: 0 0 0.6rem;
    font-size: 1.2rem;
    color: var(--muted);
}

/* ---------- Navigation, comptes et administration ---------- */

.topnav {
    display: flex;
    gap: clamp(0.4rem, 2vw, 1.6rem);
    margin-left: auto;
    margin-right: clamp(0.6rem, 2vw, 2rem);
}

.topnav-link {
    position: relative;
    padding: 0.5rem 0.2rem;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-decoration: none;
    color: var(--muted);
    transition: color 0.3s;
}

.topnav-link::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0.15rem;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.5s var(--ease);
}

.topnav-link:hover,
.topnav-link.is-active {
    color: var(--paper);
}

.topnav-link:hover::after,
.topnav-link.is-active::after {
    transform: scaleX(1);
}

.hero--compact {
    padding-bottom: clamp(1rem, 3vw, 2rem);
}

.hero--compact .hero-title {
    font-size: clamp(2.6rem, 6.4vw, 5.4rem);
}

.hero--compact .hero-sub {
    max-width: 62ch;
}

.notice {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin: 1.4rem 0 0;
    padding: 0.6rem 1rem;
    border: 1px solid rgba(127, 214, 160, 0.4);
    border-radius: 999px;
    background: rgba(127, 214, 160, 0.1);
    font-size: 0.88rem;
    color: var(--ok);
}

.hint {
    margin: 0.6rem 0 0;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--muted);
}

.hint--warn {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-top: 1.4rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(230, 182, 87, 0.4);
    border-radius: 12px;
    background: rgba(230, 182, 87, 0.09);
    font-size: 0.88rem;
    color: #efce8f;
}

.hint--warn .icon {
    margin-top: 2px;
}

.empty-panel {
    margin: 0;
    color: var(--muted);
}

.panel-form {
    display: grid;
    gap: 0.4rem;
}

.panel-form--narrow {
    max-width: 520px;
}

.panel-form .field {
    margin-top: 0.7rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
    gap: 0 2rem;
}

.btn-inline {
    width: auto;
    min-width: 240px;
    justify-self: start;
    gap: 2.5rem;
}

.form-error--page {
    max-width: 720px;
}

fieldset.access {
    min-width: 0;
    margin: 1.4rem 0 0;
    padding: 0;
    border: 0;
}

fieldset.access .panel-title {
    padding: 0;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.chip {
    --a: var(--accent);
    position: relative;
    cursor: pointer;
    user-select: none;
}

.chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.chip-body {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 1rem 0.6rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    font-size: 0.9rem;
    color: var(--muted);
    transition: background 0.35s var(--ease), border-color 0.35s, color 0.35s;
}

.chip-body .icon:last-child {
    width: 0;
    opacity: 0;
    margin-left: -0.6rem;
    transition: width 0.35s var(--ease), opacity 0.35s, margin 0.35s var(--ease);
}

.chip:hover .chip-body {
    border-color: color-mix(in srgb, var(--a) 50%, transparent);
    color: var(--paper);
}

.chip input:checked + .chip-body {
    border-color: color-mix(in srgb, var(--a) 60%, transparent);
    background: color-mix(in srgb, var(--a) 16%, transparent);
    color: var(--paper);
}

.chip input:checked + .chip-body .icon:first-child {
    color: var(--a);
}

.chip input:checked + .chip-body .icon:last-child {
    width: 14px;
    opacity: 1;
    margin-left: 0;
    color: var(--a);
}

.chip input:focus-visible + .chip-body {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
}

.accounts {
    display: grid;
    gap: 1.1rem;
}

.account {
    display: grid;
    gap: 1.3rem;
    padding: 1.7rem;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--panel);
    scroll-margin-top: 6rem;
}

.account.is-off {
    opacity: 0.62;
}

.account-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem 1.1rem;
}

.avatar--big {
    width: 52px;
    height: 52px;
    font-size: 1.7rem;
}

.account-id {
    display: grid;
    min-width: 0;
}

.account-id strong {
    overflow: hidden;
    font-family: var(--serif);
    font-size: 1.7rem;
    font-weight: 400;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.4rem;
}

.account-last {
    grid-column: 2 / -1;
    font-size: 0.8rem;
    color: var(--muted);
}

.account-note {
    margin: 0;
    color: var(--muted);
}

.account-access .panel-title {
    margin-bottom: 0.8rem;
}

.account-save {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.1rem;
}

.saved {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--ok);
}

.account-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    padding-top: 1.2rem;
    border-top: 1px solid var(--faint);
}

.badge.is-off {
    background: rgba(238, 139, 119, 0.14);
    color: var(--bad);
}

.badge.is-warn {
    background: rgba(230, 182, 87, 0.14);
    color: var(--warn);
}

.btn-mini--danger:hover {
    background: var(--bad);
    border-color: var(--bad);
}

.secret {
    max-width: 640px;
}

.secret-grid {
    display: grid;
    gap: 1.2rem;
    margin: 1.2rem 0 0;
}

.secret-grid dt {
    margin-bottom: 0.3rem;
    font-size: 0.72rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--muted);
}

.secret-grid dd {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 1.15rem;
}

.mono {
    font-family: var(--mono);
}

.secret-value {
    padding: 1rem 1.2rem;
    border: 1px dashed color-mix(in srgb, var(--accent) 55%, transparent);
    border-radius: 14px;
    background: rgba(217, 184, 140, 0.07);
    font-size: 1.5rem;
    letter-spacing: 0.06em;
    color: var(--accent);
    user-select: all;
}

.secret-actions {
    margin-top: 1.2rem;
}

.denied-title {
    margin: 0;
    font-family: var(--serif);
    font-weight: 400;
    font-size: clamp(3rem, 9vw, 7rem);
    line-height: 0.95;
    letter-spacing: -0.03em;
}

.denied-title em {
    color: var(--accent);
}

/* ---------- Apparition ---------- */

.rise {
    animation: rise 1.1s var(--ease) both;
}

.rise.d1 { animation-delay: 0.12s; }
.rise.d2 { animation-delay: 0.24s; }
.rise.d3 { animation-delay: 0.36s; }

@keyframes rise {
    from { opacity: 0; transform: translateY(28px); }
}

/* ---------- Adaptations ---------- */

@media (max-width: 720px) {
    .who-name {
        display: none;
    }

    .topbar {
        flex-wrap: wrap;
        row-gap: 0.4rem;
    }

    .topnav {
        order: 3;
        width: 100%;
        margin: 0;
        justify-content: space-between;
    }

    .topnav-link {
        font-size: 0.7rem;
        letter-spacing: 0.08em;
        white-space: nowrap;
    }

    .account-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .account-badges {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .account-last {
        grid-column: 1 / -1;
    }

    .btn-inline {
        width: 100%;
    }

    .brand-mark {
        font-size: 1.6rem;
    }

    .app {
        min-height: 0;
        padding: 1.4rem;
    }

    .panel {
        padding: 1.4rem;
    }

    .tl-item {
        grid-template-columns: 10px 1fr;
    }

    .tl-time {
        grid-column: 2;
        padding-top: 0;
    }
}

/* Le raccourci clavier n'a pas de sens sans clavier. */
@media (hover: none) {
    .section-note--keys {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-delay: 0ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
