:root {
  --bg: #0e0b07;
  --bg-2: #17120b;
  --card: #1c160e;
  --line: rgba(245, 181, 46, 0.18);
  --line-soft: rgba(255, 255, 255, 0.07);
  --gold: #f5b52e;
  --gold-2: #e0891f;
  --text: #f4efe6;
  --muted: #a89c88;
  --ok: #4ade80;
  --warn: #fbbf24;
  --bad: #f87171;
  --blue: #60a5fa;
  --radius: 14px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, rgba(245, 181, 46, 0.09), transparent 60%), var(--bg);
  color: var(--text);
  font: 15px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; }
h1, h2 { margin: 0 0 .4em; line-height: 1.2; }
h1 { font-size: clamp(26px, 4vw, 34px); letter-spacing: -.01em; }
h2 { font-size: 17px; }
.mono { font-family: var(--mono); }
.upper { text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.pre { white-space: pre-wrap; margin: 0; }

/* ─── Barre du haut ─────────────────────────────── */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(14, 11, 7, 0.85);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 17px; }
.brand strong { color: var(--gold); }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { text-decoration: none; padding: 7px 12px; border-radius: 8px; color: var(--muted); }
.nav a:hover { color: var(--text); background: var(--line-soft); }
.nav a.on { color: var(--gold); background: rgba(245, 181, 46, 0.1); }
.me { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.me form { margin: 0; }
.me-name { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.me-name img, .avatar-fallback { border-radius: 50%; width: 28px; height: 28px; }
.avatar-fallback { display: grid; place-items: center; background: var(--gold); color: #1c160e; font-weight: 700; }

.wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 32px 24px 48px; flex: 1; }
.foot { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 20px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line-soft); }
.foot img { border-radius: 6px; }

/* ─── Boutons ───────────────────────────────────── */
.btn, .btn-ghost, .btn-discord {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  border-radius: 10px; padding: 10px 18px; border: 1px solid transparent; white-space: nowrap;
}
.btn { background: linear-gradient(135deg, #ffd25a, var(--gold-2)); color: #1c160e; }
.btn:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; color: var(--muted); border-color: var(--line-soft); padding: 8px 14px; }
.btn-ghost:hover { color: var(--text); border-color: var(--line); }
.btn-danger { background: var(--bad); color: #2a0b0b; }
.btn-discord { background: #5865f2; color: #fff; padding: 13px 24px; font-size: 16px; }
.btn-discord:hover { background: #4752c4; }
.link { color: var(--gold); text-decoration: none; font-size: 14px; }
.link:hover { text-decoration: underline; }

/* ─── Accueil ───────────────────────────────────── */
.hero { text-align: center; padding: 56px 0 24px; display: flex; flex-direction: column; align-items: center; }
.hero-logo { filter: drop-shadow(0 0 40px rgba(245, 181, 46, 0.35)); margin-bottom: 18px; }
.eyebrow { color: var(--gold); font-weight: 700; font-size: 12px; letter-spacing: .22em; text-transform: uppercase; margin: 0 0 6px; }
.lead { color: var(--muted); font-size: 17px; max-width: 480px; margin: 0 0 28px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 18px; }
.dev-link { margin-top: 14px; color: var(--warn); font-size: 13px; }

/* ─── Blocs ─────────────────────────────────────── */
.page-head { margin-bottom: 24px; }
.page-head.row { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.card {
  background: linear-gradient(180deg, rgba(245, 181, 46, 0.045), rgba(245, 181, 46, 0.015)), var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin-bottom: 20px;
}
.card.narrow { max-width: 560px; margin-left: auto; margin-right: auto; }
.card.center { text-align: center; }
.card.danger { border-color: rgba(248, 113, 113, 0.35); }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 20px; }
.grid-2 .card { margin-bottom: 0; }

.tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-soft); color: var(--muted); }
.tag.gold { color: var(--gold); border-color: var(--line); background: rgba(245, 181, 46, 0.08); }
.tag.blue { color: var(--blue); border-color: rgba(96, 165, 250, 0.3); background: rgba(96, 165, 250, 0.08); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; display: flex; flex-direction: column; }
.stat-num { font-size: 32px; font-weight: 800; color: var(--gold); line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--muted); font-size: 13px; }

.tile {
  display: flex; flex-direction: column; gap: 4px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  transition: border-color .15s, transform .15s;
}
.tile:hover { border-color: var(--gold); transform: translateY(-2px); }
.tile-icon { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #ffd25a, var(--gold-2)); color: #1c160e; font-weight: 800; font-size: 20px; margin-bottom: 8px; }
.tile-title { font-weight: 700; font-size: 16px; }
.tile-text { color: var(--muted); font-size: 14px; }

/* ─── Messages ──────────────────────────────────── */
.flash { padding: 12px 16px; border-radius: 10px; margin-bottom: 20px; border: 1px solid; }
.flash.ok { color: var(--ok); border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.08); }
.flash.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.08); }
.flash.bad { color: var(--bad); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.08); }
.empty { color: var(--muted); text-align: center; padding: 28px 0; margin: 0; }

