/* =====================================================================
   Dental 3D Belgique — Quiz Concours (Dentex 2026)
   Feuille de style unique · mobile-first · sans dépendance externe.
   Palette : bleu profond, blanc, gris clair, accents or & turquoise.
   ===================================================================== */

:root {
  --navy: #0b2545;
  --navy-700: #13315c;
  --navy-600: #1b3a63;
  --turq: #0fb5ba;
  --turq-600: #0c9498;
  --gold: #c9a227;
  --gold-600: #b08e1f;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #1f2d3d;
  --muted: #64748b;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(11, 37, 69, 0.10);
  --shadow-sm: 0 4px 14px rgba(11, 37, 69, 0.08);
  --maxw: 600px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--turq-600); }

/* ---------- Layout ---------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 20px 18px 40px;
  flex: 1;
}
.container--wide { max-width: 1120px; }

/* ---------- Top bar ---------- */
.topbar {
  background: var(--navy);
  padding: 16px;
  text-align: center;
  border-bottom: 4px solid var(--turq);
}
.topbar img { width: 132px; max-width: 52%; margin: 0 auto; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-700) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 30px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}
.hero .eyebrow {
  color: var(--turq);
  font-weight: 700;
  letter-spacing: .5px;
  font-size: 13px;
  text-transform: uppercase;
  margin: 0 0 10px;
}
.hero h1 { margin: 0 0 12px; font-size: 26px; line-height: 1.2; font-weight: 800; }
.hero p { margin: 0 auto; max-width: 460px; color: #d6e0ec; font-size: 16px; }
.hero .badges { margin-top: 18px; display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pill {
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; font-size: 13px; font-weight: 600;
  padding: 7px 12px; border-radius: 999px;
}
.pill--gold { background: var(--gold); border-color: var(--gold); color: #1b1304; }

/* ---------- Sections ---------- */
.section-title {
  font-size: 18px; font-weight: 800; color: var(--navy);
  margin: 28px 4px 14px;
}
.section-sub { color: var(--muted); font-size: 14px; margin: 0 4px 16px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px;
}

/* ---------- Theme grid ---------- */
.theme-grid { display: grid; gap: 14px; }
.theme-card {
  display: flex; align-items: center; gap: 14px;
  text-align: left; width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 5px solid var(--turq);
  border-radius: var(--radius);
  padding: 18px;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  box-shadow: var(--shadow-sm);
}
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-left-color: var(--gold); }
.theme-card:focus-visible { outline: 3px solid var(--turq); outline-offset: 2px; }
.theme-card .ico {
  flex: 0 0 46px; width: 46px; height: 46px; border-radius: 12px;
  background: rgba(15, 181, 186, .12); color: var(--turq-600);
  display: grid; place-items: center; font-size: 22px;
}
.theme-card .tc-body { flex: 1; }
.theme-card h3 { margin: 0 0 3px; font-size: 16px; color: var(--navy); font-weight: 700; }
.theme-card p { margin: 0; font-size: 13px; color: var(--muted); }
.theme-card .chev { color: var(--muted); font-size: 22px; }
.theme-card .qcount { font-size: 12px; color: var(--turq-600); font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: inherit; font-size: 16px; font-weight: 700;
  padding: 15px 22px; border-radius: var(--radius-sm);
  border: 2px solid transparent; cursor: pointer; text-decoration: none;
  transition: filter .12s ease, transform .05s ease, background .12s ease;
  min-height: 52px; line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--turq); color: #fff; }
.btn-primary:hover { background: var(--turq-600); }
.btn-gold { background: var(--gold); color: #1b1304; }
.btn-gold:hover { background: var(--gold-600); }
.btn-navy { background: var(--navy); color: #fff; }
.btn-navy:hover { background: var(--navy-700); }
.btn-ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 12px; margin-top: 10px; }
.btn-row .btn { flex: 1; }

/* ---------- Progress ---------- */
.progress-wrap { margin: 6px 0 22px; }
.progress-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); margin-bottom: 8px; font-weight: 600; }
.progress { height: 10px; background: #e6ebf2; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--turq), var(--gold)); border-radius: 999px; transition: width .35s ease; }

/* ---------- Question ---------- */
.q-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.q-image { width: 100%; max-height: 260px; object-fit: cover; background: #eef2f6; }
.q-body { padding: 22px; }
.q-text { font-size: 19px; font-weight: 700; color: var(--navy); margin: 0 0 18px; line-height: 1.4; }
.options { display: grid; gap: 12px; }
.option {
  display: flex; align-items: center; gap: 13px;
  border: 2px solid var(--line); border-radius: var(--radius-sm);
  padding: 15px 16px; cursor: pointer; background: #fff;
  transition: border-color .12s ease, background .12s ease;
  font-size: 15px;
}
.option:hover { border-color: var(--turq); }
.option .mark {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  border: 2px solid #cbd5e1; display: grid; place-items: center; transition: all .12s ease;
}
.option.selected { border-color: var(--turq); background: rgba(15, 181, 186, .07); }
.option.selected .mark { border-color: var(--turq); background: var(--turq); }
.option.selected .mark::after { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #fff; }
.option .opt-letter { font-weight: 800; color: var(--turq-600); margin-right: 2px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; color: var(--navy); margin-bottom: 6px; }
.form-group .req { color: var(--red); }
.form-group .opt { color: var(--muted); font-weight: 500; }
.input {
  width: 100%; font-family: inherit; font-size: 16px; color: var(--text);
  padding: 14px 14px; border: 2px solid var(--line); border-radius: var(--radius-sm);
  background: #fff; transition: border-color .12s ease;
}
.input:focus { outline: none; border-color: var(--turq); }
.input.invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: 13px; margin-top: 5px; display: none; }
.field-error.show { display: block; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.consent {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px; margin: 4px 0 6px; font-size: 13.5px; color: var(--muted);
}
.consent input { width: 22px; height: 22px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--turq); }
.consent a { color: var(--turq-600); }

/* ---------- Result ---------- */
.result-hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-700) 100%);
  color: #fff; border-radius: var(--radius); padding: 30px 24px; text-align: center; box-shadow: var(--shadow);
}
.result-hero .emoji { font-size: 44px; }
.result-hero h1 { margin: 8px 0 4px; font-size: 24px; }
.result-hero .theme { color: #cbd5e1; font-size: 14px; margin: 0; }
.discount-badge {
  margin: 22px auto 6px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16); border-radius: 18px; padding: 20px;
}
.discount-badge .lbl { font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: #9fb3c8; }
.discount-badge .big { font-size: 64px; font-weight: 800; line-height: 1; }
.discount-badge .big span { font-size: 34px; }
.score-line { color: #cbd5e1; font-size: 14px; margin-top: 6px; }
.promo-box {
  margin: 18px auto 0; background: var(--gold); color: #1b1304; border-radius: 14px; padding: 16px 18px; max-width: 320px;
}
.promo-box .lbl { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.promo-box .code { font-size: 28px; font-weight: 800; letter-spacing: 3px; }
.validity { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; margin-top: 18px; font-size: 15px; color: var(--text); text-align: center; }
.validity strong { color: var(--navy); }

/* ---------- Helpers ---------- */
.center { text-align: center; }
.muted { color: var(--muted); }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.hidden { display: none !important; }
.spinner {
  width: 34px; height: 34px; border: 4px solid var(--line); border-top-color: var(--turq);
  border-radius: 50%; animation: spin .8s linear infinite; margin: 30px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.notice { padding: 14px 16px; border-radius: var(--radius-sm); font-size: 14px; margin: 12px 0; }
.notice-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.notice-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.notice-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 22px 16px 30px; color: var(--muted); font-size: 12.5px; }
.site-footer a { color: var(--turq-600); text-decoration: none; }

/* =====================================================================
   ADMIN
   ===================================================================== */
.admin-login { max-width: 380px; margin: 8vh auto 0; }
.admin-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--navy); color: #fff; padding: 14px 18px;
}
.admin-header .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.admin-header .brand img { width: 38px; }
.admin-header .who { font-size: 13px; color: #cbd5e1; }

.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 18px 0; }
.tab { padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 600; font-size: 14px; color: var(--navy); }
.tab.active { background: var(--navy); color: #fff; border-color: var(--navy); }

.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 16px; box-shadow: var(--shadow-sm); }
.stat .n { font-size: 28px; font-weight: 800; color: var(--navy); }
.stat .l { font-size: 13px; color: var(--muted); }

.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin-bottom: 14px; }
.filters .form-group { margin: 0; }
.filters .input, .filters select { min-height: 44px; padding: 9px 12px; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 720px; }
table.data th, table.data td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.data th { background: #f8fafc; color: var(--navy); font-weight: 700; position: sticky; top: 0; }
table.data tr:hover td { background: #f8fbfc; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.badge-d20 { background: #e0f2fe; color: #075985; }
.badge-d25 { background: #cffafe; color: #155e63; }
.badge-d30 { background: #dcfce7; color: #166534; }
.badge-d35 { background: #fef9c3; color: #854d0e; }
.badge-d40 { background: #fde68a; color: #7c2d12; }
.badge-on { background: #dcfce7; color: #166534; }
.badge-off { background: #f1f5f9; color: #64748b; }

.modal-backdrop { position: fixed; inset: 0; background: rgba(11,37,69,.55); display: grid; place-items: center; padding: 18px; z-index: 50; }
.modal { background: #fff; border-radius: var(--radius); max-width: 640px; width: 100%; max-height: 88vh; overflow: auto; padding: 24px; }
.modal h3 { margin: 0 0 12px; color: var(--navy); }
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 6px 12px; font-size: 14px; }
.kv .k { color: var(--muted); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 13px 20px; border-radius: 12px;
  box-shadow: var(--shadow); font-size: 14px; z-index: 60; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; max-width: 90vw;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.err { background: var(--red); }

textarea.input { resize: vertical; min-height: 120px; font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 13px; }

/* ---------- Larger screens ---------- */
@media (min-width: 560px) {
  .hero h1 { font-size: 30px; }
  .theme-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 720px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); }
}
