/* DualQuest : feuille de style de l'application. Mobile d'abord, style plat (charte dual-hst.ch). */
@import url("tokens.59bcece3e185.css");

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.55; color: var(--navy); background: var(--off); }
img { max-width: 100%; height: auto; }
a { color: var(--teal-d); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, label:focus-within {
  outline: 3px solid var(--orange); outline-offset: 2px;
}
h1, h2, h3 { font-weight: 800; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; letter-spacing: -1px; }
h2 { font-size: 1.375rem; letter-spacing: -.5px; }
h3 { font-size: 1.125rem; letter-spacing: -.3px; }
p { margin: 0 0 1em; }
.muted { color: var(--gray); }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Layout */
.topbar { background: rgba(255,255,255,.96); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar-inner { max-width: 760px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--navy); }
.brand img { height: 40px; width: auto; }
.brand-name { font-weight: 800; font-size: 1.125rem; letter-spacing: -.5px; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; font-size: .9375rem; }
.container { max-width: 760px; margin: 0 auto; padding: 20px 16px 48px; }
.footer { text-align: center; color: var(--gray); font-size: .875rem; padding: 24px 16px 40px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  padding: 12px 24px; border-radius: var(--radius-btn); font: inherit; font-weight: 700; font-size: 1.1875rem;
  text-decoration: none; cursor: pointer; border: 0; }
.btn-primary { background: var(--teal); color: var(--white); }
.btn-primary:hover { background: var(--teal-d); }
.btn-secondary { background: var(--white); color: var(--navy); border: 1.5px solid var(--border); font-weight: 500; }
.btn-reward { background: var(--orange); color: var(--navy); }
.btn-link { background: none; border: 0; padding: 8px; color: var(--teal-d); font: inherit; cursor: pointer; text-decoration: underline; }
.btn-block { display: flex; width: 100%; }
.actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
@media (min-width: 560px) { .actions { flex-direction: row; } .actions .btn { flex: 1; } }

/* Cards */
.card { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-tile); padding: 20px; margin-bottom: 14px; }
.card-lg { border-radius: var(--radius-card); padding: 24px; }
.card-dark { background: var(--navy); color: var(--white); border: 0; }
.card-dark h1, .card-dark h2 { color: var(--white); }
.card-dark .muted { color: #cbd5e1; }

/* Catalogue */
.hero-progress { display: flex; align-items: center; gap: 16px; }
.big-number { font-family: var(--mono); font-size: 2rem; font-weight: 500; color: var(--teal-l); }
.theme-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--teal); flex: none; }
.theme-dot.orange { background: var(--orange); }
.theme-dot.dark { background: var(--navy); }
.module-link { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.module-link:hover { border-color: var(--teal); }
.module-meta { font-size: .875rem; color: var(--gray); }
.pill { display: inline-block; font-size: .8125rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.pill-validated { background: var(--orange); color: var(--navy); }
.pill-progress { background: var(--off); color: var(--navy); border: 1px solid var(--border); }
.pill-new { background: var(--teal-d); color: var(--white); }
.chevron { margin-left: auto; color: var(--lgray); font-size: 1.5rem; }

/* Progress bar */
.progress { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; margin: 6px 0 18px; }
.progress > span { display: block; height: 100%; background: var(--teal); border-radius: 999px; }
.progress-label { font-size: .875rem; color: var(--gray); display: flex; justify-content: space-between; }

/* Capsule */
.capsule-kind { font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--teal-d); }
.capsule-golden_rule { border-left: 6px solid var(--orange); }
.capsule-key_figure .capsule-body strong { font-family: var(--mono); color: var(--teal-d); font-size: 1.15em; }
.capsule-body { font-size: 1.0625rem; }
.capsule-image { display: block; margin: 0 auto 16px; max-height: 160px; }

/* Quiz */
.question-prompt { font-size: 1.25rem; font-weight: 700; line-height: 1.35; margin-bottom: 18px; }
.critical-flag { display: inline-block; font-size: .8125rem; font-weight: 700; color: var(--orange-d); margin-bottom: 8px; }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.choice { display: flex; align-items: center; gap: 12px; padding: 14px 16px; min-height: 56px; margin-bottom: 10px;
  background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius-tile); cursor: pointer; font-size: 1.0625rem; }
.choice:hover { border-color: var(--teal); }
.choice input { width: 22px; height: 22px; accent-color: var(--teal); flex: none; }
.choice:has(input:checked) { border-color: var(--teal); background: #ecfeff; }
.row-select { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 10px;
  background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius-tile); }
.row-select .label { flex: 1; font-size: 1.0625rem; }
.row-select img { width: 48px; height: 48px; }
select { font: inherit; font-size: 1rem; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--border);
  border-radius: var(--radius-btn-sm); background: var(--white); color: var(--navy); max-width: 55%; }
