/* Mini-site check-up OuiLive. Téléphone d'abord, utilisable dès 320 px. */
:root {
  --bg: #fbf8f1;
  --card: #ffffff;
  --ink: #1b1d21;
  --ink2: #4d525b;
  --line: #ddd6c6;
  --soft: #f2ede1;
  --accent: #8a5f00;
  --accent-ink: #ffffff;
  --accent-soft: #f6ead0;
  --ok: #1f7a3a;
  --bad: #b3261e;
  --focus: #1b5fd1;
  --d-LIVE: #2f6fd6;
  --d-T: #9a6d00;
  --d-I: #23863a;
  --d-M: #7d4fd1;
  --d-E: #c4472a;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --card: #1d2026;
    --ink: #eef0f3;
    --ink2: #b4bac4;
    --line: #353a43;
    --soft: #262a31;
    --accent: #e0b44c;
    --accent-ink: #1b1d21;
    --accent-soft: #3a3120;
    --ok: #5fd47e;
    --bad: #ff8a80;
    --focus: #8ab4ff;
    --d-LIVE: #6fa6ff;
    --d-T: #f0c040;
    --d-I: #4fca6c;
    --d-M: #b28cff;
    --d-E: #ff8f6b;
    color-scheme: dark;
  }
  /* Logo OuiLive : lettres noires, inversées en mode sombre (les pastilles gardent leur couleur) */
  .brand-logo { filter: invert(1) hue-rotate(180deg); }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 17px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
