/* SEO-Audit: calm, readable, responsive. Colours are tokens so branding (phase 5) can replace them. */
@font-face { font-family: "Inter"; src: url("/fonts/Inter-Regular.otf") format("opentype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-Medium.otf") format("opentype"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-SemiBold.otf") format("opentype"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/Inter-Bold.otf") format("opentype"); font-weight: 700; font-display: swap; }

:root {
  --brand: #2f4b6e;          /* neutral placeholder until branding */
  --brand-ink: #ffffff;
  --accent: #3d7a6e;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --ink: #1d2430;
  --muted: #5d6675;
  --line: #dfe3e9;
  --ok: #2e7d4f;
  --ok-bg: #e7f4ec;
  --warn: #8a5a00;
  --warn-bg: #fdf3dc;
  --error: #a3322b;
  --error-bg: #fbe9e7;
  --info: #2f5f8f;
  --info-bg: #e8f0f8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(20, 30, 50, .06), 0 2px 8px rgba(20, 30, 50, .05);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font); }
a { color: var(--brand); }
a:hover { color: var(--accent); }
h1, h2 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.6rem; font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 600; }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .9rem; word-break: break-all; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--surface); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.main { padding-top: 1.75rem; padding-bottom: 2rem; min-height: 70vh; }

/* top bar */
.topbar { background: var(--brand); color: var(--brand-ink); }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 60px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--brand-ink); text-decoration: none; font-weight: 600; font-size: 1.05rem; }
.brand:hover { color: var(--brand-ink); }
.brand-mark { width: 22px; height: 22px; border-radius: 6px; background: var(--brand-ink); opacity: .9; box-shadow: inset 0 0 0 5px var(--accent); }
.nav { display: flex; align-items: center; gap: .25rem; flex-wrap: wrap; }
.nav a, .nav-button { color: var(--brand-ink); text-decoration: none; padding: .45rem .7rem; border-radius: 8px; font: inherit; font-size: .95rem; opacity: .88; }
.nav a:hover, .nav-button:hover { background: rgba(255, 255, 255, .12); opacity: 1; color: var(--brand-ink); }
.nav a[aria-current="page"] { background: rgba(255, 255, 255, .18); opacity: 1; }
.nav-button { background: none; border: 0; cursor: pointer; }
form.inline { display: inline; margin: 0; }

/* cards and layout */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; }
.card-narrow { max-width: 460px; margin: 2rem auto; }
.card-flush { padding: 0; overflow: hidden; }
.page-head { margin-bottom: 1.25rem; }
.page-head-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.eyebrow { margin: 0 0 .25rem; font-size: .9rem; }
.layout-2 { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.25rem; align-items: start; }
.layout-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.side .card { margin-bottom: 1.25rem; }
.empty { text-align: center; padding: 2.5rem 1rem; }
.footer { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .85rem; padding-top: 1rem; padding-bottom: 2rem; border-top: 1px solid var(--line); }