.alert { padding: 12px 16px; border-radius: var(--radius-btn); margin-bottom: 14px; font-weight: 600; }
.alert-error { background: var(--error-bg); color: var(--error); }
.alert-info { background: #ecfeff; color: var(--teal-d); }

.feedback { border-radius: var(--radius-card); padding: 22px; margin-bottom: 14px; }
.feedback-ok { background: var(--success-bg); border: 2px solid var(--success); }
.feedback-ko { background: var(--error-bg); border: 2px solid var(--error); }
.feedback-title { font-size: 1.375rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.feedback-ok .feedback-title { color: var(--success); }
.feedback-ko .feedback-title { color: var(--error); }
.icon { font-size: 1.5rem; line-height: 1; }

.score { font-family: var(--mono); font-size: 3rem; font-weight: 500; line-height: 1; }
.score .unit { font-size: .55em; margin-left: .1em; }
.capsule-key_figure ul { list-style: none; padding: 0; }
.capsule-key_figure li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.result-pass { border-top: 6px solid var(--orange); }

/* Forms */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 6px; }
.form-row input { width: 100%; font: inherit; font-size: 1.125rem; min-height: 48px; padding: 10px 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-btn); background: var(--white); color: var(--navy); }
.errorlist { color: var(--error); padding-left: 18px; margin: 6px 0; font-size: .9375rem; }

/* Help box (sensitive themes) */
.help-box { background: var(--white); border: 2px solid var(--teal); border-radius: var(--radius-tile); padding: 16px; margin-top: 20px; }
.help-box h2 { font-size: 1.0625rem; margin-bottom: 8px; }
.help-box ul { margin: 0; padding-left: 18px; }

.references { font-size: .875rem; color: var(--gray); border-top: 1px solid var(--border); padding-top: 12px; margin-top: 16px; }

@media (prefers-reduced-motion: no-preference) {
  .feedback, .result-pass { animation: pop .35s ease-out; }
  @keyframes pop { from { transform: scale(.97); } to { transform: none; } }
}
.mt { margin-top: 16px; }

/* Progress widths (no inline styles: strict CSP) */
.w-0{width:0%}.w-1{width:1%}.w-2{width:2%}.w-3{width:3%}.w-4{width:4%}.w-5{width:5%}.w-6{width:6%}.w-7{width:7%}.w-8{width:8%}.w-9{width:9%}
.w-10{width:10%}.w-11{width:11%}.w-12{width:12%}.w-13{width:13%}.w-14{width:14%}.w-15{width:15%}.w-16{width:16%}.w-17{width:17%}.w-18{width:18%}.w-19{width:19%}
.w-20{width:20%}.w-21{width:21%}.w-22{width:22%}.w-23{width:23%}.w-24{width:24%}.w-25{width:25%}.w-26{width:26%}.w-27{width:27%}.w-28{width:28%}.w-29{width:29%}
.w-30{width:30%}.w-31{width:31%}.w-32{width:32%}.w-33{width:33%}.w-34{width:34%}.w-35{width:35%}.w-36{width:36%}.w-37{width:37%}.w-38{width:38%}.w-39{width:39%}
.w-40{width:40%}.w-41{width:41%}.w-42{width:42%}.w-43{width:43%}.w-44{width:44%}.w-45{width:45%}.w-46{width:46%}.w-47{width:47%}.w-48{width:48%}.w-49{width:49%}
.w-50{width:50%}.w-51{width:51%}.w-52{width:52%}.w-53{width:53%}.w-54{width:54%}.w-55{width:55%}.w-56{width:56%}.w-57{width:57%}.w-58{width:58%}.w-59{width:59%}
.w-60{width:60%}.w-61{width:61%}.w-62{width:62%}.w-63{width:63%}.w-64{width:64%}.w-65{width:65%}.w-66{width:66%}.w-67{width:67%}.w-68{width:68%}.w-69{width:69%}
.w-70{width:70%}.w-71{width:71%}.w-72{width:72%}.w-73{width:73%}.w-74{width:74%}.w-75{width:75%}.w-76{width:76%}.w-77{width:77%}.w-78{width:78%}.w-79{width:79%}
.w-80{width:80%}.w-81{width:81%}.w-82{width:82%}.w-83{width:83%}.w-84{width:84%}.w-85{width:85%}.w-86{width:86%}.w-87{width:87%}.w-88{width:88%}.w-89{width:89%}
.w-90{width:90%}.w-91{width:91%}.w-92{width:92%}.w-93{width:93%}.w-94{width:94%}.w-95{width:95%}.w-96{width:96%}.w-97{width:97%}.w-98{width:98%}.w-99{width:99%}
.w-100{width:100%}
select { min-width: 0; }
.row-select.stack { flex-direction: column; align-items: stretch; gap: 8px; }
.row-select.stack .label { display: flex; align-items: center; gap: 10px; font-weight: 600; }
.row-select.stack select { max-width: 100%; width: 100%; }

