/* AntiSquat — application mobile. Colonne unique de 480px max, cartes crème, accents orange du logo. */
:root {
  --bg: #FBF9F8;
  --surface: #FFFFFF;
  --ink: #1D1C1A;
  --ink-2: #55524D;
  --muted: #6B6862;
  --line: #ECE7E2;
  --line-2: #D9D1C7;
  --orange: #FC6903;
  --orange-ink: #B84800;
  --orange-soft: #FFEEDF;
  --tint: #F4F1ED;
  --ok: #2F6B3A;
  --ok-soft: #E6F2E8;
  --danger: #A3260F;
  --danger-soft: #FFE4E0;
  --on-dark: #FFFFFF;
  --on-dark-2: #CFCAC4;
  --dark: #1D1C1A;
  --night: #131211;
  --night-2: #1E1D1B;
  --night-line: #2E2C29;
  --paper: #F6F1EA;
  --f-ui: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-serif: 'Fraunces', Georgia, 'Times New Roman', serif;
  --f-news: 'Public Sans', system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body { margin: 0; font-family: var(--f-ui); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
a { color: var(--orange-ink); text-decoration: none; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
img { max-width: 100%; display: block; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

.app { max-width: 480px; margin: 0 auto; min-height: 100%; background: var(--bg); display: flex; flex-direction: column; padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }
.app.no-tab { padding-bottom: 24px; }
.theme-night { --bg: var(--night); background: var(--night); color: #F4F1EC; }
.theme-paper { --bg: var(--paper); background: var(--paper); }

/* En-tête */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(10px); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; letter-spacing: .2em; font-size: 16px; }
.brand img { width: 38px; height: 38px; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; padding: 0; flex-shrink: 0; }
.theme-night .icon-btn { background: var(--night-2); border-color: var(--night-line); color: #F4F1EC; }
.top-title { font-weight: 800; font-size: 16px; }
.top-logo { width: 34px; height: 34px; }

/* Barre du bas */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(8px + env(safe-area-inset-bottom, 0px)); }
.tabbar-inner { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.tab { min-height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 11px; font-weight: 600; color: var(--muted); }
.tab[aria-current="page"] { color: var(--orange-ink); font-weight: 800; }
.theme-night .tabbar { background: #1A1918; border-color: var(--night-line); }
.theme-night .tab { color: #9C968E; }
.theme-night .tab[aria-current="page"] { color: var(--orange); }

/* Contenu */
.page { display: flex; flex-direction: column; gap: 20px; padding: 8px 16px 24px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-s { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 12px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; color: var(--orange-ink); }
.title { font-size: 30px; line-height: 1.1; font-weight: 800; letter-spacing: -.02em; }
.h2 { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.h3 { font-size: 16px; font-weight: 800; }
.lead { font-size: 15px; line-height: 1.55; color: var(--ink-2); }
.small { font-size: 13px; line-height: 1.5; color: var(--muted); }
.tiny { font-size: 12px; line-height: 1.45; color: var(--muted); }
.note { font-size: 12px; line-height: 1.5; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.card-dark { background: var(--dark); color: var(--on-dark); border-radius: 24px; padding: 22px 20px; display: flex; flex-direction: column; gap: 12px; }
.card-dark .lead, .card-dark .small { color: var(--on-dark-2); }
.card-dark .eyebrow { color: var(--orange); }
.card-soft { background: var(--orange-soft); border-radius: 22px; padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.card-accent { background: var(--surface); border: 2px solid var(--orange); border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 14px; }
.card-danger { border-color: var(--danger); }
.theme-night .card { background: var(--night-2); border-color: var(--night-line); color: #F4F1EC; }

.btn { min-height: 52px; border-radius: 16px; border: none; background: var(--orange); color: var(--ink); font-weight: 800; font-size: 16px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 18px; text-align: center; }
.btn-dark { background: var(--dark); color: var(--on-dark); }
.btn-outline { background: transparent; border: 1.5px solid var(--ink); color: var(--ink); font-weight: 700; }
.card-dark .btn-outline { border-color: var(--on-dark); color: var(--on-dark); }
.btn-ghost { background: transparent; color: var(--orange-ink); font-weight: 700; min-height: 44px; font-size: 15px; }
.card-dark .btn-ghost { color: var(--on-dark); font-weight: 600; }
.btn-s { min-height: 40px; border-radius: 10px; font-size: 13px; padding: 0 12px; }
.btn-danger { background: var(--danger); color: #FFFFFF; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-block { width: 100%; }

.chip { min-height: 44px; padding: 6px 12px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 700; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { min-height: 44px; padding: 0 16px; border-radius: 22px; border: 1px solid var(--line-2); background: var(--surface); font-size: 14px; font-weight: 700; color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.tag { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 800; letter-spacing: .03em; background: var(--tint); color: var(--ink); white-space: nowrap; }
.tag-dark { background: var(--dark); color: var(--on-dark); }
.tag-orange { background: var(--orange); color: var(--ink); }
.tag-soft { background: var(--orange-soft); color: #8F3800; }
.tag-ok { background: var(--ok-soft); color: var(--ok); }
.tag-danger { background: var(--danger); color: #FFFFFF; }

.icon-box { width: 44px; height: 44px; border-radius: 13px; background: var(--orange-soft); color: var(--orange-ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.avatar { width: 40px; height: 40px; border-radius: 20px; background: var(--dark); color: var(--orange); font-weight: 800; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

.checks { display: flex; flex-direction: column; gap: 10px; }
.check-line { display: flex; gap: 10px; font-size: 14px; line-height: 1.45; }
.check-line svg { flex-shrink: 0; margin-top: 2px; color: var(--orange); }
.card .check-line svg, .card-accent .check-line svg { color: var(--orange-ink); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid #F1ECE7; color: var(--ink); min-height: 56px; }
.list-item:last-child { border-bottom: none; }
.menu-link { min-height: 50px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); font-size: 17px; font-weight: 700; color: var(--ink); }

/* Formulaires */
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.field .opt { font-weight: 500; color: var(--muted); }
.req { color: var(--orange-ink); }
.input, .textarea, .select { width: 100%; min-height: 50px; border: 1.5px solid var(--line-2); border-radius: 12px; padding: 0 14px; font-size: 16px; font-weight: 500; background: var(--bg); color: var(--ink); }
.textarea { padding: 12px 14px; min-height: 110px; resize: vertical; line-height: 1.5; }
.check { display: flex; align-items: flex-start; gap: 12px; font-size: 14px; line-height: 1.45; font-weight: 500; min-height: 44px; padding: 4px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; accent-color: var(--orange); margin: 0; flex-shrink: 0; }
.alert { border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 600; background: var(--danger-soft); color: #8A1C0A; }
.success { border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 700; background: var(--ok-soft); color: var(--ok); }
fieldset { margin: 0; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); padding: 18px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
legend { padding: 0 6px; font-size: 13px; font-weight: 800; color: var(--orange-ink); }

/* Étapes */
.steps { display: flex; flex-direction: column; }
.step { display: flex; gap: 16px; }
.step-rail { display: flex; flex-direction: column; align-items: center; }
.step-num { width: 36px; height: 36px; border-radius: 18px; background: var(--orange); color: var(--ink); font-weight: 800; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.step-line { width: 2px; flex: 1 1 auto; background: #E4DDD5; }
.step-body { padding-bottom: 22px; display: flex; flex-direction: column; gap: 6px; padding-top: 6px; min-width: 0; }
.step-tag { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--orange-ink); }

/* Accordéon */
.acc { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.acc-item { border-bottom: 1px solid #F1ECE7; }
.acc-item:last-child { border-bottom: none; }
.acc-btn { width: 100%; min-height: 58px; border: none; background: transparent; padding: 14px 16px; display: flex; align-items: center; gap: 12px; text-align: left; color: var(--ink); font-weight: 700; font-size: 15px; line-height: 1.4; }
.acc-sign { width: 30px; height: 30px; border-radius: 15px; background: var(--tint); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }
.acc-item.open .acc-sign { background: var(--orange); }
.acc-body { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.6; color: var(--ink-2); }
.num { width: 28px; flex-shrink: 0; font-size: 13px; font-weight: 800; color: var(--orange-ink); font-variant-numeric: tabular-nums; }

.banner-img { border-radius: 20px; overflow: hidden; border: 1px solid var(--line); background: #FBF6F1; display: block; }
.banner-img img { width: 100%; height: auto; }

.segmented { display: grid; gap: 4px; padding: 4px; background: #EFEDEA; border-radius: 14px; }
.segmented button { min-height: 42px; border: none; border-radius: 10px; background: transparent; font-weight: 800; font-size: 13px; color: var(--ink-2); }
.segmented button[aria-selected="true"], .segmented button[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); }

.bubble { max-width: 85%; padding: 10px 12px; border-radius: 14px; font-size: 14px; line-height: 1.5; }
.bubble.me { align-self: flex-end; background: var(--dark); color: var(--on-dark); }
.bubble.them { align-self: flex-start; background: var(--tint); }
.bubble small { display: block; font-size: 11px; opacity: .7; margin-top: 4px; }

/* Actualités (style journal) */
.news { font-family: var(--f-news); }
.news .serif, .serif { font-family: var(--f-serif); }
.masthead { border-bottom: 2px solid var(--ink); padding-bottom: 14px; display: flex; flex-direction: column; gap: 10px; }
.news-tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line-2); overflow-x: auto; }
.news-tabs button { min-height: 44px; border: none; background: transparent; padding: 0; font-weight: 600; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.news-tabs button[aria-pressed="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--orange); }
.news-row { border-top: 1px solid var(--line-2); }
.news-row button { width: 100%; border: none; background: transparent; padding: 16px 0; display: flex; gap: 14px; text-align: left; color: var(--ink); }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--dark); color: var(--on-dark); padding: 12px 16px; border-radius: 14px; font-weight: 700; font-size: 14px; z-index: 50; max-width: calc(100% - 32px); }
.demo-note { border: 1px dashed #B5AFA8; border-radius: 14px; padding: 12px 14px; font-size: 12px; line-height: 1.5; color: var(--muted); }
.hidden-msg { font-size: 13px; font-style: italic; color: var(--muted); }

/* Choix sous forme de pastilles (vrais boutons radio / cases) */
.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.opts.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.opts label { position: relative; display: block; }
.opts input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opts span { min-height: 46px; padding: 6px 8px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--surface); font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; text-align: center; line-height: 1.25; cursor: pointer; }
.opts input:checked + span { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.opts input:focus-visible + span { outline: 3px solid var(--orange); outline-offset: 2px; }
.cat-card { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 0; overflow: hidden; display: flex; flex-direction: column; color: var(--ink); }
.cat-card img { width: 100%; height: 190px; object-fit: cover; object-position: center top; }
.round-go { width: 40px; height: 40px; border-radius: 20px; background: var(--orange); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat { border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--line); }
.stat b { font-size: 28px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat.dark { background: var(--dark); color: var(--on-dark); border-color: var(--dark); }
.stat.dark b { color: var(--orange); }
.segmented .btn-seg { min-height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 13px; color: var(--ink-2); }
.segmented .btn-seg[aria-pressed="true"] { background: var(--dark); color: var(--on-dark); }
details > summary { list-style: none; }
details > summary::-webkit-details-marker { display: none; }
.card-accent .btn-ghost { color: var(--orange-ink); }
.theme-night .field { color: #F4F1EC; }
.theme-night .input, .theme-night .textarea { background: #131211; border-color: #3A3834; color: #F4F1EC; }
.theme-night .input::placeholder, .theme-night .textarea::placeholder { color: #8A847C; }
.theme-night .check { color: #E4E0DA; }
.theme-night .check a { color: var(--orange); }
.theme-night .top { background: color-mix(in srgb, var(--night) 92%, transparent); }
.theme-night .top-title { color: #F4F1EC; }

.top-right { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }
.top > .top-title, .top > .top-logo { margin: 0 auto; }
.top-title { flex: 1 1 auto; min-width: 0; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.espace-btn { position: relative; overflow: visible; }
.espace-btn.logged::after { content: ""; position: absolute; top: 1px; right: 1px; width: 11px; height: 11px; border-radius: 6px; background: var(--orange); border: 2px solid var(--bg); }
.espace-btn[aria-current="page"] { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }

.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 10px; font-weight: 700; }
.skip:focus { left: 8px; }
.hero-side { display: none; }
.as-remote .demo-note { display: none !important; }
