/* Mockup stylesheet for the PLAFOND-Oph web form route.
   Palette and header follow the existing public intake (public-intake-app/static/style.css). */
:root {
  --navy: #0b2948;
  --navy-2: #163d66;
  --ink: #13213c;
  --muted: #52637a;
  --line: #d5dee8;
  --line-strong: #9aa9b8;
  --bg: #eef3f8;
  --card: #ffffff;
  --green: #08745e;
  --green-soft: #e6f6f1;
  --blue: #315d87;
  --blue-soft: #eaf1f8;
  --amber: #a85a00;
  --amber-soft: #fff4e5;
  --red: #b3261e;
  --red-soft: #fdeceb;
  --note: #6b4ce6;
  --note-soft: #f1edff;
  --radius: .65rem;
  --shadow: 0 1px 2px #17304e14, 0 4px 14px #17304e10;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
a { color: #155f86; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .86em; }

/* Header / footer (same shape as the live site) */
.site-header, .site-footer { background: var(--navy); color: #fff; padding: .9rem max(1rem, calc((100% - 72rem) / 2)); }
.site-header { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand { color: #fff; text-decoration: none; font-weight: 750; letter-spacing: .01em; }
.brand small { display: block; font-weight: 500; opacity: .75; font-size: .78rem; }
.lang { display: flex; gap: .3rem; }
.lang button, .lang a { background: none; border: 0; color: #fff; font: inherit; font-weight: 700; padding: .2rem .5rem; border-radius: .3rem; cursor: pointer; text-decoration: none; }
.lang [aria-current="true"] { background: #fff; color: var(--navy); }
.lang .disabled { opacity: .45; cursor: not-allowed; }
.site-footer { margin-top: 3rem; font-size: .88rem; }
.site-footer p { margin: .2rem 0 .6rem; }
.site-footer a { color: #fff; font-weight: 650; margin-right: 1rem; }

main { width: 100%; max-width: 72rem; margin: 1.75rem auto; padding: 0 1rem; flex: 1; }
.narrow { max-width: 48rem; }
h1 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.2; margin: .2rem 0 .6rem; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: 0 0 .6rem; }
h3 { font-size: 1.02rem; margin: 0 0 .35rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .74rem; font-weight: 750; color: var(--blue); }
.lead { font-size: 1.12rem; color: #2a3a55; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }

.card { background: var(--card); border-radius: var(--radius); padding: 1.25rem 1.35rem; box-shadow: var(--shadow); margin: 1rem 0; }
.card.flat { box-shadow: none; border: 1px solid var(--line); }
.callout { border-left: .3rem solid var(--blue); background: var(--blue-soft); padding: .8rem 1rem; border-radius: .35rem; margin: .8rem 0; }
.callout.warn { border-color: #bd4f14; background: #fff4e8; }
.callout.ok { border-color: var(--green); background: var(--green-soft); }
.callout.err { border-color: var(--red); background: var(--red-soft); }
.callout p { margin: .2rem 0; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: .45rem; border: 0; border-radius: .45rem; background: var(--green); color: #fff; padding: .72rem 1.1rem; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: var(--blue); }
.btn.ghost { background: transparent; color: var(--blue); border: 1px solid var(--line-strong); }
.btn.link { background: none; color: var(--blue); padding: .3rem .2rem; text-decoration: underline; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: space-between; align-items: center; margin-top: 1.4rem; }

/* Form primitives */
label.field-label { display: block; font-weight: 650; margin-bottom: .35rem; }
.input, select.input, textarea.input {
  display: block; width: 100%; padding: .66rem .75rem; border: 1px solid var(--line-strong); border-radius: .4rem;
  font: inherit; color: inherit; background: #fff;
}
.input:focus, .choice input:focus-visible + .choice-body, .seg input:focus-visible + span { outline: 3px solid #2f7de166; outline-offset: 1px; }
.input.short { max-width: 12rem; }
.input.medium { max-width: 22rem; }
.with-unit { display: flex; align-items: stretch; max-width: 16rem; }
.with-unit .input { border-radius: .4rem 0 0 .4rem; }
.with-unit .unit { display: flex; align-items: center; padding: 0 .7rem; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 .4rem .4rem 0; background: #f4f7fa; color: var(--muted); font-size: .9rem; white-space: nowrap; }
textarea.input { min-height: 7rem; resize: vertical; }
.counter { text-align: right; font-size: .8rem; color: var(--muted); margin-top: .2rem; }

/* Question block */
.q { padding: 1.1rem 0; border-top: 1px solid var(--line); }
.q:first-of-type { border-top: 0; padding-top: .2rem; }
.q-head { display: flex; gap: .7rem; align-items: flex-start; margin-bottom: .55rem; }
.q-nr { flex: none; min-width: 2.6rem; text-align: center; font-weight: 800; font-size: .8rem; color: var(--navy); background: #e3ebf4; border-radius: .35rem; padding: .18rem .35rem; margin-top: .12rem; }
.q-title { font-weight: 650; flex: 1; }
.q-title .field-name { display: block; font-weight: 500; color: var(--muted); font-size: .78rem; }
.art { flex: none; font-size: .72rem; font-weight: 750; border-radius: 1rem; padding: .12rem .55rem; border: 1px solid; margin-top: .12rem; white-space: nowrap; }
.art.pflicht { color: var(--navy); border-color: #9fb3c9; background: #f3f7fb; }
.art.wichtig { color: var(--amber); border-color: #f0c78f; background: var(--amber-soft); }
.art.freiwillig { color: var(--muted); border-color: var(--line); background: #fafbfc; }
.q-body { margin-left: 3.3rem; }
details.hint { margin-top: .5rem; font-size: .9rem; color: #33445c; }
details.hint summary { cursor: pointer; color: var(--blue); font-weight: 600; list-style: none; }
details.hint summary::before { content: "ⓘ "; }
details.hint summary::-webkit-details-marker { display: none; }
details.hint p { margin: .35rem 0 0; }
.msg { font-size: .88rem; margin-top: .45rem; padding: .4rem .6rem; border-radius: .35rem; }
.msg.warn { background: var(--amber-soft); color: #7a4100; }
.msg.err { background: var(--red-soft); color: var(--red); }
.msg.info { background: var(--blue-soft); color: #20476d; }
.msg .fix { margin-left: .4rem; }

/* Choice cards (codelists) */
.choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: .55rem; }
.choices.cols-1 { grid-template-columns: 1fr; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-body { display: block; height: 100%; border: 1px solid var(--line-strong); border-radius: .5rem; padding: .6rem .75rem .6rem 2.15rem; background: #fff; transition: border-color .12s, background .12s; }
.choice-body::before { content: ""; position: absolute; left: .75rem; top: .85rem; width: .95rem; height: .95rem; border-radius: 50%; border: 2px solid var(--line-strong); background: #fff; }
.choice input:checked + .choice-body { border-color: var(--green); background: var(--green-soft); box-shadow: inset 0 0 0 1px var(--green); }
.choice input:checked + .choice-body::before { border-color: var(--green); background: radial-gradient(circle, var(--green) 45%, #fff 50%); }
.choice:hover .choice-body { border-color: var(--blue); }
.choice .meaning { display: block; font-weight: 600; line-height: 1.35; }
.choice .code { display: inline-block; margin-top: .25rem; font-family: ui-monospace, Menlo, monospace; font-size: .72rem; color: var(--muted); background: #f1f4f7; border-radius: .25rem; padding: 0 .3rem; }
.choice.route input:checked + .choice-body { border-color: #bd4f14; background: #fff4e8; box-shadow: inset 0 0 0 1px #bd4f14; }

/* Segmented yes/no */
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: .5rem; overflow: hidden; background: #fff; flex-wrap: wrap; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; }
.seg span { display: block; padding: .5rem 1rem; font-weight: 600; border-left: 1px solid var(--line); }
.seg label:first-child span { border-left: 0; }
.seg input:checked + span { background: var(--green); color: #fff; }
.seg.small span { padding: .35rem .8rem; font-size: .9rem; }

/* Device grid */
.device-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .6rem; }
.device { display: flex; justify-content: space-between; align-items: center; gap: .6rem; border: 1px solid var(--line); border-radius: .5rem; padding: .6rem .75rem; background: #fbfcfd; }
.device .d-label { font-weight: 600; font-size: .95rem; }
.device .seg { flex: none; flex-wrap: nowrap; }
.device .d-label small { display: block; color: var(--muted); font-weight: 500; font-size: .74rem; }

/* Period chips */
.chips { display: flex; gap: .45rem; flex-wrap: wrap; margin-bottom: .7rem; }
.chip { border: 1px solid var(--line-strong); background: #fff; border-radius: 2rem; padding: .35rem .85rem; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--navy); color: #fff; border-color: var(--navy); }
.period { display: flex; gap: 1rem; flex-wrap: wrap; }
.period > div { min-width: 12rem; }

/* Wizard layout */
.wizard { display: grid; grid-template-columns: 16rem 1fr; gap: 1.5rem; align-items: start; }
.wizard > * { min-width: 0; }
.q-title, .q-body { min-width: 0; overflow-wrap: break-word; }
.stepper { position: sticky; top: 1rem; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1rem; }
.stepper ol { list-style: none; margin: 0; padding: 0; counter-reset: s; }
.stepper li { counter-increment: s; }
.stepper button { display: flex; width: 100%; gap: .6rem; align-items: center; text-align: left; border: 0; background: none; padding: .5rem .45rem; border-radius: .4rem; font: inherit; color: var(--muted); cursor: pointer; }
.stepper button::before { content: counter(s); flex: none; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: #e3ebf4; color: var(--navy); }
.stepper button.done::before { content: "✓"; background: var(--green); color: #fff; }
.stepper button.gaps::before { content: "!"; background: #f0c78f; color: #6d3c00; }
.stepper button[aria-current="step"] { background: var(--blue-soft); color: var(--ink); font-weight: 700; }
.stepper .sheet { display: block; font-size: .72rem; color: var(--muted); font-weight: 500; }
.stepper .meter { height: .4rem; background: #e3ebf4; border-radius: 1rem; overflow: hidden; margin: .8rem .2rem .3rem; }
.stepper .meter i { display: block; height: 100%; background: var(--green); width: 0; transition: width .25s; }
.stepper .meter-label { font-size: .78rem; color: var(--muted); margin: 0 .2rem; }
.step-head { margin-bottom: .4rem; }
.step-head .sheet-ref { font-size: .8rem; color: var(--muted); }
.subhead { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--blue); font-weight: 750; margin: 1.1rem 0 .1rem; }

/* Read-only identity panel */
.ro { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .6rem; }
.ro div { background: #f6f8fb; border: 1px dashed var(--line-strong); border-radius: .45rem; padding: .55rem .7rem; }
.ro dt { font-size: .74rem; color: var(--muted); font-weight: 650; }
.ro dd { margin: .1rem 0 0; font-weight: 650; overflow-wrap: anywhere; }
.ro .lock::before { content: "🔒 "; font-size: .8em; }

/* Review */
.review-group { border: 1px solid var(--line); border-radius: .55rem; margin: .9rem 0; overflow: hidden; }
.review-group header { display: flex; justify-content: space-between; align-items: center; padding: .6rem .9rem; background: #f4f7fa; border-bottom: 1px solid var(--line); }
.review-group table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.review-group td { padding: .45rem .9rem; border-top: 1px solid #edf1f5; vertical-align: top; }
.review-group tr:first-child td { border-top: 0; }
.review-group td.nr { width: 3.4rem; color: var(--muted); font-weight: 700; }
.review-group td.val { width: 42%; font-weight: 650; }
.review-group td.val .code { display: block; font-weight: 500; font-size: .74rem; color: var(--muted); font-family: ui-monospace, Menlo, monospace; }
.review-group td.val.empty { color: var(--amber); font-weight: 600; }
.file-preview { display: grid; grid-template-columns: auto 1fr; gap: .9rem; align-items: center; }
.file-icon { width: 3rem; height: 3.6rem; border-radius: .35rem; background: #1d6f42; color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .8rem; }
.sheet-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.sheet-list span { font-size: .75rem; font-family: ui-monospace, Menlo, monospace; border-radius: .3rem; padding: .08rem .4rem; background: #e7f3ec; color: #155c34; }
.sheet-list span.empty { background: #f0f2f5; color: #7b8796; }

/* Landing */
.hero { display: grid; grid-template-columns: 1.25fr 1fr; gap: 1.5rem; align-items: start; }
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin: 1rem 0; }
.fact { background: #fff; border-radius: .55rem; padding: .8rem .9rem; box-shadow: var(--shadow); }
.fact b { display: block; font-size: 1.15rem; }
.fact span { font-size: .84rem; color: var(--muted); }
.paths { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.path { border: 1px solid var(--line); border-radius: .6rem; padding: .9rem 1rem; background: #fff; }
.path.this { border: 2px solid var(--green); }
.path .tag { display: inline-block; font-size: .72rem; font-weight: 800; border-radius: 1rem; padding: .08rem .55rem; background: var(--green-soft); color: var(--green); margin-bottom: .3rem; }
.path.other .tag { background: #eef1f5; color: var(--muted); }
.path { display: flex; flex-direction: column; }
.path h3 { margin: .15rem 0 .4rem; font-size: 1rem; line-height: 1.35; }
.path-list { margin: 0 0 .9rem; padding-left: 1.1rem; font-size: .92rem; color: #2a3a55; flex: 1; }
.path-list li { margin: .25rem 0; }
.path .btn, .path .tag { align-self: flex-start; }
.callout.unsure { border-color: var(--green); background: var(--green-soft); margin-top: .9rem; }
.checkbox-row { display: grid; grid-template-columns: auto 1fr; gap: .6rem; align-items: start; margin: .65rem 0; }
.checkbox-row input { margin-top: .3rem; width: 1.05rem; height: 1.05rem; }
fieldset { border: 1px solid var(--line-strong); border-radius: .5rem; padding: .7rem 1rem; margin: 1rem 0; }
legend { font-weight: 700; padding: 0 .3rem; }
.honeypot { position: absolute; left: -9999px; }

/* Receipt */
.receipt-id { font-size: 1.35rem; font-weight: 800; letter-spacing: .02em; background: #f4f7fa; border: 1px dashed var(--line-strong); border-radius: .5rem; padding: .7rem 1rem; display: inline-block; }
.timeline { list-style: none; padding: 0; margin: .5rem 0; }
.timeline li { position: relative; padding: 0 0 .9rem 1.8rem; }
.timeline li::before { content: ""; position: absolute; left: .35rem; top: .35rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--line-strong); }
.timeline li.done::before { background: var(--green); }
.timeline li::after { content: ""; position: absolute; left: .67rem; top: 1.15rem; bottom: .1rem; width: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }

/* Design annotations (mockup only) */
.note { display: none; border: 1.5px dashed var(--note); background: var(--note-soft); color: #3b2a8a; border-radius: .45rem; padding: .5rem .7rem; font-size: .84rem; margin: .5rem 0; }
.note b { color: #2c1c78; }
body.show-notes .note { display: block; }
.notes-toggle { position: fixed; right: 1rem; bottom: 1rem; z-index: 50; background: var(--note); color: #fff; border: 0; border-radius: 2rem; padding: .6rem 1rem; font: inherit; font-weight: 700; box-shadow: 0 4px 16px #0003; cursor: pointer; }
.mock-banner { background: var(--note); color: #fff; text-align: center; font-size: .82rem; font-weight: 650; padding: .3rem 1rem; }
.mock-banner a { color: #fff; }

/* Field map table */
.map-table { width: 100%; border-collapse: collapse; font-size: .86rem; background: #fff; }
.map-table th { position: sticky; top: 0; background: var(--navy); color: #fff; text-align: left; padding: .5rem .55rem; font-size: .78rem; z-index: 1; }
.map-table td { padding: .5rem .55rem; border-top: 1px solid var(--line); vertical-align: top; }
.map-table tr.group td { background: #e9eff6; font-weight: 800; color: var(--navy); }
.map-table .t { display: inline-block; border-radius: 1rem; padding: .05rem .5rem; font-weight: 750; font-size: .74rem; white-space: nowrap; }
.t.ask { background: var(--green-soft); color: var(--green); }
.t.registration { background: var(--blue-soft); color: var(--blue); }
.t.auto { background: #eef0ff; color: #3d3aa8; }
.t.consent { background: #fff0f6; color: #a1195b; }
.t.omit { background: #f0f2f5; color: #6a7686; }
.t.route { background: #fff4e8; color: #a14a0e; }
.evidence { color: #7a4100; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
.q-list { counter-reset: q; list-style: none; padding: 0; }
.q-list li { counter-increment: q; background: #fff; border-radius: .5rem; padding: .75rem .9rem .75rem 3rem; margin: .5rem 0; position: relative; box-shadow: var(--shadow); }
.q-list li::before { content: "Q" counter(q); position: absolute; left: .8rem; top: .8rem; font-weight: 800; color: var(--note); font-size: .85rem; }
.q-list li b { display: block; }

@media (max-width: 60rem) {
  .wizard { grid-template-columns: 1fr; }
  .stepper { position: static; }
  .stepper ol { display: flex; overflow-x: auto; gap: .2rem; }
  .stepper button { white-space: nowrap; }
  .stepper .sheet { display: none; }
  .hero { grid-template-columns: 1fr; }
}
@media (max-width: 40rem) {
  .site-header { flex-direction: column; align-items: flex-start; }
  .q-body { margin-left: 0; }
  .facts, .paths { grid-template-columns: 1fr; }
  .card { padding: 1rem; }
  .choices { grid-template-columns: 1fr; }
  .review-group table, .review-group tbody, .review-group tr, .review-group td { display: block; width: auto !important; }
  .review-group tr { border-top: 1px solid #edf1f5; padding: .35rem 0; }
  .review-group tr:first-child { border-top: 0; }
  .review-group td { border-top: 0; padding: .1rem .9rem; }
  .device { flex-wrap: wrap; }
}
@media print {
  .site-header nav, .stepper, .actions, .notes-toggle, .mock-banner, .note { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}

/* ---- production additions (web form app) ---- */
[hidden] { display: none !important; }
.no-js .js-only { display: none !important; }
.js .step:not(.active) { display: none; }
.js body.on-start .wizard { display: none; }
.no-js .wizard { grid-template-columns: 1fr; }
.no-js .step.card { margin-bottom: 1.5rem; }
.step[data-step="start"] { margin-bottom: 1rem; }
.wizard-main { min-width: 0; }
.has-error > .q-head .q-nr, fieldset.has-error { box-shadow: inset 0 0 0 2px var(--red); }
.q.has-error { background: linear-gradient(90deg, var(--red-soft), transparent 40%); border-radius: .4rem; padding-left: .5rem; }
.small-nr { margin-right: .4rem; min-width: 2.2rem; display: inline-block; }
.btn.link.clear { font-size: .82rem; padding: .35rem 0 0; }
.sheet-ref { font-size: .8rem; color: var(--muted); }
.token-title { margin: 1rem 0 .3rem; }
.summary-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.summary-table td { padding: .4rem .5rem; border-top: 1px solid var(--line); vertical-align: top; }
.summary-table td.nr { width: 3.4rem; color: var(--muted); font-weight: 700; }
.summary-table td.val { font-weight: 650; width: 40%; }
.done-page main { max-width: 52rem; }
.narrow { margin: 0 auto; }
@media (max-width: 40rem) {
  .summary-table, .summary-table tbody, .summary-table tr, .summary-table td { display: block; width: auto !important; }
  .summary-table tr { border-top: 1px solid var(--line); padding: .3rem 0; }
  .summary-table td { border-top: 0; padding: .1rem 0; }
}
@media print {
  .site-header nav, .site-footer nav, .btn { display: none !important; }
}
.facts.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 40rem) { .facts.two { grid-template-columns: 1fr; } }
.receipt-id { overflow-wrap: anywhere; max-width: 100%; }