/* Gamification (phase 2). Orange = reward; navy text on orange only (contrast 6.1:1). */
.level-chip { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 4px 12px; border-radius: 999px;
  background: var(--orange); color: var(--navy); font-weight: 700; font-size: .875rem; text-decoration: none; white-space: nowrap; }
.level-chip:hover { background: var(--orange-d); color: var(--white); }
@media (max-width: 479px) { .topbar-logout { display: none; } }
.on-dark { color: var(--teal-l); }
.level-card .big-number { margin: 0 0 8px; }
.level-card .big-number .mono { color: var(--teal-l); }
.progress-reward { background: var(--white-veil); }
.progress-reward > span { background: var(--orange); }
.xp-list { list-style: none; padding: 0; margin: 0 0 12px; }
.xp-list.card { padding: 4px 20px; }
.xp-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.xp-list li:last-child { border-bottom: 0; }
.xp-amount { color: var(--orange-d); font-weight: 500; }
.plain-list { margin: 0; padding-left: 18px; }
.rewards { position: relative; overflow: hidden; border-top: 6px solid var(--orange); }
.reward-kind { color: var(--orange-d); }
.xp-total { font-size: 1.75rem; font-weight: 800; margin: 0 0 8px; }
.xp-total .mono { color: var(--orange-d); font-weight: 500; }
.level-up { background: var(--navy); color: var(--white); border-color: var(--navy); }
.level-up h2 { color: var(--white); }
.level-up .reward-kind, .level-up .xp-total .mono, .level-up .xp-amount { color: var(--orange); }
.level-up .xp-list li { border-color: var(--white-line); }
.level-up a, .level-up .muted { color: var(--teal-l); }
.confetti { display: none; }
@media (prefers-reduced-motion: no-preference) {
  .xp-total.animate { animation: xp-pop .4s ease-out; }
  @keyframes xp-pop { from { transform: scale(.8); opacity: 0; } to { transform: none; opacity: 1; } }
  .level-up.animate .confetti { display: block; position: absolute; inset: 0; pointer-events: none; }
  .confetti i { position: absolute; top: -12px; width: 8px; height: 12px; border-radius: 2px; background: var(--orange);
    opacity: 0; animation: fall 1.4s ease-in 1 forwards; }
  .confetti i:nth-child(odd) { background: var(--teal-l); }
  .confetti i:nth-child(1) { left: 5%; animation-delay: 0s; } .confetti i:nth-child(2) { left: 13%; animation-delay: .15s; }
  .confetti i:nth-child(3) { left: 22%; animation-delay: .05s; } .confetti i:nth-child(4) { left: 31%; animation-delay: .25s; }
  .confetti i:nth-child(5) { left: 40%; animation-delay: .1s; } .confetti i:nth-child(6) { left: 49%; animation-delay: .3s; }
  .confetti i:nth-child(7) { left: 58%; animation-delay: 0s; } .confetti i:nth-child(8) { left: 67%; animation-delay: .2s; }
  .confetti i:nth-child(9) { left: 76%; animation-delay: .1s; } .confetti i:nth-child(10) { left: 85%; animation-delay: .35s; }
  .confetti i:nth-child(11) { left: 92%; animation-delay: .05s; } .confetti i:nth-child(12) { left: 97%; animation-delay: .2s; }
  @keyframes fall { 0% { opacity: 1; transform: translateY(0) rotate(0); } 100% { opacity: 0; transform: translateY(260px) rotate(300deg); } }
}

/* Badges. The orange halo on an earned badge is the only shadow allowed by the charter. */
.badge-grid { list-style: none; padding: 0; margin: 12px 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .badge-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.badge-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; padding: 16px 10px;
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius-tile); color: var(--navy); }
.badge-desc { font-size: .875rem; color: var(--gray); }
.badge-state { font-size: .8125rem; font-weight: 700; }
.badge-tile.earned .badge-state { color: var(--orange-d); }
.badge-tile.locked .badge-state { color: var(--gray); }
.medal { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 56px; height: 56px; border-radius: 50%;
  background: var(--orange); color: var(--navy); font-weight: 800; font-size: 1.125rem; letter-spacing: -.5px; }
.earned .medal { box-shadow: 0 0 0 6px var(--orange-halo); }
.locked .medal { background: var(--off); color: var(--gray); border: 2px dashed var(--lgray); }
.module-link .medal { width: 44px; height: 44px; }
.level-up .badge-tile { background: transparent; border-color: var(--white-veil); color: var(--white); }
@media (prefers-reduced-motion: no-preference) {
  .medal.animate { animation: medal-in .4s ease-out; }
  @keyframes medal-in { from { transform: scale(.5); } to { transform: none; } }
}
.streak-card { display: flex; align-items: center; gap: 14px; }
.streak-card .medal { width: 44px; height: 44px; }

