/* ============================================================
   Funnel-Engine: Layout & Komponenten (Aufbau wie JOBMEDI,
   Optik ABI Zukunft). Farben/Radien/Schriften: ../theme.css
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg-page); color: var(--ink); font-family: var(--font-body); line-height: 1.45; }

/* Mobile first: füllt das Handy; auf dem Desktop dieselbe Darstellung als zentrierte Spalte. */
.device { width: 100%; min-height: 100dvh; background: var(--bg-frame); display: flex; flex-direction: column; margin: 0 auto; }
@media (min-width: 540px) {
  body { padding: 32px 0; }
  .device { max-width: 430px; min-height: calc(100dvh - 64px); border-radius: 28px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.3); overflow: hidden; }
}

/* --- Kopf: orange Leiste mit weißem Logo (wie Matching-Tool Würzburg) --- */
header.top { display: flex; justify-content: center; align-items: center; padding: 12px 20px; background: var(--accent); min-height: 72px; position: relative; }
header.top a { display: block; line-height: 0; }
header.top .logo { display: block; height: 48px; width: auto; max-width: 160px; object-fit: contain; }
.progress { height: 4px; background: var(--line); margin: 0; overflow: hidden; }
.progress > span { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s ease; }
.progress.hidden { display: none; }
main { flex: 1; display: flex; flex-direction: column; }

