:root {
  --bg: #f4f6f8; --surface: #ffffff; --text: #14212b; --muted: #5b6b78; --line: #dde3e8;
  --brand: #0b6e8a; --brand-ink: #ffffff; --brand-soft: #e3f2f6;
  --ok: #1d7a46; --ok-soft: #e4f4ea; --warn: #8a5a00; --warn-soft: #fdf3dc;
  --bad: #b3261e; --bad-soft: #fbe7e5; --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f171d; --surface: #17222a; --text: #e6edf2; --muted: #9aabb8; --line: #2a3843;
    --brand: #3bb3d3; --brand-ink: #06222b; --brand-soft: #143440;
    --ok: #5fd08f; --ok-soft: #133524; --warn: #f0c060; --warn-soft: #3a2e12;
    --bad: #ff8a80; --bad-soft: #3d1a18; color-scheme: dark;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--brand); }
h1 { font-size: 1.55rem; margin: 0 0 1rem; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 .8rem; }
code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

.top { display: flex; align-items: center; gap: 1.5rem; padding: .7rem 1.25rem; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.05rem; color: var(--text); text-decoration: none; margin: 0; }
.brand b { color: var(--brand); }
.logo { width: 22px; height: 22px; border-radius: 50% 50% 40% 40%; background: radial-gradient(circle at 35% 35%, #7fd6ea, var(--brand)); display: inline-block; }
.top nav { display: flex; gap: 1rem; flex: 1; }
.top nav a { color: var(--muted); text-decoration: none; padding: .25rem 0; border-bottom: 2px solid transparent; }
.top nav a[aria-current="page"], .top nav a:hover { color: var(--text); border-color: var(--brand); }
.who { display: flex; align-items: center; gap: .75rem; color: var(--muted); font-size: .9rem; margin: 0; }

.wrap { max-width: 1040px; margin: 0 auto; padding: 1.75rem 16px 4rem; }
.head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.head h1 { margin: 0; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; overflow-x: auto; }
.card.narrow { max-width: 560px; }
.card.empty { text-align: center; padding: 2.5rem 1.4rem; }
.card.highlight { border-color: var(--brand); background: var(--brand-soft); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

label { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
label.check { flex-direction: row; align-items: center; font-weight: 400; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem; min-width: 0; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 45%, transparent); outline-offset: 1px; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.row { display: flex; gap: 1rem; align-items: flex-end; flex-wrap: wrap; }
.row label { flex: 1 1 200px; }

.btn { display: inline-block; font: inherit; font-weight: 600; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: 8px; padding: .65rem 1.2rem; cursor: pointer; text-decoration: none; text-align: center; }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn-small { padding: .4rem .8rem; font-size: .85rem; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
.link.danger { color: var(--bad); }

.flash { padding: .7rem 1rem; border-radius: 8px; margin: 0 0 1rem; }
.flash-ok { background: var(--ok-soft); color: var(--ok); }
.flash-erreur { background: var(--bad-soft); color: var(--bad); }
.flash-alerte { background: var(--warn-soft); color: var(--warn); }

table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; }
th, td { padding: .6rem .5rem; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: 0; }
td.actions { display: flex; gap: .9rem; justify-content: flex-end; }
td.actions form { margin: 0; }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: .15rem .55rem; border-radius: 99px; white-space: nowrap; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-wait { background: var(--warn-soft); color: var(--warn); }
.tag-off { background: var(--bad-soft); color: var(--bad); }
input.copy { width: min(100%, 640px); font-family: ui-monospace, Menlo, monospace; font-size: .85rem; }

body.auth { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 2rem 1.75rem; }
.auth-card .brand { margin-bottom: 1.5rem; }
.code-input { font-size: 1.6rem; letter-spacing: .3em; text-align: center; font-family: ui-monospace, Menlo, monospace; }
.steps { padding-left: 1.2rem; }
.steps li { margin-bottom: .8rem; }
.qr { display: block; margin: .8rem auto; background: #fff; padding: 10px; border-radius: 8px; width: 220px; height: auto; max-width: 100%; }
.secret { word-break: break-all; font-size: .95rem; }
.codes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .5rem; padding: 0; list-style: none; }
.codes code { display: block; text-align: center; padding: .5rem; background: var(--bg); border-radius: 6px; font-size: 1.05rem; }

@media (max-width: 640px) {
  .top { gap: .6rem 1rem; }
  .who span { display: none; }
  td.actions { flex-direction: column; gap: .4rem; }
}

/* --- formulaire nouveau site --- */
.form-site .card h2 { margin-bottom: 1rem; }
.form-site .head h2 { margin: 0; }
.regions, .plugins { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.choice { flex-direction: row; align-items: center; gap: .6rem; font-weight: 500; border: 1px solid var(--line); border-radius: 8px; padding: .65rem .9rem; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.choice:has(input:disabled) { cursor: default; }
.choice small { display: block; font-weight: 400; }
.flag { font-size: 1.2rem; }
.dns-state { margin: 1rem 0 0; }
.dns-state ul { margin: .5rem 0; padding-left: 1.2rem; }
.dns-state label.check { font-weight: 600; margin-top: .5rem; }
.submit-bar { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.btn:disabled { opacity: .6; cursor: wait; }
ul.plain { list-style: none; padding: 0; margin: 0; display: grid; gap: .3rem; }

/* --- suivi --- */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 1.25rem; }
.progress { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.progress li { padding-left: 1.9rem; position: relative; }
.progress li::before { position: absolute; left: 0; top: 0; width: 1.3rem; text-align: center; }
.st-todo { color: var(--muted); }
.st-todo::before { content: '○'; }
.st-run { font-weight: 600; }
.st-run::before { content: '◐'; color: var(--brand); animation: spin 1.2s linear infinite; }
.st-ok::before { content: '✓'; color: var(--ok); font-weight: 700; }
.st-bad { color: var(--bad); font-weight: 600; }
.st-bad::before { content: '✕'; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .st-run::before { animation: none; } }
.recap { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; margin: 0; }
.recap dt { color: var(--muted); font-size: .88rem; }
.recap dd { margin: 0; }
.log { list-style: none; padding: 0; margin: 0; font-family: ui-monospace, Menlo, monospace; font-size: .82rem; display: grid; gap: .2rem; max-height: 420px; overflow-y: auto; }
.log time { color: var(--muted); }
.lv-erreur { color: var(--bad); }
.lv-ok { color: var(--ok); }
.checks { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .45rem; }
.checks li { padding-left: 1.9rem; position: relative; }
.checks li::before { position: absolute; left: 0; width: 1.3rem; text-align: center; }