/* Leaderboards */
.tabs { display: flex; gap: 8px; margin: 8px 0 16px; }
.tabs a { flex: 1; text-align: center; min-height: 44px; padding: 10px; border-radius: var(--radius-btn-sm); border: 1.5px solid var(--border);
  background: var(--white); color: var(--navy); text-decoration: none; font-weight: 600; }
.tabs a[aria-current="page"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.ranking { list-style: none; padding: 0; margin: 0; }
.rank-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; margin-bottom: 10px; }
.rank-row.mine { border: 2px solid var(--orange); }
.rank { width: 32px; flex: none; font-size: 1.25rem; font-weight: 500; text-align: center; color: var(--teal-d); }
.rank-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.rank-main .pill { align-self: flex-start; }
.rank-score { font-size: 1.125rem; font-weight: 500; white-space: nowrap; }

/* Hotspot grid (question "hotspot" and "Chasse aux risques"): checkboxes over the image, no inline style. */
.hotspot { position: relative; margin: 8px 0 4px; border-radius: var(--radius-btn); overflow: hidden; border: 1px solid var(--border); }
.hotspot img { display: block; width: 100%; height: auto; }
.hotspot-grid { position: absolute; inset: 0; display: grid; }
.cols-3 { grid-template-columns: repeat(3, 1fr); } .rows-3 { grid-template-rows: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); } .rows-4 { grid-template-rows: repeat(4, 1fr); }
.cols-5 { grid-template-columns: repeat(5, 1fr); } .rows-5 { grid-template-rows: repeat(5, 1fr); }
.cols-6 { grid-template-columns: repeat(6, 1fr); } .rows-6 { grid-template-rows: repeat(6, 1fr); }
.cols-7 { grid-template-columns: repeat(7, 1fr); } .rows-7 { grid-template-rows: repeat(7, 1fr); }
.cols-8 { grid-template-columns: repeat(8, 1fr); } .rows-8 { grid-template-rows: repeat(8, 1fr); }
.hotspot-cell { position: relative; display: block; cursor: pointer; border: 1px dashed var(--navy-line); }
.hotspot-cell input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.hotspot-cell:hover { background: var(--teal-tint); }
.hotspot-cell:focus-within { outline: 3px solid var(--orange); outline-offset: -3px; }
.hotspot-cell:has(input:checked) { background: var(--orange-tint); border: 3px solid var(--orange-d); }
.hotspot-cell:has(input:checked)::after { content: "!"; position: absolute; top: 4px; right: 6px; font-weight: 800; color: var(--navy);
  background: var(--orange); border-radius: 50%; width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; font-size: .875rem; }

/* Mini-games */
.game-timer { font-weight: 600; }
.game-start { margin: 0; }
.game-link { width: 100%; font: inherit; text-align: left; cursor: pointer; }
.game-link .medal { width: 44px; height: 44px; }
.result-lines { list-style: none; padding: 0; margin: 0; }
.result-line { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin-bottom: 10px; }
.result-line.ok { border-left: 6px solid var(--success); }
.result-line.ok .icon { color: var(--success); }
.result-line.ko { border-left: 6px solid var(--error); }
.result-line.ko .icon { color: var(--error); }
.result-line p { margin: 4px 0 0; }
/* On phones the hunt image goes edge to edge in its card so grid cells stay close to 44 px (NF-01). */
@media (max-width: 559px) {
  .game-form .hotspot { margin-left: -24px; margin-right: -24px; border-radius: 0; border-left: 0; border-right: 0; }
}

/* Mini-games, JavaScript enhancement (static/js/games.js) */
.js-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.game-timer.timer-low { color: var(--orange-d); }
.game-timer.timer-over { color: var(--error); }
.sort-pool { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; padding: 12px; background: var(--off); border-radius: var(--radius-btn); }
.chip { font: inherit; font-size: .9375rem; text-align: left; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-btn-sm);
  border: 1.5px solid var(--teal); background: var(--white); color: var(--navy); cursor: grab; }
.chip[aria-pressed="true"] { background: var(--teal-d); border-color: var(--teal-d); color: var(--white); }
.drop-zone { font: inherit; width: 100%; min-height: 48px; padding: 10px 12px; text-align: left; cursor: pointer;
  border: 2px dashed var(--lgray); border-radius: var(--radius-btn-sm); background: var(--white); color: var(--gray); }
.drop-zone.filled { border-style: solid; border-color: var(--teal); color: var(--navy); font-weight: 600; }
.drop-zone.over { border-color: var(--orange); background: var(--orange-bg); }
