@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Poppins"; src: url("fonts/Poppins-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }

:root {
  --dark: #1e2226;
  --red: #c4262e;
  --gold: #d6a24e;
  --bg: #eef0f2;
  --surface: #ffffff;
  --ink: #1e2226;
  --muted: #5d646c;
  --line: #dde1e5;
  --ok: #1f7a4d;
  --ok-bg: #e5f3ea;
  --bad: #a3261f;
  --bad-bg: #fbe8e6;
  --radius: 12px;
  --title: "Poppins", "Montserrat", system-ui, sans-serif;
  --text: "Open Sans", "Noto Sans", "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--text);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--red); }

/* ---------- Barre du haut ---------- */
.topbar { background: var(--dark); color: #fff; border-bottom: 4px solid var(--red); }
.topbar__inner {
  max-width: 1180px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 22px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand img { height: 38px; width: auto; display: block; }
.brand__word { font: 700 24px/1 var(--title); letter-spacing: -.02em; }
.brand__word b { color: var(--red); font-weight: 700; }
.crumbs { font-size: 14px; color: rgba(255,255,255,.7); }
.crumbs a { color: #fff; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-hidden] { margin: 0 8px; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 56px; }

.status {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-radius: 10px; font-size: 15px; margin-bottom: 18px;
}
.status svg { flex: none; }
.status--valide { background: var(--ok-bg); color: var(--ok); }
.status--revoque, .status--expire { background: var(--bad-bg); color: var(--bad); }

/* =====================================================================
   Diplôme — conçu sur une base de 1123 × 794 (A4 paysage à 96 dpi).
   Toutes les tailles sont en fraction de la largeur (--u) : le rendu est
   identique à l'écran, sur mobile et à l'impression.
   ===================================================================== */
.diploma-wrap { margin: 0; }
.diploma {
  container-type: inline-size;
  width: 100%;
  aspect-ratio: 1123 / 794;
  position: relative;
  box-shadow: 0 2px 4px rgba(0,0,0,.06), 0 24px 48px -20px rgba(20,24,28,.35);
  overflow: hidden;
  background: #fff;
}
.dp { --u: calc(100cqw / 1123); position: absolute; inset: 0; color: var(--dark); }
.dp > * { position: absolute; }
.dp-bg { inset: 0; width: 100%; height: 100%; }


.dp-stamp {
  left: 50%; top: 47%; transform: translate(-50%, -50%) rotate(-14deg);
  font: 700 calc(84 * var(--u))/1 var(--title); letter-spacing: .14em;
  color: var(--red); border: calc(7 * var(--u)) solid var(--red); border-radius: calc(14 * var(--u));
  padding: calc(10 * var(--u)) calc(34 * var(--u)); opacity: .82; background: rgba(255,255,255,.55);
}

/* ---------- Actions + détails ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 10px;
  font: 600 14px/1 var(--text);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; text-decoration: none; transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--dark); }
.btn--primary { background: var(--red); border-color: var(--red); color: #fff; }
.btn--primary:hover { background: #a81f26; border-color: #a81f26; }
.btn--ghost { padding: 6px 10px; font-size: 13px; }
.btn[data-done]::after { content: " ✓"; }

.details {
  margin-top: 26px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 28px; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 28px;
}
.details h2 { grid-column: 1 / -1; margin: 0; font: 600 18px/1.3 var(--title); }
.details dt { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.details dd { margin: 3px 0 0; font-weight: 600; }
.details dd code { font: 600 15px ui-monospace, Menlo, Consolas, monospace; }
.details .full { grid-column: 1 / -1; }
.details .desc { font-weight: 400; color: var(--muted); }
.skills { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.skills li {
  font-size: 13px; font-weight: 400; padding: 4px 11px; border-radius: 999px;
  background: #f6f1f1; color: #7d1a20; border: 1px solid #ecd6d7;
}

/* ---------- Pages simples ---------- */
.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 40px 44px; max-width: 760px;
}
.eyebrow { margin: 0 0 6px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--red); }
.panel h1 { font: 600 34px/1.15 var(--title); margin: 0 0 12px; }
.panel h3 { font: 600 17px/1.3 var(--title); margin: 28px 0 8px; }
.panel p.lead { color: var(--muted); margin: 0 0 24px; }
.verify { display: flex; gap: 10px; flex-wrap: wrap; }
.verify input {
  flex: 1 1 300px; min-width: 0; text-transform: uppercase;
  font: 15px ui-monospace, Menlo, Consolas, monospace;
  padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fafbfc;
}
.verify input::placeholder { text-transform: none; }
.verify input:focus { outline: 2px solid #f1c3c5; border-color: var(--red); }
.hint { font-size: 13px; color: var(--muted); margin-top: 10px; }
.error { color: var(--bad); font-size: 14px; margin-top: 10px; min-height: 1.4em; }
.req { padding-left: 20px; }
.req li { margin-bottom: 6px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.sitefoot { max-width: 1180px; margin: 0 auto; padding: 0 20px 40px; font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .wrap { padding: 18px 12px 40px; }
  .panel { padding: 28px 20px; }
  .details { padding: 20px; }
  .brand__word { font-size: 21px; }
}

/* ---------- Impression / PDF : le diplôme seul, en A4 paysage ---------- */
@media print {
  @page { size: A4 landscape; margin: 0; }
  html, body { background: #fff; width: 297mm; height: 210mm; }
  body > *:not(main), .wrap > *:not(.diploma-wrap) { display: none !important; }
  .wrap { padding: 0; max-width: none; }
  .diploma { width: 297mm; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