/* --- Banner & Meta --- */
.banner { background: var(--brand); color: var(--on-brand); padding: 22px 24px 24px; text-align: center; }
.banner .eyebrow { display: block; font-size: .95rem; font-weight: 700; margin-bottom: 8px; }
.banner h1 { font-family: var(--font-display); font-weight: 700; font-size: 1.75rem; line-height: 1.15; margin: 0; text-wrap: balance; }
.meta-row { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 18px; padding: 16px 20px 4px; }
.meta-item { display: flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 500; }
.meta-item svg { width: 16px; height: 16px; stroke: var(--accent); fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

.photo { display: block; width: calc(100% - 40px); margin: 16px 20px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-card); background: #e7e2dc; }

.content { padding: 4px 20px 28px; }

/* --- Quiz (Antworten als blaue Kacheln wie im Würzburger Matching-Tool) --- */
.quiz-q { padding: 32px 22px 4px; text-align: center; }
.quiz-q h2 { font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; line-height: 1.25; margin: 0 0 18px; text-wrap: balance; }
.quiz-q .hint { font-size: .92rem; color: var(--muted); margin: -8px 0 18px; }
.card-grid { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }
.card {
  display: flex; align-items: center; gap: 14px; width: 100%;
  border: none; padding: 18px 16px; cursor: pointer; text-align: left;
  font-family: var(--font-body); background: var(--brand); color: var(--on-brand);
  border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0,0,0,.12);
  transition: transform .12s ease, background .12s ease; -webkit-tap-highlight-color: transparent;
}
.card:hover { background: var(--brand-dark); }
.card:active { transform: scale(.98); }
.card:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.card-top { flex-shrink: 0; width: 34px; height: 34px; display: flex; align-items: center; justify-content: center; }
.card-top svg { width: 30px; height: 30px; fill: #fff; }
.card-label { flex: 1; font-size: calc(1rem * var(--btn-scale)); font-weight: 700; line-height: 1.3; hyphens: auto; overflow-wrap: anywhere; }
.card.grey { background: #8a8f96; }
.card.grey:hover { background: #747980; }

/* --- Bullets --- */
.bullets { display: flex; flex-direction: column; gap: 16px; margin: 4px 0 24px; }
.bullet { display: flex; gap: 14px; align-items: flex-start; }
.bullet .ic { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.bullet .ic svg { width: 22px; height: 22px; fill: currentColor; }
.bullet .txt { padding-top: 2px; }
.bullet .txt strong { display: block; font-size: .98rem; margin-bottom: 2px; }
.bullet .txt span { display: block; font-size: .9rem; color: var(--muted); line-height: 1.45; }

/* --- Buttons --- */
.btn-stack { display: flex; flex-direction: column; gap: 12px; }
.btn {
  display: flex; align-items: center; justify-content: center; width: 100%; min-height: 54px;
  border: none; border-radius: var(--radius); padding: calc(15px * var(--btn-scale)) 20px;
  font-family: var(--font-body); font-weight: 700; font-size: calc(1rem * var(--btn-scale));
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
}
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-dark); }
.btn-secondary { background: #eef0f2; color: var(--ink); }
.btn-secondary:hover { filter: brightness(.96); }
.btn[disabled] { opacity: .6; cursor: default; }

/* --- Formular --- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85rem; font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 14px; border: 1.5px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 16px; background: var(--field-bg); color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--brand); }
.consent { display: flex; align-items: flex-start; gap: 10px; margin: 18px 0 20px; font-size: .84rem; color: var(--muted); line-height: 1.45; }
.consent input { margin-top: 2px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--brand); }
.consent a { color: var(--ink); }

/* --- Footer --- */
footer.legal { text-align: center; padding: 16px 20px 22px; font-size: .78rem; color: var(--muted); border-top: 4px solid var(--accent); }
footer.legal a { color: inherit; }
footer.legal .who { display: block; margin-bottom: 6px; line-height: 1.4; }

/* --- Datenschutzhinweis (kompakt) --- */
.consent-sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; padding: 8px; display: flex; justify-content: center; }
.consent-box { width: 100%; max-width: 430px; background: #fff; color: #262a29; box-shadow: 0 -8px 40px rgba(0,0,0,.25); display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 12px 14px; border-radius: 16px; }
.consent-box strong { display: none; }
.consent-box p { flex: 1 0 100%; font-size: .76rem; line-height: 1.4; margin: 0; color: #6d7170; }
.consent-box p a { color: #262a29; }
.consent-box button { border: none; border-radius: 10px; font-weight: 700; cursor: pointer; font-family: inherit; }
.consent-box .ok { flex: 1; background: var(--brand); color: #fff; padding: 11px 10px; font-size: .9rem; }
.consent-box .min { background: none; color: #262a29; padding: 6px 2px; font-size: .74rem; }

/* --- Editor (nur mit ?edit in der URL sichtbar) --- */
body.edit-mode [contenteditable="true"] { cursor: text; outline: 1px dashed rgba(233,78,25,.7); outline-offset: 2px; border-radius: 3px; }
body.edit-mode [contenteditable="true"]:focus { outline: 2px solid var(--accent); background: rgba(233,78,25,.06); }
body.edit-mode img[data-swap] { cursor: pointer; outline: 2px dashed rgba(233,78,25,.8); outline-offset: -2px; }
body.has-toolbar { padding-bottom: 76px; }
#fx-toolbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; padding: 10px; background: rgba(25,23,23,.94); }
.fx-btn { border: none; border-radius: 999px; padding: 9px 14px; font: 600 .8rem system-ui, sans-serif; background: #fff; color: #191717; cursor: pointer; white-space: nowrap; text-decoration: none; }
.fx-btn.on { background: var(--accent); color: #fff; }
#fx-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 85; }
#fx-backdrop.open { display: block; }
#fx-panel { position: fixed; top: 0; right: 0; width: 320px; max-width: 92vw; height: 100%; background: #fff; color: #191717; box-shadow: -12px 0 32px rgba(0,0,0,.2); z-index: 86; padding: 20px 20px 90px; overflow-y: auto; font: 14px system-ui, sans-serif; transform: translateX(100%); transition: transform .2s ease; }
#fx-panel.open { transform: translateX(0); }
#fx-panel h3 { font-size: 1.05rem; margin: 0 0 4px; }
#fx-panel .sub { font-size: .78rem; color: #6d7170; margin: 0 0 18px; line-height: 1.4; }
#fx-panel .row { margin-bottom: 14px; }
#fx-panel label { display: flex; justify-content: space-between; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: #6d7170; margin-bottom: 5px; }
#fx-panel label .val { text-transform: none; letter-spacing: 0; color: #191717; }
#fx-panel input[type="color"] { width: 100%; height: 36px; border: 1px solid #d4d5d4; border-radius: 6px; padding: 2px; cursor: pointer; }
#fx-panel input[type="range"] { width: 100%; }
#fx-panel .actions { display: flex; flex-direction: column; gap: 8px; margin-top: 20px; }
#fx-panel .actions button { border: none; border-radius: 6px; padding: 11px 14px; font-weight: 700; font-size: .85rem; cursor: pointer; font-family: inherit; }
#fx-panel .actions .primary { background: var(--accent); color: #fff; }
#fx-panel .actions .plain { background: #f0f0f0; color: #191717; }
#fx-panel .close { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: #6d7170; }
.fx-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 95; align-items: center; justify-content: center; padding: 20px; }
.fx-overlay.show { display: flex; }
.fx-box { background: #fff; color: #191717; padding: 18px; border-radius: 12px; max-width: 460px; width: 100%; font: 14px system-ui, sans-serif; }
.fx-box p { margin: 0 0 10px; font-size: .85rem; }
.fx-box textarea { width: 100%; height: 240px; font: 12px ui-monospace, monospace; border: 1px solid #d4d5d4; border-radius: 6px; padding: 8px; margin-bottom: 10px; }
.fx-box button { background: #191717; color: #fff; border: none; border-radius: 6px; padding: 9px 16px; font-weight: 700; font-size: .82rem; cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .card, .progress > span, #fx-panel { transition: none; } }