/* ─── Tableaux ──────────────────────────────────── */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; padding: 10px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 6px; border-bottom: 1px solid var(--line-soft); }
.table tr:last-child td { border-bottom: 0; }
.table a { color: var(--gold); text-decoration: none; }
.table a:hover { text-decoration: underline; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 99px; white-space: nowrap; }
.pill.ok { color: var(--ok); background: rgba(74, 222, 128, 0.12); }
.pill.warn { color: var(--warn); background: rgba(251, 191, 36, 0.12); }
.pill.bad { color: var(--bad); background: rgba(248, 113, 113, 0.12); }
.pill.neutral { color: var(--muted); background: var(--line-soft); }
.pager { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 16px; color: var(--muted); font-size: 14px; }
.pager a { color: var(--gold); text-decoration: none; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.filters a { text-decoration: none; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: 14px; border: 1px solid var(--line-soft); }
.filters a.on { color: var(--gold); border-color: var(--line); background: rgba(245, 181, 46, 0.08); }

/* ─── Formulaires ───────────────────────────────── */
input, textarea {
  font: inherit; color: var(--text); width: 100%;
  background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px;
}
input:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 181, 46, 0.15); }
input::placeholder, textarea::placeholder { color: #6f6555; }
.search { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.search input { flex: 1; min-width: 220px; }
.form h2 { color: var(--gold); font-size: 13px; letter-spacing: .14em; text-transform: uppercase; margin: 22px 0 12px; }
.form h2:first-of-type { margin-top: 0; }
.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 14px; }
.fields .field { margin: 0; }
.field.wide { grid-column: 1 / -1; }
fieldset.field { border: 0; padding: 0; }
fieldset legend { padding: 0; margin-bottom: 6px; }
.choices { display: flex; gap: 8px; flex-wrap: wrap; }
.choice { display: flex; align-items: center; gap: 8px; cursor: pointer; border: 1px solid var(--line-soft); border-radius: 10px; padding: 9px 14px; color: var(--text); font-weight: 500; font-size: 14px; }
.choice input { width: auto; accent-color: var(--gold); }
.choice:has(input:checked) { border-color: var(--gold); background: rgba(245, 181, 46, 0.08); }
.decision { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin-bottom: 14px; }
.choice.big { padding: 14px 16px; align-items: flex-start; }
.choice.big span { display: flex; flex-direction: column; }
.choice.big small { color: var(--muted); font-size: 12px; }
.choice.big.ok:has(input:checked) { border-color: var(--ok); background: rgba(74, 222, 128, 0.08); }
.choice.big.bad:has(input:checked) { border-color: var(--bad); background: rgba(248, 113, 113, 0.08); }
.signed { color: var(--muted); font-size: 14px; padding: 12px 0; border-top: 1px solid var(--line-soft); margin-top: 6px; }
.signed strong { color: var(--text); }
.actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.verify-form { display: grid; grid-template-columns: 1.4fr 1fr auto; gap: 14px; align-items: end; }
.verify-form .field { margin: 0; }

/* ─── Détail certificat / vérification ──────────── */
.dl { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; margin: 0; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.state-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid; }
.state-banner.ok { color: var(--ok); border-color: rgba(74, 222, 128, 0.35); background: rgba(74, 222, 128, 0.07); }
.state-banner.warn { color: var(--warn); border-color: rgba(251, 191, 36, 0.35); background: rgba(251, 191, 36, 0.07); }
.state-banner.bad { color: var(--bad); border-color: rgba(248, 113, 113, 0.35); background: rgba(248, 113, 113, 0.07); }
.state-banner span { color: var(--text); opacity: .85; }
.state-dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 12px currentColor; }
.code-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.code-card p { margin: 0; }
.code { font-family: var(--mono); font-size: 30px; font-weight: 800; letter-spacing: .25em; color: var(--gold); background: var(--bg-2); border: 1px dashed var(--line); padding: 8px 18px; border-radius: 10px; }
.row-actions { display: flex; gap: 10px; }

.result { display: flex; gap: 18px; align-items: flex-start; padding: 22px; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid; }
.result h2 { font-size: 20px; }
.result p { margin: 0; color: var(--text); }
.result-icon { flex: none; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; font-weight: 800; color: #10170f; }
.result.ok { border-color: rgba(74, 222, 128, 0.4); background: rgba(74, 222, 128, 0.07); }
.result.ok h2 { color: var(--ok); }
.result.ok .result-icon { background: var(--ok); }
.result.warn { border-color: rgba(251, 191, 36, 0.4); background: rgba(251, 191, 36, 0.07); }
.result.warn h2 { color: var(--warn); }
.result.warn .result-icon { background: var(--warn); }
.result.bad { border-color: rgba(248, 113, 113, 0.4); background: rgba(248, 113, 113, 0.07); }
.result.bad h2 { color: var(--bad); }
.result.bad .result-icon { background: var(--bad); }

@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding: 10px 16px; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; }
  .hide-sm { display: none; }
  .wrap { padding: 24px 16px 40px; }
  .verify-form { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 100px 1fr; }
}

