/* ratingwin – Basisstil. Markenfarben kommen aus /branding.css (--brand, --accent). */
:root {
  --brand: #1F3A5F;
  --accent: #E8A33D;
  --ink: #1d232b;
  --muted: #5b6573;
  --line: #dfe3e8;
  --bg: #f6f7f9;
  --card: #ffffff;
  --good: #1e7b4a;
  --warn: #b7791f;
  --bad: #b42318;
  --radius: 10px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; font-size: 16px; }
a { color: var(--brand); }
a:hover { text-decoration-thickness: 2px; }
img { max-width: 100%; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 10; }

/* Kopfzeile */
.top { background: var(--card); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); font-weight: 700; font-size: 18px; }
.brand img { height: 36px; width: auto; }
.brand .product { color: var(--muted); font-weight: 500; font-size: 14px; border-left: 1px solid var(--line); padding-left: 12px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; align-items: center; }
.nav a, .nav button.link { padding: 8px 10px; border-radius: 8px; text-decoration: none; color: var(--ink); font-size: 15px; background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav a:hover, .nav button.link:hover { background: var(--bg); }
.nav .who { color: var(--muted); font-size: 14px; padding: 0 8px; border-left: 1px solid var(--line); }
@media (max-width: 1360px) { .nav .who .role { display: none; } }
.nav form { margin: 0; }

main { padding: 32px 0 56px; }
h1 { font-size: 30px; line-height: 1.2; margin: 0 0 8px; letter-spacing: -0.01em; }
h2 { font-size: 21px; margin: 32px 0 12px; }
h3 { font-size: 17px; margin: 0 0 6px; }
.lead { color: var(--muted); font-size: 18px; margin: 0 0 24px; max-width: 62ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 16px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* Buttons und Formulare */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--brand); background: var(--brand); color: #fff; padding: 10px 18px; border-radius: 8px; font: 600 15px var(--font); cursor: pointer; text-decoration: none; min-height: 44px; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: #fff; color: var(--brand); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #1d232b; }
.btn.danger { background: #fff; color: var(--bad); border-color: var(--bad); }
.btn.small { padding: 6px 12px; min-height: 34px; font-size: 14px; }
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #c5ccd5; border-radius: 8px; font: 15px var(--font); background: #fff; color: var(--ink); }
textarea { min-height: 72px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); outline-offset: 2px; }
.field { margin-bottom: 16px; }
.hint { color: var(--muted); font-size: 13px; margin-top: 4px; }
.form-narrow { max-width: 440px; }
.check { display: flex; gap: 8px; align-items: center; font-weight: 500; }

/* Meldungen */
.flash { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; }
.flash.ok { background: #ecf7f0; border-color: #b7e0c6; color: #14532d; }
.flash.error { background: #fdeeee; border-color: #f3c0bd; color: #7a1d16; }

/* Tabellen */
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #fafbfc; }
tr:last-child td { border-bottom: 0; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

/* Badges */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #eef1f4; color: var(--ink); white-space: nowrap; }
.badge.stark { background: #e3f4ea; color: var(--good); }
.badge.solide { background: #fdf3df; color: #8a5a10; }
.badge.kritisch { background: #fde7e5; color: var(--bad); }
.badge.status-freigegeben { background: #e3f4ea; color: var(--good); }
.badge.status-rueckfrage { background: #fde7e5; color: var(--bad); }
.badge.status-zur_freigabe, .badge.status-in_pruefung, .badge.status-eingereicht { background: #e8eef7; color: var(--brand); }

/* Landingpage */
.hero { background: var(--brand); color: #fff; padding: 64px 0 56px; }
.hero h1 { font-size: clamp(30px, 5vw, 46px); max-width: 20ch; }
.hero .lead { color: rgba(255,255,255,.88); font-size: 19px; }
.hero .btn.secondary { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.hero .eyebrow { text-transform: uppercase; letter-spacing: .12em; font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 12px; }
.rule { font-size: 18px; border-left: 4px solid var(--accent); padding: 4px 0 4px 16px; margin: 0; }
.fieldcard { border-top: 4px solid var(--brand); }
.fieldcard .w { color: var(--muted); font-size: 13px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #1d232b; font-weight: 700; margin-bottom: 8px; }
.footer { border-top: 1px solid var(--line); background: var(--card); padding: 20px 0; font-size: 14px; color: var(--muted); }
.footer .wrap { display: flex; gap: 16px; flex-wrap: wrap; }

/* Bewertungsformular */
.fieldblock { margin-top: 28px; }
.fieldblock > h2 { display: flex; gap: 12px; align-items: baseline; }
.crit { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 12px; }
.crit .code { color: var(--muted); font-weight: 600; margin-right: 6px; }
.anchors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 12px 0; font-size: 13px; }
.anchors div { background: var(--bg); border-radius: 8px; padding: 8px 10px; }
.anchors strong { display: block; font-size: 12px; color: var(--muted); }
.scale { display: flex; gap: 6px; flex-wrap: wrap; border: 0; padding: 0; margin: 0 0 10px; }
.scale legend { font-weight: 600; font-size: 14px; margin-bottom: 6px; padding: 0; }
.scale label { margin: 0; }
.scale input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale span { display: inline-grid; place-items: center; min-width: 44px; height: 44px; border: 1px solid #c5ccd5; border-radius: 8px; font-weight: 600; cursor: pointer; background: #fff; }
.scale input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
.scale input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.scale input:disabled + span { cursor: default; opacity: .75; }
.scale .clear span { min-width: auto; padding: 0 10px; font-weight: 500; color: var(--muted); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.selfbox { background: #f3f5f8; border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(246,247,249,.96); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 24px; }

/* Ergebnis */
.result { display: grid; gap: 8px; }
.bar { display: grid; grid-template-columns: 220px 1fr 64px 90px; gap: 12px; align-items: center; font-size: 15px; }
.bar progress { width: 100%; height: 10px; appearance: none; -webkit-appearance: none; border: 0; border-radius: 99px; background: #e8ebef; overflow: hidden; }
.bar progress::-webkit-progress-bar { background: #e8ebef; border-radius: 99px; }
.bar progress::-webkit-progress-value { background: var(--brand); border-radius: 99px; }
.bar progress::-moz-progress-bar { background: var(--brand); border-radius: 99px; }
.total { font-size: 34px; font-weight: 700; }

/* Dossier / Druck */
.dossier { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 40px; }
.dossier header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; border-bottom: 3px solid var(--brand); padding-bottom: 16px; margin-bottom: 24px; }
.dossier header img { max-height: 48px; }
.watermark { border: 2px dashed var(--bad); color: var(--bad); padding: 8px 12px; border-radius: 8px; font-weight: 700; display: inline-block; }
.disclaimer { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); margin-top: 32px; padding-top: 12px; }

/* Selbstcheck */
.sc-q { margin-bottom: 18px; }
.sc-out { display: none; }
.sc-out.show { display: block; }

@media (max-width: 760px) {
  .anchors, .two { grid-template-columns: 1fr; }
  .bar { grid-template-columns: 1fr 48px 80px; }
  .bar progress { grid-column: 1 / -1; order: 3; }
  .dossier { padding: 20px; }
  .nav { margin-left: 0; }
}
@media print {
  .top, .footer, .no-print, .sticky-actions { display: none !important; }
  body { background: #fff; }
  main { padding: 0; }
  .dossier { border: 0; padding: 0; }
  .crit { break-inside: avoid; }
}

/* Abstände (keine Inline-Styles wegen CSP) */
.mt0 { margin-top: 0; } .mt16 { margin-top: 16px; } .mt32 { margin-top: 32px; } .mb0 { margin-bottom: 0; }
