/* Vaultwarden Community — styles publics.
   Palette officielle Bitwarden, police Inter auto-hébergée, aucun CDN. */

@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url(fonts/inter-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';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url(fonts/inter-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+0304, U+0308,
    U+0329, 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';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url(fonts/inter-cyrillic-wght-normal.woff2) format('woff2-variations');
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
    /* Charte Bitwarden */
    --blue:        #175ddc;
    --blue-deep:   #0c3276;
    --blue-hover:  #1252c0;
    --teal:        #2cdde9;
    --teal-light:  #a2f4fd;
    --green:       #7bf1a8;
    --yellow:      #fdc700;
    --red:         #ff6550;

    --surface:      #ffffff;
    --surface-alt:  #f3f6f9;
    --line:         #d8e2eb;
    --ink:          #1b2430;
    --ink-soft:     #56616f;
    --on-blue-soft: #c7d8f6;

    --green-ink:   #0f6b3f;
    --yellow-ink:  #8a6200;
    --red-ink:     #bc3b2a;

    --shadow-sm: 0 1px 2px rgba(12, 50, 118, .06), 0 4px 12px -6px rgba(12, 50, 118, .12);
    --shadow-lg: 0 24px 48px -28px rgba(8, 31, 74, .55);

    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;

    --radius: 8px;
    --radius-lg: 14px;
    --wrap: 1160px;
    /* Marge latérale généreuse : sur téléphone, le contenu ne doit jamais
       coller aux bords ; safe-area pour encoches et barres système. */
    --gutter: clamp(1.5rem, 6vw, 2.5rem);
    --pad-left: max(var(--gutter), env(safe-area-inset-left, 0px));
    --pad-right: max(var(--gutter), env(safe-area-inset-right, 0px));
}

[data-theme="dark"] {
    --blue:        #6a99f3;
    --blue-deep:   #0b1d3a;
    --blue-hover:  #86aef7;
    --surface:     #1f242e;
    --surface-alt: #2a2f3a;
    --line:        #3b4350;
    --ink:         #f3f6f9;
    --ink-soft:    #a5aebc;
    --green-ink:   #7bf1a8;
    --yellow-ink:  #fdc700;
    --red-ink:     #ff8f7e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow-lg: 0 24px 48px -28px rgba(0, 0, 0, .75);
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --blue:        #6a99f3;
        --blue-deep:   #0b1d3a;
        --blue-hover:  #86aef7;
        --surface:     #1f242e;
        --surface-alt: #2a2f3a;
        --line:        #3b4350;
        --ink:         #f3f6f9;
        --ink-soft:    #a5aebc;
        --green-ink:   #7bf1a8;
        --yellow-ink:  #fdc700;
        --red-ink:     #ff8f7e;
        --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
        --shadow-lg: 0 24px 48px -28px rgba(0, 0, 0, .75);
    }
}

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

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

body {
    margin: 0;
    background: var(--surface);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 17px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
    font-weight: 700;
    letter-spacing: -0.022em;
    line-height: 1.15;
    margin: 0 0 .55em;
}

h1 { font-size: clamp(2.15rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.6rem, 3.2vw, 2.25rem); }
h3 { font-size: 1.1rem; letter-spacing: -0.012em; }

p { margin: 0 0 1.05em; }

a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-hover); text-decoration: underline; }

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

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin-inline: auto;
    padding-left: var(--pad-left);
    padding-right: var(--pad-right);
}

.skip {
    position: absolute;
    left: -9999px;
    background: var(--blue);
    color: #fff;
    padding: .65rem 1.1rem;
    border-radius: var(--radius);
    z-index: 60;
}
.skip:focus { left: .75rem; top: .75rem; }

/* -------------------------------------------------------------- en-tête */

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

/* Deux rangées assumées : marque et outils en haut, navigation en dessous.
   La largeur utile est plafonnée à 1160 px par .wrap ; une ligne unique qui ne
   tient pas à cette largeur ne tiendra à aucune, quel que soit l'écran. Mieux
   vaut une disposition prévisible qu'un mot tronqué. */
.masthead__inner {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    padding-block: .8rem;
    row-gap: .1rem;
}