/* ─── Rendez-vous ───────────────────────────────── */
.badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 11px; font-weight: 800; margin-left: 4px; vertical-align: 1px; }
.count { display: inline-block; min-width: 20px; text-align: center; font-size: 12px; font-weight: 700; padding: 0 6px; border-radius: 99px; background: var(--line-soft); margin-left: 4px; }
.choices.types { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-bottom: 4px; }
.choice.big:has(input:checked) { border-color: var(--gold); background: rgba(245, 181, 46, 0.08); }
.rdv-list { list-style: none; margin: 0; padding: 0; }
.rdv-list li + li { border-top: 1px solid var(--line-soft); }
.rdv-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 4px; text-decoration: none; }
.rdv-row:hover .rdv-main strong { color: var(--gold); }
.rdv-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.appt-card { display: flex; flex-direction: column; gap: 10px; border-color: rgba(74, 222, 128, 0.35); }
.appt-when { display: flex; flex-direction: column; gap: 2px; }
.appt-date { font-size: 22px; display: block; }
.appt-date::first-letter { text-transform: uppercase; }
.appt-note { margin: 0; padding: 10px 14px; border-left: 3px solid var(--gold); background: var(--bg-2); border-radius: 0 8px 8px 0; }
.cta-card { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-color: var(--gold); }
.cta-card p { margin: 0; max-width: 620px; }
.timeline { list-style: none; margin: 0; padding: 0; }
.tl-item { position: relative; padding: 0 0 18px 26px; }
.tl-item::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: -2px; width: 2px; background: var(--line-soft); }
.tl-item.last::before { display: none; }
.tl-item.last { padding-bottom: 0; }
.tl-dot { position: absolute; left: 0; top: 5px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted); }
.tl-item.ok .tl-dot { background: var(--ok); }
.tl-item.warn .tl-dot { background: var(--warn); }
.tl-item.bad .tl-dot { background: var(--bad); }
.tl-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tl-body p { margin: 6px 0 0; font-size: 14px; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.mini-list a { color: var(--gold); text-decoration: none; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 340px; }
.table td a:not(.mono) { color: var(--text); }
form.card .field { margin-bottom: 14px; }

/* ─── Dossiers médicaux ─────────────────────────── */
select { font: inherit; color: var(--text); width: 100%; background: var(--bg-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: 10px 12px; }
select:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(245, 181, 46, 0.15); }
.field small { font-weight: 400; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 10px; margin: 6px 0 4px; cursor: pointer; font-size: 14px; }
.check input { width: auto; margin-top: 3px; accent-color: var(--gold); }
.check.inline { padding: 8px 12px; margin: 0; align-items: center; }
.check.inline input { margin-top: 0; }
.eyebrow-red { color: var(--bad); }
.cta-card.soft { border-color: var(--line); }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.rec-card { display: flex; flex-direction: column; gap: 14px; padding: 18px; border-radius: 12px; border: 1px solid var(--line-soft); background: var(--bg-2); text-decoration: none; transition: border-color .15s, transform .15s; }
.rec-card:hover { border-color: var(--gold); transform: translateY(-2px); }
.rec-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.rec-top > div { display: flex; flex-direction: column; }
.rec-name { font-size: 17px; }
.rec-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: 14px; }
.rec-fields > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lbl { color: var(--muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.rec-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; }
.rec-flags { display: flex; gap: 6px; }
.rec-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rec-detail .box { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 10px; border: 1px solid var(--line-soft); background: var(--bg-2); align-items: flex-start; }
.rec-detail .box.wide { grid-column: span 1; }
.rec-detail .box p { margin: 0; }
.clamp.inline { display: inline; -webkit-line-clamp: unset; max-width: none; }
@media (max-width: 760px) { .rec-detail, .rec-fields { grid-template-columns: 1fr; } }

/* ─── Consignes du rendez-vous ─── */
.consignes { border-color: rgba(255, 200, 61, .35); background: linear-gradient(180deg, rgba(255, 200, 61, .07), transparent); }
.form .consignes { margin: 26px 0 8px; }
.consignes-list { list-style: none; padding: 0; margin: 12px 0 6px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.consignes-list li { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--line-soft); border-radius: 10px; }
.consignes-list li > span { font-size: 20px; line-height: 1.2; }
.consignes-list strong { display: block; }
.consignes-list small { display: block; opacity: .75; margin-top: 2px; }
.consignes-list .ppa-only { border-color: rgba(255, 200, 61, .5); }
.consignes-check { margin-top: 14px; font-weight: 600; }
.center-actions { justify-content: center; margin-top: 18px; flex-wrap: wrap; }
.search select { flex: 1; min-width: 220px; width: auto; }
