@font-face { font-family: "Jost"; src: url("../fonts/Jost.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/CormorantGaramond.woff2") format("woff2"); font-weight: 300 700; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/CormorantGaramond-Italic.woff2") format("woff2"); font-weight: 300 700; font-style: italic; font-display: swap; }

:root {
  --bg: #F4EFE7; --paper: #FFFDF9; --ink: #2B2F33; --muted: #6A6660; --line: #E2DACD;
  --accent: #2F3E46; --accent-ink: #FFFFFF; --ok: #3E7A52; --warn: #A8641F; --danger: #A33A2B;
  --radius: 14px; --shadow: 0 1px 2px rgba(40,30,20,.05), 0 8px 28px rgba(40,30,20,.06);
  --serif: "Cormorant Garamond", Georgia, serif; --sans: "Jost", "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
a { color: var(--accent); }
a:hover { color: var(--ink); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.1; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.kicker { font-size: 12px; font-weight: 500; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); font-weight: 500; letter-spacing: .02em; cursor: pointer; text-decoration: none; transition: filter .15s, transform .05s; }
.btn:hover { filter: brightness(1.08); color: var(--accent-ink); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: color-mix(in srgb, var(--accent) 8%, transparent); color: var(--accent); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn[disabled] { opacity: .5; cursor: default; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; font-weight: 500; letter-spacing: .04em; color: var(--muted); }
.input, textarea.input, select.input { width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
textarea.input { min-height: 84px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }

/* ---------- page d'accès ---------- */
.access { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.access .card { width: 100%; max-width: 440px; padding: 40px 36px; display: flex; flex-direction: column; gap: 18px; text-align: center; }
.access h1 { font-size: 38px; }
.code-input { text-align: center; font-size: 22px; letter-spacing: .25em; text-transform: uppercase; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; }
.brand { font-family: var(--sans); font-weight: 500; letter-spacing: .35em; font-size: 12px; color: var(--muted); }

/* ---------- questionnaire ---------- */
.topbar { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 58px; }
.topbar .logo-mini { height: 34px; width: auto; }
.topbar .who { font-size: 14px; color: var(--muted); }
.progress { flex: 1; height: 6px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); width: 0; transition: width .3s; }
.save-state { font-size: 13px; color: var(--muted); min-width: 120px; text-align: right; }

.hero { padding: 48px 0 28px; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
.hero .logo { max-height: 140px; max-width: 320px; width: auto; }
.hero h1 { font-size: 44px; }
.hero p { max-width: 640px; margin: 0; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: 14px; }

.section { margin: 28px 0; }
.section-head { display: flex; align-items: baseline; gap: 14px; margin: 0 4px 14px; }
.section-head .letter { font-family: var(--serif); font-size: 30px; font-weight: 600; color: var(--accent); }
.section-head h2 { font-size: 28px; }
.q { padding: 24px 26px; margin-bottom: 14px; display: flex; flex-direction: column; gap: 14px; }
.q-title { display: flex; gap: 14px; align-items: flex-start; }
.q-num { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; border: 1px solid var(--line); color: var(--muted); }
.q.answered .q-num { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.q-text { font-size: 18px; font-weight: 400; padding-top: 3px; }
.q-hint { font-size: 14px; color: var(--muted); margin-top: 2px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 15px; line-height: 1.2; transition: background .15s, border-color .15s; }
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"]::before { content: "✓ "; }

.submit-zone { margin: 36px 0 60px; padding: 30px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.thanks { border-left: 4px solid var(--ok); padding: 16px 20px; text-align: left; background: color-mix(in srgb, var(--ok) 8%, #fff); border-radius: 10px; }
.footer { text-align: center; padding: 26px 0 40px; font-size: 13px; color: var(--muted); }

/* ---------- administration ---------- */
.admin-top { background: var(--ink); color: #F4EFE7; }
.admin-top .wrap { max-width: 1180px; display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.admin-top .brand { color: #CFC6B8; }
.admin .wrap { max-width: 1180px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding: 34px 0 18px; flex-wrap: wrap; }
.admin-head h1 { font-size: 40px; }
.company { padding: 24px 26px; margin-bottom: 20px; }
.company-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.company-head .clogo { width: 120px; height: 64px; object-fit: contain; background: var(--bg); border-radius: 10px; padding: 6px; }
.company-head .cinfo { flex: 1; min-width: 200px; }
.company-head h2 { font-size: 30px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 4px; border: 1px solid rgba(0,0,0,.15); }
.actions { display: flex; gap: 8px; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; margin-top: 18px; }
table.list { width: 100%; border-collapse: collapse; font-size: 15px; }
table.list th { text-align: left; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 500; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.list td { padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; letter-spacing: .08em; white-space: nowrap; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 500; }
.badge.invited { background: #ECE7DE; color: #5E584F; }
.badge.in_progress { background: #F6E7D3; color: var(--warn); }
.badge.submitted { background: #DDEEE2; color: var(--ok); }
.add-row { display: grid; grid-template-columns: 1fr 1fr 1.4fr auto; gap: 10px; margin-top: 16px; align-items: end; }
@media (max-width: 760px) { .add-row { grid-template-columns: 1fr; } }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 50; }
.toast.show { opacity: 1; }

dialog { border: none; border-radius: var(--radius); padding: 0; box-shadow: 0 20px 60px rgba(0,0,0,.25); max-width: 560px; width: calc(100% - 32px); }
dialog::backdrop { background: rgba(30,28,25,.45); }
.dlg { padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.dlg h2 { font-size: 28px; }
.dlg .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.dlg .end { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }

.compare { padding: 0 0 60px; }
table.cmp { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
table.cmp th, table.cmp td { padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
table.cmp thead th { background: var(--ink); color: #F4EFE7; font-weight: 500; font-size: 14px; letter-spacing: .04em; position: sticky; top: 0; }
table.cmp tr.sec td { background: var(--bg); font-family: var(--serif); font-size: 20px; font-weight: 600; }
table.cmp td.qcol { width: 34%; }
.sel { display: inline-block; margin: 0 6px 6px 0; padding: 3px 10px; border-radius: 999px; background: #ECE7DE; font-size: 13.5px; }
.sel.common { background: #DDEEE2; color: #2F5E3E; font-weight: 500; }
.ans-text { white-space: pre-wrap; font-size: 15px; }
.empty { color: #A59E93; font-style: italic; font-size: 14px; }
@media print { .admin-top, .no-print { display: none !important; } body { background: #fff; } }