.brand { display: inline-flex; align-items: center; gap: .65rem; margin-right: auto; color: inherit; }
.brand:hover { text-decoration: none; }
.brand__mark { width: 34px; height: 34px; flex: none; color: var(--blue); }
.brand__name { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.02em; display: block; }
.brand__sub { display: block; font-size: .76rem; color: var(--ink-soft); line-height: 1.35; white-space: nowrap; }

.nav {
    display: flex;
    align-items: center;
    order: 3;
    width: 100%;
    gap: 1.5rem;
    margin: 0 calc(var(--pad-right) * -1) 0 calc(var(--pad-left) * -1);
    padding: .5rem var(--pad-right) 0 var(--pad-left);
    border-top: 1px solid var(--line);
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    justify-content: center;
}
.nav::-webkit-scrollbar { display: none; }
.nav a {
    color: var(--ink);
    font-size: .95rem;
    font-weight: 500;
    padding: .35rem 0;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
}
.nav a:hover { color: var(--blue); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--blue); border-bottom-color: var(--blue); }

.tools { display: flex; align-items: center; gap: .5rem; margin-left: auto; }

/* Entrée de soutien : elle doit se distinguer des liens de navigation sans
   rivaliser avec les boutons d'inscription. */
.nav a.nav--support {
    border: 1.5px solid var(--yellow);
    border-bottom-color: var(--yellow);
    border-radius: 999px;
    padding: .28rem .85rem;
    color: var(--ink);
    font-weight: 600;
}
.nav a.nav--support:hover {
    background: var(--yellow);
    border-color: var(--yellow);
    color: #26200a;
}

.picker { position: relative; }

.picker__button {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--ink);
    font: inherit;
    font-size: .85rem;
    font-weight: 500;
    padding: .42rem .7rem;
    border-radius: var(--radius);
    cursor: pointer;
}
.picker__button:hover { border-color: var(--blue); color: var(--blue); }
.picker__button svg { width: 16px; height: 16px; }
.picker__flag { font-size: 1.15rem; line-height: 1; }
.picker__caret { width: 13px; height: 13px; opacity: .65; }

/* Bascule de thème : un seul bouton, qui affiche l'icône du mode actif et
   fait défiler clair, sombre, système. */
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--ink);
    font: inherit;
    padding: .42rem .52rem;
    cursor: pointer;
}
.theme-toggle:hover { border-color: var(--blue); color: var(--blue); }
.theme-toggle svg { display: none; width: 16px; height: 16px; }
.theme-toggle[data-state="light"] [data-icon="light"],
.theme-toggle[data-state="dark"] [data-icon="dark"],
.theme-toggle[data-state="auto"] [data-icon="auto"] { display: block; }

.picker__menu {
    position: absolute;
    right: 0;
    top: calc(100% + .45rem);
    min-width: 180px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: .3rem;
    z-index: 40;
    display: none;
}
.picker__menu[data-open="true"] { display: block; }
.picker:focus-within .picker__menu { display: block; }

.picker__menu a, .picker__menu button {
    display: flex;
    width: 100%;
    align-items: center;
    background: none;
    border: 0;
    border-radius: 5px;
    font: inherit;
    font-size: .92rem;
    color: var(--ink);
    text-align: left;
    padding: .45rem .6rem;
    cursor: pointer;
}
.picker__menu a { gap: .55rem; }
.picker__menu a:hover, .picker__menu button:hover { background: var(--surface-alt); text-decoration: none; }
.picker__menu [aria-current="true"] { color: var(--blue); font-weight: 600; }

/* ------------------------------------------------------------- boutons */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    font: inherit;
    font-size: .97rem;
    font-weight: 600;
    padding: .72rem 1.4rem;
    border-radius: var(--radius);
    border: 2px solid var(--blue);
    background: var(--blue);
    color: #fff;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: #fff; text-decoration: none; }