#app:focus, [tabindex="-1"]:focus { outline: none; }
a.btn, a.btn:visited { color: var(--ink); }
a.btn.primary, a.btn.primary:visited { color: var(--accent-ink); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* En-tête */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.top-in {
  max-width: 640px; margin: 0 auto; padding: 6px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand-logo { height: 24px; width: auto; display: block; }
.badge { display: inline-block; margin: 0 0 10px; padding: 4px 12px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font-size: 14px; font-weight: 700; }
.brand { font-size: 14px; font-weight: 600; color: var(--ink2); letter-spacing: .02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.top-in { position: relative; }
.lang {
  min-height: 44px; min-width: 64px; padding: 0 12px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); border-radius: 22px; background: var(--card); cursor: pointer;
}
.lang .flag { font-size: 22px; line-height: 1; }
.lang .caret { font-size: 12px; color: var(--ink2); }
.langmenu {
  position: absolute; right: 16px; top: 54px; z-index: 20; min-width: 200px; max-height: 70vh; overflow: auto;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 6px;
}
.langmenu button {
  display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 8px 12px;
  border: 0; border-radius: 8px; background: none; text-align: left; font-size: 17px; cursor: pointer;
}
.langmenu button[aria-checked="true"] { background: var(--accent-soft); font-weight: 700; }
.langmenu .flag { font-size: 22px; }

main { max-width: 640px; margin: 0 auto; padding: 16px 16px 40px; }

/* Cartes et textes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 18px; margin: 0 0 16px; }
h1 { font-size: 26px; line-height: 1.2; margin: 6px 0 6px; }
h2 { font-size: 21px; line-height: 1.25; margin: 0 0 10px; }
h3 { font-size: 18px; line-height: 1.3; margin: 0 0 6px; }
p { margin: 0 0 12px; }
.muted { color: var(--ink2); }
.small { font-size: 15px; }
.sub { color: var(--ink2); margin: 0 0 18px; }
ul.points { padding-left: 22px; margin: 0 0 14px; }
ul.points li { margin-bottom: 6px; }
.note { background: var(--accent-soft); border-radius: 10px; padding: 12px 14px; margin: 0 0 16px; font-size: 15px; }

/* Boutons */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px; padding: 12px 18px; margin: 0 0 10px;
  border-radius: 12px; border: 1px solid var(--line); background: var(--card);
  font-weight: 600; font-size: 17px; text-align: center; text-decoration: none; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
/* Boutons d'action du rapport : tous au même niveau, aucun « favori » (retour de Laurent du 11/11) */
.btn.action, a.btn.action, a.btn.action:visited { background: var(--card); color: var(--accent); border: 2px solid var(--accent); }
.beyond { margin: 22px 0 6px; padding-top: 16px; border-top: 1px solid var(--line); }
.tease { margin: 8px 0 0 !important; padding: 10px 12px; border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; font-size: 15px !important; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn .ico { font-size: 19px; line-height: 1; }
.row { display: flex; gap: 10px; }
.row .btn { margin: 0; }
.row .btn.back { flex: 0 0 auto; width: auto; min-width: 104px; }
.link-btn { background: none; border: 0; padding: 10px 0; min-height: 44px; color: var(--ink2); text-decoration: underline; cursor: pointer; font-size: 15px; }

/* Questionnaire */
.progress-label { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ink2); margin: 0 0 6px; }
.progress-label .dimtag { font-weight: 700; }
.bar { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; margin: 0 0 20px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .25s; }
.statement { font-size: 20px; line-height: 1.4; font-weight: 600; margin: 0 0 20px; min-height: 3.2em; }
.answers { display: flex; flex-direction: column; gap: 10px; margin: 0 0 20px; }
.answer {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 54px; padding: 10px 16px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
  font-size: 17px; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.answer .dot { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid var(--ink2); }
.answer[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }
.answer[aria-pressed="true"] .dot { border-color: var(--accent); background: radial-gradient(var(--accent) 45%, transparent 50%); }
@media (hover: hover) { .answer:hover { border-color: var(--accent); } }
.help { color: var(--ink2); font-style: italic; font-size: 15px; margin: -8px 0 12px; }
textarea {
  width: 100%; min-height: 150px; padding: 12px 14px; margin: 0 0 18px;
  border: 1.5px solid var(--line); border-radius: 12px; background: var(--card);
  font-size: 17px; line-height: 1.5; resize: vertical;
}
.enter { animation: enter .28s ease; }
@keyframes enter { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .enter { animation: none; } .bar > span, .gauge > span { transition: none; } }

/* Accueil : case fin de programme, lien confidentialité, fenêtre */
.check { display: flex; align-items: flex-start; gap: 12px; min-height: 48px; padding: 10px 0; margin: 0 0 10px; cursor: pointer; font-size: 16px; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: 0 0 22px; }
.small-link { display: block; margin: 4px auto 0; font-size: 14px; }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal { background: var(--card); color: var(--ink); border-radius: var(--radius); padding: 22px 20px 12px; max-width: 520px; width: 100%; max-height: 88vh; overflow: auto; }
.file-btn { cursor: pointer; }
.ok-note { color: var(--ok); font-weight: 600; }
.chip-week { display: inline-block; margin: 8px 0 0 !important; padding: 4px 10px; border-radius: 10px; background: var(--accent-soft); color: var(--ink); font-size: 14px !important; font-weight: 600; }
.cmp { border: 2px solid var(--accent); }
.row.tight { gap: 18px; margin: 4px 0 6px; }
details.dimd { margin-top: 8px; }
details.dimd summary { display: flex; align-items: center; cursor: pointer; list-style: none; min-height: 44px; font-weight: 600; color: var(--accent); }
details.dimd summary::after { content: "▾"; margin-left: 8px; }
details.dimd[open] summary::after { content: "▴"; }
details.dimd summary::-webkit-details-marker { display: none; }
.ans-line { padding: 10px 0; border-top: 1px dashed var(--line); font-size: 15px; }
.ans-line p { margin: 0 0 6px; }
.ans-scale { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.scale { display: inline-flex; gap: 3px; }
.scale i { width: 26px; height: 12px; border-radius: 3px; background: var(--soft); border: 1px solid var(--line); }
.scale i.on { border-color: transparent; }
.ans-label { font-weight: 700; font-size: 14px; }
.ans-when { min-width: 92px; font-size: 13px; color: var(--ink2); }
.ans-scale.before { opacity: .55; margin-bottom: 4px; }

/* Liste des oublis */
.missing-list { list-style: none; padding: 0; margin: 0 0 16px; }
.missing-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.missing-list li span { flex: 1; font-size: 15px; }
.missing-list .btn { width: auto; min-width: 110px; margin: 0; min-height: 44px; font-size: 15px; }

/* Rapport */
.score-big { font-size: 64px; font-weight: 800; line-height: 1; margin: 6px 0 4px; }
.score-big small { font-size: 28px; }
.gauge { height: 12px; background: var(--soft); border-radius: 6px; overflow: hidden; margin: 8px 0 14px; }
.gauge > span { display: block; height: 100%; border-radius: 6px; transition: width .4s; }
.dim { padding: 14px 0; border-top: 1px solid var(--line); }
.dim:first-of-type { border-top: 0; padding-top: 4px; }
.dim-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dim-name { font-weight: 700; }
.dim-method { font-size: 13px; font-weight: 700; color: var(--ink2); margin-left: 6px; white-space: nowrap; }
.dim-pct { font-weight: 800; font-size: 19px; white-space: nowrap; }
.dim p { font-size: 15.5px; margin: 0; }
.dim .gauge { margin: 6px 0 8px; height: 10px; }
.gauge.before { height: 6px; margin: 4px 0 0; opacity: .9; }
.gauge.before > span { background: var(--ink2) !important; opacity: .45; }
.delta { font-weight: 700; font-size: 15px; white-space: nowrap; }
.delta.up { color: var(--ok); }
.delta.down { color: var(--bad); }
.delta.same { color: var(--ink2); }
.item { padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-of-type { border-top: 0; }
.item .label { font-size: 13px; font-weight: 700; color: var(--ink2); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 2px; }
.item blockquote { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--soft); border-radius: 0 8px 8px 0; font-style: italic; white-space: pre-wrap; overflow-wrap: anywhere; }
.item p { margin: 6px 0 0; font-size: 15.5px; }
.stmt { font-weight: 600; }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--ink2); margin: 0 0 6px; }
.legend i { display: inline-block; width: 18px; height: 6px; border-radius: 3px; vertical-align: middle; margin-right: 6px; }
select { width: 100%; min-height: 48px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); margin: 0 0 14px; }
input[type="text"], input[type="url"] {
  width: 100%; min-height: 48px; padding: 10px 12px; margin: 0 0 10px;
  border: 1.5px solid var(--line); border-radius: 10px; background: var(--card); font-size: 16px;
}
.linkbox { font-size: 14px; color: var(--ink2); }
.status { min-height: 1.5em; font-size: 15px; font-weight: 600; margin: 4px 0 10px; }
.status.err { color: var(--bad); }
.status.ok { color: var(--ok); }
.keep { border: 2px solid var(--accent); }
.inapp { border: 2px solid var(--accent); background: var(--accent-soft); }
details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 700; }
.ans-line { padding: 8px 0; border-top: 1px solid var(--line); font-size: 15px; }
.ans-line b { display: block; color: var(--ink2); font-weight: 600; font-size: 14px; }
.foot { text-align: center; font-size: 14px; color: var(--ink2); margin-top: 24px; }
.foot .link-btn { display: block; margin: 0 auto; }

@media (min-width: 700px) {
  main { padding-top: 28px; }
  .card { padding: 26px 28px; }
  h1 { font-size: 30px; }
}

/* Impression : le rapport seul, en clair */
@media print {
  :root { --bg: #fff; --card: #fff; --ink: #000; --ink2: #444; --line: #ccc; --soft: #eee; --accent: #8a5f00; --accent-soft: #fff; }
  .top, .no-print, .btn, .link-btn, .inapp, .compare-box, .status, .foot, .overlay { display: none !important; }
  details.dimd > * { display: block !important; }
  .scale i, .gauge > span { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { font-size: 12pt; }
  main { max-width: none; padding: 0; }
  .card { border: 0; padding: 0 0 8pt; margin: 0 0 8pt; break-inside: avoid; }
  .keep { border: 0; }
  details > *:not(summary) { display: block; }
  .gauge, .bar { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .print-link { display: block !important; font-size: 10pt; word-break: break-all; }
}
.print-link { display: none; }
