/* CVJM-Strukturencheck – Gestaltung nach den CVJM-Gestaltungsrichtlinien (v3, 2019):
   eine Hauptfarbe CVJM-Rot, Source Sans Pro, eckige Formen, Dreiecksraster nur rechts unten. */

@font-face { font-family: "Source Sans Pro"; src: url("fonts/SourceSansPro-Light.otf") format("opentype"); font-weight: 300; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("fonts/SourceSansPro-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("fonts/SourceSansPro-Semibold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("fonts/SourceSansPro-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Source Sans Pro"; src: url("fonts/SourceSansPro-Black.otf") format("opentype"); font-weight: 900; font-display: swap; }

:root {
  --red: #e40038;
  --red-dark: #92011f;
  --black: #000000;
  --fg: #1a1a1a;
  --muted: #333333;
  --grey: #ebe8e3;
  --grey-2: #d8d2ca;
  --rule: rgba(0, 0, 0, 0.55);
  --rule-soft: rgba(0, 0, 0, 0.12);
  --font: "Source Sans Pro", Arial, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--grey); color: var(--fg); font-family: var(--font); -webkit-text-size-adjust: 100%; }
button, input, textarea { font-family: inherit; font-size: inherit; }
button { cursor: pointer; }
a { color: var(--red); }
a:hover { color: var(--red-dark); }
:focus-visible { outline: 3px solid var(--black); outline-offset: 2px; }

#app { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; background: #fff; position: relative; }

/* Kopfzeile */
.bar { position: sticky; top: 0; z-index: 5; height: 56px; display: flex; align-items: center; gap: 4px; padding: 0 8px; background: #fff; border-bottom: 1px solid var(--rule-soft); }
.bar h1 { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 700; color: var(--black); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 44px; height: 44px; background: none; border: 0; display: flex; align-items: center; justify-content: center; }
.chip { font-size: 13px; font-weight: 700; color: #fff; background: var(--black); padding: 5px 8px; letter-spacing: 0.04em; }

.main { flex: 1; padding: 20px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.main.soft { background: var(--grey); }
.foot { position: sticky; bottom: 0; z-index: 5; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; background: #fff; border-top: 1px solid var(--rule-soft); }

.eb { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--red); text-transform: uppercase; }
.h2 { margin: 0; font-size: 24px; line-height: 1.2; font-weight: 700; color: var(--black); }
.p { margin: 0; font-size: 16px; line-height: 1.45; }
.small { font-size: 15px; color: var(--muted); }

/* Buttons – eckig, flach */
.btn { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 52px; padding: 0 16px; border-radius: 0; font-size: 17px; font-weight: 700; border: 0; text-decoration: none; }
.btn.primary { background: var(--red); color: #fff; }
.btn.primary:hover { background: #cb0031; }
.btn.secondary { background: #fff; color: var(--black); border: 1.5px solid var(--black); }
.btn.dark { background: var(--black); color: #fff; }
.btn.light { background: #fff; color: var(--black); }
.btn.btn[disabled] { background: var(--grey-2); color: var(--fg); cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 10px 4px; min-height: 44px; font-size: 16px; font-weight: 600; color: var(--black); text-decoration: underline; }

/* Felder */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .lbl { font-size: 14px; font-weight: 700; color: var(--black); }
.inp { min-height: 48px; width: 100%; border: 1.5px solid var(--rule); border-radius: 0; padding: 10px 12px; font-size: 16px; color: var(--fg); background: #fff; }
.inp:focus { border-color: var(--red); outline: none; box-shadow: 0 0 0 2px var(--red); }
textarea.inp { resize: vertical; line-height: 1.4; }
.code-inp { font-size: 24px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.err { background: #fff; border: 2px solid var(--red); color: var(--black); padding: 12px 14px; font-size: 15px; line-height: 1.4; }

/* Start */
.logo-band { height: 92px; display: flex; align-items: center; padding: 0 20px; background: #fff; }
.logo-band img { height: 50px; width: auto; }
.hero { flex: 1; position: relative; overflow: hidden; background: var(--red); color: #fff; display: flex; flex-direction: column; }
.raster { position: absolute; right: 0; bottom: 0; pointer-events: none; }
.hero .raster { width: 300px; opacity: 0.22; }
.hero-text { position: relative; padding: 36px 24px 0; display: flex; flex-direction: column; gap: 14px; }
.hero h1 { margin: 0; font-size: 44px; line-height: 1; font-weight: 700; hyphens: manual; }
.hero .sub { font-size: 21px; line-height: 1.25; font-weight: 700; }
.hero p { margin: 0; font-size: 16px; line-height: 1.45; font-weight: 300; }
.hero-actions { position: relative; margin-top: auto; padding: 24px 24px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 10px; }

/* Tabs */
.tabs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1.5px solid var(--black); }
.tabs button { min-height: 46px; border: 0; border-radius: 0; font-size: 16px; font-weight: 700; background: #fff; color: var(--black); }
.tabs button[aria-pressed="true"] { background: var(--black); color: #fff; }

.codebox { background: var(--grey); padding: 16px; display: flex; gap: 16px; align-items: center; }
.codebox .qr { width: 112px; height: 112px; flex-shrink: 0; background: #fff; }
.codebox .qr svg { display: block; width: 100%; height: 100%; }

/* Impressum / Datenschutz */
.legal { display: flex; gap: 20px; flex-wrap: wrap; font-size: 15px; }
.legal a { display: inline-flex; align-items: center; min-height: 44px; color: var(--black); font-weight: 600; }
.legal.on-red a { color: #fff; }
/* Weißes Band unter der Startfläche: Methoden-Hinweis + Rechtliches (nicht auf dem Raster) */
.start-foot { padding: 14px 24px calc(10px + env(safe-area-inset-bottom)); background: #fff; display: flex; flex-direction: column; gap: 4px; }
.hint { display: flex; flex-direction: column; gap: 4px; width: 100%; min-height: 44px; padding: 12px 14px; text-align: left; border-radius: 0; background: var(--grey); border: 0; border-left: 4px solid var(--red); color: var(--black); }
.hint-t { font-size: 17px; font-weight: 700; line-height: 1.3; text-decoration: underline; text-underline-offset: 3px; }
.hint:hover .hint-t { color: var(--red-dark); }

/* Methodenübersicht */
.method { display: flex; flex-direction: column; gap: 8px; }
.method-t { margin: 0; font-size: 21px; line-height: 1.2; font-weight: 700; color: var(--black); }
.method-lead { font-weight: 600; }
.legal-page { max-width: 720px; padding: 24px 20px 48px; display: flex; flex-direction: column; gap: 14px; }
.legal-page h1 { margin: 0; font-size: 32px; line-height: 1.1; font-weight: 700; }
.legal-page h2 { margin: 18px 0 0; font-size: 20px; line-height: 1.25; font-weight: 700; }
.legal-page p, .legal-page li { margin: 0; font-size: 16px; line-height: 1.5; }
.legal-page ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.legal-page a { color: var(--black); }
.legal-page .note { background: var(--grey); padding: 12px 14px; font-size: 15px; }
.code { font-size: 30px; font-weight: 900; letter-spacing: 0.04em; color: var(--red); }

/* Rollen */
.choice { width: 100%; min-height: 64px; padding: 10px 16px; text-align: left; border-radius: 0; background: #fff; color: var(--black); border: 1.5px solid var(--rule); }
.choice b { display: block; font-size: 17px; }
.choice span { display: block; font-size: 14px; margin-top: 2px; }
.choice[aria-pressed="true"] { background: var(--red); color: #fff; border: 2px solid var(--red); }
.seg { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.seg-btn { min-height: 52px; padding: 6px 8px; border-radius: 0; background: #fff; color: var(--black); border: 1.5px solid var(--rule); font-size: 16px; font-weight: 700; line-height: 1.2; }
.seg-btn[aria-pressed="true"] { background: var(--red); color: #fff; border-color: var(--red); }

/* These */
.progress { height: 5px; background: var(--grey); }
.progress div { height: 100%; background: var(--red); transition: width 200ms ease; }
.thesis { font-size: 22px; line-height: 1.32; font-weight: 600; color: var(--black); margin: 10px 0 14px; min-height: 116px; }
.opts { display: flex; flex-direction: column; gap: 8px; }
.opt { width: 100%; min-height: 54px; display: flex; align-items: center; gap: 14px; padding: 0 14px; text-align: left; border-radius: 0; font-size: 17px; font-weight: 600; background: #fff; color: var(--black); border: 1.5px solid var(--rule); }
.opt .n { width: 28px; font-size: 20px; font-weight: 900; color: var(--red); }
.opt.q { border-style: dashed; }
.opt.q .n { color: var(--black); }
.opt[aria-pressed="true"] { background: var(--red); color: #fff; border: 1.5px solid var(--red); font-weight: 700; }
.opt.q[aria-pressed="true"] { background: var(--black); border-color: var(--black); }
.opt[aria-pressed="true"] .n { color: #fff; }
.qnav { display: flex; justify-content: space-between; padding: 0 16px calc(12px + env(safe-area-inset-bottom)); }

/* Ergebnis */
.card { background: #fff; padding: 16px; }
.radar { width: 100%; height: auto; display: block; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 6px 8px 0; font-size: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
/* Methoden-Erklärung */
.info-btn { align-self: flex-start; padding: 6px 0; font-size: 15px; color: var(--red-dark); }
.popup-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 30; }
.popup { position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); width: min(480px, 100%); max-height: 85vh; overflow-y: auto; background: #fff; border-top: 6px solid var(--red); padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; z-index: 31; }
.callout { padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.callout.red { background: var(--red); color: #fff; }
.callout.black { background: var(--black); color: #fff; }
.callout.dashed { background: #fff; border: 1.5px dashed var(--black); }
.callout .k { font-size: 13px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
.callout .t { font-size: 22px; font-weight: 700; line-height: 1.2; }
.callout .d { font-size: 15px; line-height: 1.4; }
.row3 { display: flex; flex-direction: column; gap: 2px; padding: 12px 0; border-top: 1px solid var(--rule-soft); }
.row3:first-child { border-top: 0; padding-top: 0; }
.bars { display: flex; flex-direction: column; gap: 6px; }
.barrow { display: grid; grid-template-columns: 112px minmax(0, 1fr) 34px; gap: 8px; align-items: center; font-size: 15px; }
.barrow .track { height: 12px; background: var(--grey); }
.barrow .fill { height: 100%; background: var(--black); }
.barrow .fill.min { background: var(--red); }
.barrow .v { text-align: right; font-weight: 700; }

/* Schritte */
.step { background: #fff; padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.step .num { font-size: 24px; font-weight: 900; color: var(--red); line-height: 1; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }

/* Strukturbrief */
.brief { background: #fff; position: relative; overflow: hidden; padding: 22px 20px 150px; display: flex; flex-direction: column; gap: 12px; }
.brief .raster { width: 140px; }
.brief-step { display: flex; gap: 10px; }
.brief-step .num { font-size: 18px; font-weight: 900; color: var(--red); line-height: 1.2; }

.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom)); width: min(448px, calc(100% - 32px)); background: var(--black); color: #fff; padding: 14px 16px; font-size: 15px; line-height: 1.4; z-index: 20; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media print {
  html, body { background: #fff; }
  #app { max-width: none; }
  .bar, .foot, .toast, .no-print { display: none !important; }
  .main.soft { background: #fff; padding: 0; }
  .brief { padding: 0 0 160px; }
}