.btn--ghost { background: transparent; color: var(--blue); }
.btn--ghost:hover { background: var(--blue); color: #fff; }

.btn--light { background: #fff; border-color: #fff; color: var(--blue-deep); }
.btn--light:hover { background: var(--teal-light); border-color: var(--teal-light); color: var(--blue-deep); }

.btn--outline-light { background: transparent; border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn--outline-light:hover { background: rgba(255, 255, 255, .14); border-color: #fff; color: #fff; }

.btn--yellow { background: var(--yellow); border-color: var(--yellow); color: #26200a; }
.btn--yellow:hover { background: #ffd429; border-color: #ffd429; color: #26200a; }

.btn--small { padding: .48rem 1rem; font-size: .89rem; border-width: 1.5px; }

/* ---------------------------------------------------------------- hero */

.hero-band {
    background: linear-gradient(135deg, #0c3276 0%, #175ddc 100%);
    color: #fff;
    position: relative;
    overflow: hidden;
}

.hero-band::after {
    content: "";
    position: absolute;
    right: -12%;
    top: -45%;
    width: 46rem;
    height: 46rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(44, 221, 233, .22), transparent 62%);
    pointer-events: none;
}

.hero {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
    /* padding-block seulement : un padding horizontal à 0 écraserait le gutter de .wrap */
    padding-block: clamp(3rem, 7vw, 5.5rem);
}

.hero h1 { color: #fff; max-width: 16ch; }

.hero__lead {
    font-size: clamp(1.05rem, 1.6vw, 1.2rem);
    color: var(--on-blue-soft);
    max-width: 48ch;
    margin-bottom: 1.9rem;
}

.hero__actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.hero__trust {
    display: flex;
    flex-wrap: wrap;
    gap: 1.4rem;
    margin: 2.2rem 0 0;
    padding: 0;
    list-style: none;
    font-size: .9rem;
    color: var(--on-blue-soft);
}
.hero__trust li { display: flex; align-items: center; gap: .45rem; }
.hero__trust svg { width: 17px; height: 17px; color: var(--teal); flex: none; }

/* Carte des serveurs posée sur la bannière. */
.board {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    color: var(--ink);
}

.board__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .95rem 1.15rem;
    border-bottom: 1px solid var(--line);
    background: var(--surface-alt);
    font-weight: 600;
    font-size: .98rem;
}

.board__count {
    font-size: .78rem;
    font-weight: 600;
    color: var(--blue);
    background: rgba(23, 93, 220, .1);
    border-radius: 999px;
    padding: .18rem .6rem;
}

.board__row {
    display: grid;
    grid-template-columns: 1.8rem 1fr auto;
    align-items: center;
    gap: .8rem;
    padding: .72rem 1.15rem;
    border-bottom: 1px solid var(--line);
    color: inherit;
    font-size: .94rem;
    font-weight: 500;
}
.board__row:last-of-type { border-bottom: 0; }
.board__row:hover { background: var(--surface-alt); text-decoration: none; }
.board__flag { font-size: 1.2rem; line-height: 1; }
.board__host { display: block; font-size: .78rem; font-weight: 400; color: var(--ink-soft); }
.board__note { padding: .8rem 1.15rem; margin: 0; font-size: .78rem; color: var(--ink-soft); background: var(--surface-alt); }
.board__empty { padding: 1.6rem 1.15rem; margin: 0; color: var(--ink-soft); font-size: .93rem; }

.board__row { animation: rise .45s ease both; }
.board__row:nth-child(2) { animation-delay: .06s; }
.board__row:nth-child(3) { animation-delay: .12s; }
.board__row:nth-child(4) { animation-delay: .18s; }
.board__row:nth-child(5) { animation-delay: .24s; }
.board__row:nth-child(n+6) { animation-delay: .3s; }

@keyframes rise {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------- statuts */

.status {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    padding: .22rem .6rem;
    border-radius: 999px;
    background: var(--surface-alt);
    color: var(--ink-soft);
    border: 1px solid var(--line);
}

.status__dot { width: .52rem; height: .52rem; border-radius: 50%; background: currentColor; flex: none; position: relative; }

.status--online { color: var(--green-ink); background: rgba(123, 241, 168, .2); border-color: rgba(123, 241, 168, .55); }
.status--offline { color: var(--red-ink); background: rgba(255, 101, 80, .14); border-color: rgba(255, 101, 80, .45); }
.status--maintenance { color: var(--yellow-ink); background: rgba(253, 199, 0, .16); border-color: rgba(253, 199, 0, .5); }
.status--soon { color: var(--ink-soft); }
.status--soon .status__dot { background: transparent; border: 1.5px solid currentColor; }

.status--online .status__dot::after {
    content: "";
    position: absolute;
    inset: -4px;
    border: 1.5px solid currentColor;
    border-radius: 50%;
    opacity: 0;
    animation: halo 3.2s ease-out infinite;
}

@keyframes halo {
    0%   { opacity: .6; transform: scale(.55); }
    70%  { opacity: 0; transform: scale(1.2); }
    100% { opacity: 0; }
}

/* ------------------------------------------------------------ sections */

.section { padding: clamp(3rem, 6.5vw, 5rem) 0; }
.section--alt { background: var(--surface-alt); }

.section__head { max-width: 62ch; margin-bottom: 2.4rem; }
.section__head p { color: var(--ink-soft); font-size: 1.06rem; margin: 0; }

/* -------------------------------------------------------------- cartes */

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.3rem; }

.card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.6rem;
    box-shadow: var(--shadow-sm);
}

.card__icon {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    background: rgba(23, 93, 220, .1);
    color: var(--blue);
    display: grid;
    place-items: center;
    margin-bottom: 1rem;
}
.card__icon svg { width: 22px; height: 22px; }
.card h3 { margin-bottom: .4rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* -------------------------------------------------------------- étapes */

.steps { counter-reset: step; list-style: none; margin: 0; padding: 0; display: grid; gap: 1.6rem; }

.step { counter-increment: step; display: grid; grid-template-columns: 2.6rem 1fr; gap: 1.1rem; align-items: start; }

.step::before {
    content: counter(step);
    width: 2.6rem;
    height: 2.6rem;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-weight: 700;
    font-size: 1.05rem;
    display: grid;
    place-items: center;
}

.step h3 { margin-bottom: .25rem; }
.step p { margin: 0; color: var(--ink-soft); font-size: .96rem; }
.step--plain { grid-template-columns: 2.2rem 1fr; }
.step--plain::before { width: 2.2rem; height: 2.2rem; font-size: .95rem; }
.step--plain p { color: var(--ink); }

/* ------------------------------------------------------------ registre */

.register {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.entry {
    display: grid;
    grid-template-columns: 2.8rem minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 1.2rem;
    padding: 1.15rem 1.4rem;
    border-bottom: 1px solid var(--line);
}
.entry:last-child { border-bottom: 0; }
.entry:hover { background: var(--surface-alt); }

.entry__flag { font-size: 1.7rem; line-height: 1; text-align: center; }
.entry__country { display: block; font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; }
.entry__host { font-size: .85rem; color: var(--ink-soft); }
.entry__note { display: block; margin-top: .2rem; font-size: .85rem; color: var(--ink-soft); }
.entry--muted .entry__flag { filter: grayscale(1); opacity: .7; }
.entry--muted .entry__country { color: var(--ink-soft); }

.register__foot {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-top: 1.2rem;
    font-size: .92rem;
    color: var(--ink-soft);
}
.register__foot p { margin: 0; }

.legend { display: flex; flex-wrap: wrap; gap: .5rem; }

/* ---------------------------------------------------------------- faq */

.faq { display: grid; gap: 1rem; margin: 0; }
.faq__item {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.3rem 1.5rem;
}
.faq dt { font-weight: 600; font-size: 1.06rem; margin-bottom: .35rem; }
.faq dd { margin: 0; color: var(--ink-soft); font-size: .96rem; }

/* --------------------------------------------------------------- dons */

.donate { background: var(--blue-deep); color: #fff; }

.donate__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2.5rem;
    align-items: center;
    padding-block: clamp(2.4rem, 5vw, 3.4rem);
}

.donate h2 { color: #fff; margin-bottom: .5rem; max-width: 22ch; }
.donate p { margin: 0; color: var(--on-blue-soft); max-width: 60ch; font-size: 1rem; }
.donate__note { display: block; margin-top: .6rem; font-size: .86rem; color: rgba(255, 255, 255, .65); }

/* --------------------------------------------------------------- pied */

.footer { background: #0a2559; color: #c7d8f6; padding: 3.2rem 0 2.4rem; font-size: .92rem; }
[data-theme="dark"] .footer { background: #161b24; }

/* Quatre blocs : marque, menu, mentions légales, logiciels. Une grille à
   trois colonnes renvoyait le quatrième sous le premier, d'où le trou. */
.footer__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
    gap: 2.5rem;
    align-items: start;
}
.footer h3 { color: #fff; font-size: .95rem; margin-bottom: .7rem; }
.footer p { color: #c7d8f6; }
.footer ul { list-style: none; margin: 0; padding: 0; }
.footer li { margin-bottom: .45rem; }
.footer a { color: #c7d8f6; }
.footer a:hover { color: #fff; }
.footer__fine {
    margin: 2.4rem 0 0;
    padding-top: 1.6rem;
    border-top: 1px solid rgba(199, 216, 246, .22);
    font-size: .84rem;
    color: rgba(199, 216, 246, .78);
    max-width: 74ch;
}

/* -------------------------------------------------------------- guide */

.guide__head { padding-block: clamp(2.6rem, 5vw, 3.8rem) 0; }
.guide__head h1 { max-width: 18ch; }
.guide__head p { max-width: 62ch; color: var(--ink-soft); font-size: 1.08rem; }

.picker-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .8rem;
    padding: 1.2rem 1.4rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-alt);
}
.picker-bar label { font-size: .92rem; font-weight: 600; }

.field {
    font: inherit;
    font-size: .95rem;
    padding: .55rem .7rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--ink);
}

.server-url {
    font-family: var(--mono);
    font-size: .92rem;
    padding: .55rem .75rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    color: var(--blue);
    flex: 1 1 17rem;
    min-width: 0;
    overflow-x: auto;
    white-space: nowrap;
}

.hint { flex-basis: 100%; margin: 0; font-size: .86rem; color: var(--ink-soft); }

.apps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .9rem; }

.app {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .9rem 1.1rem;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.app span { font-weight: 500; font-size: .96rem; }

.prose { max-width: 66ch; }
.prose h3 { margin-top: 2rem; }
.prose p { color: var(--ink-soft); }

.callout {
    background: rgba(253, 199, 0, .12);
    border-left: 4px solid var(--yellow);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: .9rem 1.1rem;
    margin: 1.2rem 0;
    color: var(--ink);
    font-size: .95rem;
}

/* --------------------------------------------------------- responsive */

@media (max-width: 940px) {
    .hero { grid-template-columns: 1fr; }
    .hero h1 { max-width: 20ch; }
    .donate__inner { grid-template-columns: 1fr; gap: 1.6rem; }
    .footer__grid { grid-template-columns: 1fr 1fr; gap: 1.8rem; }
    .masthead { position: static; }
}

@media (max-width: 680px) {
    body { font-size: 16px; }
    .masthead__inner { min-height: 64px; padding-block: .7rem; }
    .entry { grid-template-columns: 2.4rem 1fr; row-gap: .7rem; }
    .entry .status { grid-column: 2; justify-self: start; }
    .entry .btn { grid-column: 2; justify-self: start; }
    .footer__grid { grid-template-columns: 1fr; }
    .register__foot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}

/* ------------------------------------------------------- page de statut */

.status-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.1rem;
}
.status-head h2 { margin: 0; font-size: 1.3rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.status-host { font-family: var(--mono); font-size: .82rem; font-weight: 400; color: var(--ink-soft); }

.uptime {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 1.1rem;
}
.uptime__cell { background: var(--surface); padding: .75rem .9rem; }
.uptime__n { display: block; font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }
.uptime__l { font-size: .82rem; color: var(--ink-soft); }

.ticks { display: flex; align-items: stretch; gap: 2px; height: 34px; }
.tick { flex: 1 1 0; min-width: 3px; border-radius: 2px; background: var(--line); }
.tick--online { background: #2f9e60; }
.tick--offline { background: #d1462f; }
[data-theme="dark"] .tick--online { background: #7bf1a8; }
[data-theme="dark"] .tick--offline { background: #ff6550; }

.ticks__legend {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: .45rem 0 0;
    font-size: .82rem;
    color: var(--ink-soft);
}

.status-sub { margin: 1.5rem 0 .6rem; font-size: 1rem; }

.incidents { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.incidents li {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .5rem 0;
    border-top: 1px solid var(--line);
}
.incidents__date { font-family: var(--mono); font-size: .84rem; color: var(--ink-soft); min-width: 9.5rem; }

/* ----------------------------------------------------- page d'instance */

.instance-head { padding-block: clamp(2.2rem, 5vw, 3.4rem); position: relative; z-index: 1; }
.instance-head h1 { color: #fff; margin-bottom: .7rem; display: flex; align-items: center; gap: .7rem; flex-wrap: wrap; }
.instance-back { margin: 0 0 .9rem; font-size: .9rem; }
.instance-back a { color: var(--on-blue-soft); }
.instance-back a:hover { color: #fff; }
.instance-state { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin: 0; }
.instance-state .status { background: rgba(255, 255, 255, .14); border-color: rgba(255, 255, 255, .3); color: #fff; }
.instance-note { color: var(--on-blue-soft); font-size: .94rem; }

.instance-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: clamp(1.6rem, 4vw, 3rem);
    align-items: start;
}

a.entry__country { color: var(--ink); }
a.entry__country:hover { color: var(--blue); text-decoration: underline; }

.instance-list { list-style: none; margin: 0; padding: 0; }
.instance-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
    padding: .55rem 0;
    border-top: 1px solid var(--line);
}
.instance-list li:first-child { border-top: 0; }
.instance-list a { color: var(--ink); font-weight: 500; }
.instance-list a:hover { color: var(--blue); }

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

/* ------------------------------------------------------ formulaire contact */

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
    gap: clamp(1.6rem, 4vw, 3rem);
    align-items: start;
}

.contact-form { max-width: 40rem; }

.contact-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

.field-block { margin-bottom: 1rem; }
.field-block label { display: block; font-weight: 600; font-size: .93rem; margin-bottom: .35rem; }
.field-opt { font-weight: 400; color: var(--ink-soft); }
.field-block .field { width: 100%; }
textarea.field { resize: vertical; min-height: 9rem; font-family: inherit; }

/* Champ leurre : hors écran, jamais rempli par un humain. */
.hp {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.notice {
    border-radius: var(--radius);
    padding: .9rem 1.1rem;
    margin-bottom: 1.4rem;
    font-size: .95rem;
    border-left: 4px solid var(--line);
}
.notice p { margin: 0 0 .4rem; }
.notice p:last-child { margin: 0; }
.notice--ok { background: rgba(123, 241, 168, .16); border-left-color: #2f9e60; }
.notice--error { background: rgba(255, 101, 80, .12); border-left-color: var(--red); }

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

@media (max-width: 560px) {
    .contact-row { grid-template-columns: 1fr; gap: 0; }
}

/* ==========================================================================
   Affichage sur petit écran.
   Regroupé ici pour être lisible d'un seul tenant plutôt qu'éparpillé.
   ========================================================================== */

@media (max-width: 680px) {
    /* ~32 px de chaque côté : respiration nette sur smartphone. */
    :root { --gutter: 2rem; }

    /* Rien ne doit déborder horizontalement : les adresses de serveurs et les
       domaines sont les seuls contenus insécables du site. */
    .mono, .server-url, .entry__host, .board__host, .status-host, .incidents__date {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    /* En-tête : la barre de navigation défile latéralement plutôt que de
       s'empiler sur trois lignes ou de déborder. */
    .masthead__inner { gap: .75rem; }
    .brand__mark { width: 30px; height: 30px; }
    .brand__name { font-size: 1.02rem; }
    .brand__sub { display: none; }

    .nav { gap: 1.1rem; }
    .nav a { font-size: .92rem; padding-bottom: .35rem; }

    .tools { gap: .4rem; }

    /* Hero : le titre respire, les boutons occupent toute la largeur. */
    .hero { padding-block: 2.6rem 2.8rem; gap: 1.8rem; }
    .hero h1 { max-width: none; font-size: clamp(1.85rem, 8.5vw, 2.4rem); }
    .hero__lead { font-size: 1.02rem; margin-bottom: 1.4rem; }
    .hero__actions { gap: .6rem; }
    .hero__actions .btn { flex: 1 1 100%; }
    .hero__trust { gap: .55rem 1.2rem; margin-top: 1.6rem; font-size: .86rem; }

    .board__row { grid-template-columns: 1.6rem 1fr; row-gap: .35rem; padding: .85rem 1.25rem; }
    .board__row .status { grid-column: 2; justify-self: start; }
    .board__head { padding: 1rem 1.25rem; }
    .board__note, .board__empty { padding: .9rem 1.25rem; }

    /* Sections et cartes */
    .section { padding: 2.6rem 0; }
    .section__head { margin-bottom: 1.6rem; }
    .section__head p { font-size: 1rem; }
    .card { padding: 1.4rem; }
    .cards { gap: 1rem; }

    .steps { gap: 1.2rem; }
    .step { grid-template-columns: 2.1rem 1fr; gap: .85rem; }
    .step::before { width: 2.1rem; height: 2.1rem; font-size: .95rem; }

    /* Registre : une ligne par instance, bouton pleine largeur */
    .entry { padding: 1.2rem; gap: .5rem 1rem; }
    .entry__country { font-size: 1.05rem; }
    .entry .btn { width: 100%; justify-content: center; margin-top: .3rem; }

    .faq__item { padding: 1.2rem 1.3rem; }

    .donate__inner { padding-block: 2.4rem; }
    .donate .btn { width: 100%; justify-content: center; }

    .footer { padding: 2.6rem 0 max(2rem, env(safe-area-inset-bottom, 0px)); }

    /* Guide : la barre de sélection passe en colonne */
    .picker-bar { padding: 1.2rem; gap: .6rem; }
    .picker-bar label { flex-basis: 100%; }
    .picker-bar .field { flex: 1 1 100%; }
    .server-url { flex: 1 1 100%; font-size: .85rem; }
    .picker-bar .btn { flex: 1 1 100%; justify-content: center; }
    .app { padding: 1rem 1.1rem; }

    /* Statut et instances */
    .uptime { grid-template-columns: 1fr 1fr; }
    .uptime__n { font-size: 1.2rem; }
    .status-head h2 { font-size: 1.15rem; }
    .ticks { height: 28px; }
    .incidents li { flex-direction: column; gap: .15rem; }
    .instance-head h1 { font-size: clamp(1.7rem, 8vw, 2.2rem); }
    .instance-grid { gap: 1.6rem; }

    /* Contact */
    .contact-form .btn { width: 100%; justify-content: center; }
    .notice { padding: 1rem 1.2rem; }
}

/* Écrans très étroits : on garde ~28 px, jamais moins. */
@media (max-width: 380px) {
    :root { --gutter: 1.75rem; }
    .uptime { grid-template-columns: 1fr; }
    .brand__name { font-size: .96rem; }
    .picker__button { padding: .38rem .5rem; }
}

/* Écrans tactiles : des cibles assez grandes pour le pouce. */
@media (pointer: coarse) {
    .btn { min-height: 44px; }
    .btn--small { min-height: 38px; }
    .nav a { padding-block: .5rem; }
    .picker__menu a, .picker__menu button { padding: .6rem .65rem; }
}

/* Instance en production dont la sonde n'a pas encore rendu de verdict. */
.status--checking { color: var(--ink-soft); }
.status--checking .status__dot {
    background: transparent;
    border: 1.5px solid currentColor;
    animation: blink 1.8s ease-in-out infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: .35; }
}

.entry__actions { display: flex; gap: .5rem; flex-wrap: wrap; }
@media (max-width: 680px) {
    .entry__actions { grid-column: 2; width: 100%; }
    .entry__actions .btn { flex: 1 1 auto; justify-content: center; }
}

/* ------------------------------------------------------------- mission */

.mission {
    background: var(--blue-deep);
    color: #fff;
    border-top: 1px solid rgba(255, 255, 255, .08);
}

.mission__inner { padding-block: clamp(2.8rem, 6vw, 4.2rem); }

.mission__kicker {
    margin: 0 0 .7rem;
    font-size: .82rem;
    font-weight: 600;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--teal);
}

.mission h2 { color: #fff; max-width: 22ch; margin-bottom: 1.4rem; }

.mission__body {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.6rem 2.6rem;
}
.mission__body p { margin: 0; color: var(--on-blue-soft); font-size: 1.02rem; }

.mission__stat {
    margin: 1.8rem 0 0;
    padding-top: 1.4rem;
    border-top: 1px solid rgba(255, 255, 255, .18);
    font-size: 1.05rem;
    font-weight: 600;
    color: #fff;
    max-width: 62ch;
}

.mission__note {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--blue);
    color: var(--ink);
    font-weight: 500;
    max-width: 58ch;
}

/* Taux de disponibilité : sur sa propre ligne, sous le statut et les boutons,
   pour ne pas écarter l'étiquette « en ligne » des actions. */
.uptime-badge {
    grid-column: 3 / -1;
    justify-self: end;
    margin-top: .1rem;
    font-size: .78rem;
    font-weight: 600;
    color: var(--ink-soft);
    white-space: nowrap;
}

.uptime-badge--light {
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 999px;
    padding: .2rem .65rem;
}

@media (max-width: 680px) {
    .entry__state { grid-column: 2; }
}

/* ------------------------------------------------- bouton de don flottant */

.donate-float {
    position: fixed;
    right: max(1.25rem, env(safe-area-inset-right, 0px));
    bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
    z-index: 45;
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    padding: .6rem 1rem;
    border-radius: 999px;
    background: var(--yellow);
    border: 1px solid var(--yellow);
    color: #26200a;
    font-size: .88rem;
    font-weight: 600;
    box-shadow: 0 10px 28px -16px rgba(8, 31, 74, .5);
    opacity: .9;
    transition: opacity .15s ease, background-color .15s ease;
    touch-action: none;
}
.donate-float:hover {
    opacity: 1;
    text-decoration: none;
    background: #ffd429;
    color: #26200a;
}
.donate-float svg { width: 17px; height: 17px; color: currentColor; flex: none; }
.donate-float.is-dragging { opacity: 1; box-shadow: 0 14px 34px -14px rgba(8, 31, 74, .6); }

@media (max-width: 680px) {
    .donate-float {
        right: .9rem;
        bottom: .9rem;
        padding: .6rem;
        gap: 0;
    }
    /* Sur téléphone le bouton se réduit à son icône et se déplace au doigt :
       il ne doit jamais masquer un bouton d'inscription. */
    .donate-float__label { display: none; }
    .donate-float svg { width: 19px; height: 19px; }
}

.footer__social { margin: 1.6rem 0 0; }
.footer__social a {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    font-size: .86rem;
    border-bottom: 0;
}
.footer__social svg { width: 17px; height: 17px; }

.brand__logo {
    height: 34px;
    width: auto;
    max-width: 180px;
    flex: none;
    display: block;
}
@media (max-width: 680px) { .brand__logo { height: 30px; max-width: 140px; } }

/* ---------------------------------------------- illustrations du guide */

.figure {
    margin: 0 0 1.8rem;
    max-width: 30rem;
}

.figure__svg {
    display: block;
    width: 100%;
    height: auto;
    background: var(--surface-alt);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
}

.figure figcaption {
    margin-top: .6rem;
    font-size: .88rem;
    color: var(--ink-soft);
}

.figure-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.6rem;
    margin-bottom: 1.8rem;
}
.figure-row .figure { margin-bottom: 0; }
.figure--wide { max-width: 34rem; }

/* Le schéma suit le thème : aucune couleur n'est écrite en dur. */
.fig-frame { fill: var(--surface); stroke: var(--line); stroke-width: 1.5; }
.fig-line { fill: none; stroke: var(--line); stroke-width: 1.5; }
.fig-soft { fill: var(--line); opacity: .55; }
.fig-faint { fill: var(--line); opacity: .35; }
.fig-field { fill: var(--surface); stroke: var(--blue); stroke-width: 1.5; }
.fig-dot { fill: var(--ink-soft); opacity: .5; }
.fig-fill { fill: var(--blue); }
.fig-fill-stroke { stroke: var(--surface); stroke-width: 3; stroke-linecap: round; }
.fig-accent { fill: var(--blue); }
.fig-accent-stroke { stroke: #fff; stroke-width: 1.8; stroke-linecap: round; }
.fig-halo { fill: none; stroke: var(--yellow); stroke-width: 2; stroke-dasharray: 4 4; }
.fig-text { fill: var(--blue); font-family: var(--mono); font-size: 13px; }

.fig-check { fill: none; stroke: var(--blue); stroke-width: 2; }
.fig-chevron { fill: none; stroke: var(--blue); stroke-width: 1.8; }