/* forms */
.form label { display: block; font-weight: 500; margin: .9rem 0 .3rem; }
.form fieldset { border: 0; padding: 0; margin: 0 0 1.25rem; }
.form legend { font-weight: 600; font-size: 1.05rem; padding: 0; margin-bottom: .25rem; }
.form fieldset + fieldset { border-top: 1px solid var(--line); padding-top: 1rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="url"], input[type="tel"], select {
  width: 100%; padding: .6rem .75rem; border: 1px solid #c9cfd8; border-radius: 8px; font: inherit; background: #fff; color: var(--ink);
}
input:focus { border-color: var(--accent); }
input:disabled { background: #f0f2f5; color: var(--muted); }
.hint { color: var(--muted); font-size: .88rem; margin: .3rem 0 0; }
.req, .opt { font-weight: 400; color: var(--muted); font-size: .88rem; }
.check { display: flex !important; gap: .6rem; align-items: flex-start; font-weight: 400 !important; margin-top: 1rem !important; }
.check input { margin-top: .3rem; }
.check-disabled { color: var(--muted); }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin-top: .5rem; }
.choice { display: flex !important; gap: .6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: .75rem .9rem; margin: 0 !important; font-weight: 400 !important; cursor: pointer; }
.choice input { margin-top: .3rem; }
.choice:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, #fff); }
.choice-disabled { cursor: not-allowed; opacity: .7; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.stack { display: grid; gap: .6rem; }
.stack form { margin: 0; }

/* buttons */
.button { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; padding: .55rem 1rem; border-radius: 8px; border: 1px solid #c9cfd8;
  background: #fff; color: var(--ink); font: 500 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer;
  box-sizing: border-box; margin: 0; vertical-align: middle; -webkit-appearance: none; appearance: none; }
.button:hover { border-color: var(--brand); color: var(--brand); }
.button-primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.button-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.button-small { padding: .35rem .65rem; font-size: .85rem; }
.button-danger { background: var(--error); border-color: var(--error); color: #fff; }
.button-danger:hover { background: #82241f; color: #fff; border-color: #82241f; }
.button-danger-quiet:hover { border-color: var(--error); color: var(--error); }
.form > .button-primary { margin-top: 1.25rem; }
.form > .actions { margin-top: 1.25rem; }
.actions > form { margin: 0; display: inline-flex; }
.stack .button { width: 100%; }

/* messages */
.flash { border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1rem; border: 1px solid transparent; }
.flash ul { margin: .4rem 0 0; padding-left: 1.2rem; }
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: #cbe7d5; }
.flash-warn { background: var(--warn-bg); color: var(--warn); border-color: #f2dfb0; }
.flash-error { background: var(--error-bg); color: var(--error); border-color: #f2c9c4; }

/* badges */
.badge { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.badge-large { font-size: .95rem; padding: .35rem .9rem; }
.badge-queued { background: #eceff3; color: var(--muted); }
.badge-running { background: var(--info-bg); color: var(--info); }
.badge-done { background: var(--ok-bg); color: var(--ok); }
.badge-failed { background: var(--error-bg); color: var(--error); }
.badge-cancelled { background: var(--warn-bg); color: var(--warn); }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th { text-align: left; font-weight: 600; font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; background: #fafbfc; }
.table th, .table td { padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fafbfd; }
.table-plain td { padding: .55rem 0; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions form, .row-actions a { margin-left: .25rem; }
.dl { display: inline-block; margin-right: .5rem; font-size: .9rem; }

/* progress */
.stages { list-style: none; margin: .5rem 0 1rem; padding: 0; display: grid; gap: .35rem; }
.stage { display: flex; align-items: center; gap: .7rem; padding: .45rem .6rem; border-radius: 8px; color: var(--muted); }
.stage-n { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .82rem; font-weight: 600;
  background: #eceff3; color: var(--muted); flex: none; }
.stage-done { color: var(--ink); }
.stage-done .stage-n { background: var(--ok); color: #fff; }
.stage-current { background: var(--info-bg); color: var(--info); font-weight: 600; }
.stage-current .stage-n { background: var(--info); color: #fff; animation: pulse 1.6s ease-in-out infinite; }
.stage-skipped { text-decoration: line-through; opacity: .7; }
.stage-failed { background: var(--error-bg); color: var(--error); }
.stage-failed .stage-n { background: var(--error); color: #fff; }
@keyframes pulse { 50% { opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .stage-current .stage-n { animation: none; } }
.log { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); max-height: 420px; overflow-y: auto; font-size: .92rem; }
.log li { padding: .4rem 0; border-bottom: 1px dashed var(--line); }
.log-stage, .log-stage-skipped { font-weight: 600; }
.log-error { color: var(--error); font-weight: 500; }
.log-tech { font-family: ui-monospace, Consolas, monospace; font-size: .78rem; color: var(--muted); max-height: 420px; white-space: pre-wrap; overflow-wrap: anywhere; }
.log-tech li { padding: .15rem 0; }
.details { margin-top: 1rem; }
.details summary { cursor: pointer; color: var(--muted); font-size: .9rem; }
.message { padding: .6rem .8rem; border-radius: 8px; background: #f3f5f8; }
.message-failed { background: var(--error-bg); color: var(--error); }
.message-done { background: var(--ok-bg); color: var(--ok); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; margin: 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; text-align: right; }
.score { font-size: 1.4rem; font-weight: 700; color: var(--brand); }
.downloads { display: grid; gap: .5rem; }

/* small screens */
@media (max-width: 860px) {
  .layout-2, .layout-even { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  h1 { font-size: 1.35rem; }
  .choices, .grid-2 { grid-template-columns: 1fr; }
  .card { padding: 1rem; }
  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr { padding: .6rem .9rem; border-bottom: 1px solid var(--line); }
  .table tbody tr:last-child { border-bottom: 0; }
  .table td { border: 0; padding: .2rem 0; text-align: left; }
  .table td[data-label]::before { content: attr(data-label); display: inline-block; min-width: 6.5rem; color: var(--muted); font-size: .85rem; }
  .row-actions { text-align: left; padding-top: .5rem !important; }
  .row-actions form, .row-actions a { margin: 0 .3rem 0 0; }
}

/* Branding: the logo sits on a light chip so any logo stays visible on the brand colour */
.brand-logo { display: inline-flex; align-items: center; background: #ffffff; border-radius: 6px; padding: 3px 6px; height: 34px; }
.brand-logo img { max-height: 28px; max-width: 140px; display: block; }
.fx { display: block; font-size: .72rem; color: var(--muted); font-weight: 400; }
.badge-report-entwurf { background: var(--warn-bg); color: var(--warn); }
.badge-report-freigegeben { background: var(--ok-bg); color: var(--ok); }
textarea { width: 100%; font: inherit; padding: .55rem .7rem; border: 1px solid #c9cfd8; border-radius: 8px; resize: vertical; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
@media (max-width: 760px) { .grid-3 { grid-template-columns: 1fr; } }

/* Branding settings */
#branding { margin-bottom: 1.5rem; }
.color-field { display: flex; gap: 0.5rem; align-items: center; }
.color-field input[type="color"] { width: 2.75rem; height: 2.4rem; padding: 0.15rem; border: 1px solid var(--line, #d0d5dc); border-radius: 6px; background: #fff; }
.color-field input[type="text"] { flex: 1; }
.brand-preview { border: 1px solid var(--line, #d0d5dc); border-radius: 8px; overflow: hidden; background: #fff; }
.brand-preview-bar { display: flex; gap: 0.75rem; align-items: center; padding: 0.8rem 1rem; background: var(--brand); color: var(--brand-ink); font-weight: 600; }
.brand-preview-logo { display: inline-flex; background: #fff; border-radius: 4px; padding: 0.2rem 0.4rem; }
.brand-preview-logo[hidden] { display: none; }
.brand-reset { margin-top: 1rem; }
.brand-preview-logo img { max-height: 2rem; max-width: 8rem; display: block; }
.brand-preview-body { padding: 1rem; }
.brand-preview-kicker { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.brand-preview-title { font-size: 1.15rem; font-weight: 600; margin: 0.2rem 0 0.6rem; color: #0b0b0b; }
.brand-preview-line { height: 4px; width: 4rem; background: var(--accent); border-radius: 2px; margin-bottom: 0.8rem; }
.brand-preview-chip { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.8rem; }

/* Customers */
.keyword-list { columns: 2; column-gap: 1.5rem; margin: 0; padding-left: 1.1rem; }
.keyword-list li { break-inside: avoid; margin-bottom: .2rem; }
.stack-list { list-style: none; margin: 0; padding: 0; }
.stack-list li { padding: .45rem 0; border-bottom: 1px solid var(--line); }
.stack-list li:last-child { border-bottom: 0; }
.pre-line { white-space: pre-line; }
.page-head-row > div { min-width: 0; }
@media (max-width: 640px) { .keyword-list { columns: 1; } }

/* Audit form: local check and keyword list */
.kw-grid[hidden] { display: none; }
.kw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .2rem 1rem; margin: .3rem 0 .6rem; }
.check-inline { display: flex; gap: .45rem; align-items: center; font-weight: 400; margin: 0; }
.estimate { background: #f3f6f9; border-radius: 8px; padding: .6rem .8rem; margin-top: .8rem; }
.form h3.sub { font-size: 1rem; margin: 1.4rem 0 .2rem; }
.facts dt.sub, .facts dd.sub { font-size: .85rem; color: var(--muted); }
.facts dt.sub { padding-left: .8rem; }

