/* ============================================================
   Certified Functional — styles.css
   Kühles Corporate. Design-Tokens: docs/30_Design.md §8.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  --navy:      #0B1F3A;
  --ink:       #1A2332;
  --bg:        #FFFFFF;
  --bg-soft:   #F4F7FB;
  --steel:     #2E6DB4;
  --line:      #D5DEEA;
  --muted:     #6B7A90;
  --alarm:     #B0413E;

  --font-head: Georgia, 'Times New Roman', serif;
  --font-ui:   system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Mono', Consolas, monospace;

  --wrap: 1140px;
  --radius: 10px;
  --radius-sm: 7px;
  --shadow: 0 1px 2px rgba(11,31,58,.06), 0 10px 30px rgba(11,31,58,.06);
  --shadow-lg: 0 20px 60px rgba(11,31,58,.18);
  --ease: cubic-bezier(.22,.61,.36,1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); margin: 0; line-height: 1.15; }
p { margin: 0 0 1em; }
a { color: var(--steel); text-decoration: none; }
img { max-width: 100%; }
button { font-family: inherit; }

/* ---------- Layout ---------- */
.wrap { width: min(var(--wrap), 100% - 48px); margin-inline: auto; }
.section { padding: clamp(48px, 8vw, 96px) 0; }
.section + .section { border-top: 1px solid var(--line); }

.section h2 { font-size: clamp(28px, 4.4vw, 44px); letter-spacing: -.01em; }
.section-intro { color: var(--muted); max-width: 60ch; margin-top: 14px; font-size: 18px; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--steel); margin: 0 0 18px;
}

/* ---------- Buttons / links ---------- */
.btn {
  display: inline-block; border: 0; cursor: pointer;
  font-size: 15px; font-weight: 600; letter-spacing: .01em;
  padding: 13px 24px; border-radius: var(--radius-sm);
  transition: transform .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease);
  line-height: 1;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--steel); color: #fff; box-shadow: 0 2px 8px rgba(46,109,180,.28); }
.btn-primary:hover { background: #255c9d; }
.btn-ghost {
  background: transparent; color: var(--steel);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: var(--steel); background: var(--bg-soft); }
.link-arrow { color: var(--navy); font-weight: 600; padding: 13px 4px; }
.link-arrow:hover { color: var(--steel); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--navy); }
.brand-mark {
  display: grid; place-items: center; width: 40px; height: 40px;
  background: var(--navy); color: #fff; font-family: var(--font-head);
  font-weight: 700; font-size: 17px; border-radius: 9px; letter-spacing: .02em;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name { font-family: var(--font-head); font-weight: 700; font-size: 17px; color: var(--navy); }
.brand-sub { font-size: 11.5px; color: var(--muted); letter-spacing: .01em; }
.nav { margin-left: auto; display: flex; gap: 26px; }
.nav a { color: var(--ink); font-size: 14.5px; font-weight: 500; position: relative; padding: 4px 0; }
.nav a:hover { color: var(--navy); }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px;
  background: var(--steel); transform: scaleX(0); transform-origin: left; transition: transform .2s var(--ease);
}
.nav a:hover::after { transform: scaleX(1); }
.btn-header { white-space: nowrap; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(180deg, #fff 0%, var(--bg-soft) 100%); }
.hero-inner { max-width: 860px; }
.hero h1 {
  font-size: clamp(34px, 6vw, 62px); letter-spacing: -.02em; margin-bottom: 22px;
}
.lead { font-size: clamp(17px, 2.2vw, 21px); color: var(--ink); max-width: 62ch; }
.hero-actions { display: flex; align-items: center; gap: 20px; margin: 30px 0 8px; flex-wrap: wrap; }

.stats {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 0;
  margin: 46px 0 0; border-top: 1px solid var(--line);
}
.stat { padding: 22px 24px 4px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; padding-left: 0; }
.stat dt { font-family: var(--font-head); font-size: clamp(30px, 5vw, 46px); color: var(--navy); margin: 0; line-height: 1; }
.stat dd { margin: 8px 0 0; color: var(--muted); font-size: 14px; }

/* ---------- Cards (Warum) ---------- */
.cards { display: grid; gap: 22px; margin-top: 40px; }
.cards-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.card {
  background: var(--bg-soft); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 28px;
}
.card h3 { font-size: 21px; margin-bottom: 12px; }
.card p { margin: 0; color: var(--muted); }

/* ---------- Stufen ---------- */
.stage-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 20px; margin-top: 44px; align-items: start; }
.stage-column { display: flex; flex-direction: column; gap: 18px; }
.stage-col-head { font-family: var(--font-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--steel); margin: 0; }
.stage-col-caption { font-size: 13px; color: var(--muted); margin: 0; min-height: 2.6em; }

.stage {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
  display: flex; flex-direction: column;
}
.stage:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #c2d0e2; }
.stage-path { font-family: var(--font-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.stage-name { font-size: 24px; }
.stage-tagline { font-style: italic; color: var(--steel); font-size: 14px; margin: 4px 0 12px; font-family: var(--font-head); }
.stage-desc { font-size: 14px; color: var(--muted); flex: 1; }
.stage-cta { margin-top: 18px; width: 100%; }

/* ---------- Ablauf ---------- */
.steps { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 22px; counter-reset: step; }
.step { position: relative; padding: 26px 26px 26px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius); }
.step-num {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--navy); color: #fff; font-family: var(--font-head); font-weight: 700; font-size: 19px;
  margin-bottom: 16px;
}
.step h3 { font-size: 20px; margin-bottom: 8px; }
.step p { margin: 0; color: var(--muted); font-size: 15px; }
.process-note { margin-top: 28px; color: var(--muted); font-size: 14px; max-width: 70ch; }

/* ---------- Referenzen ---------- */
.refs-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.refs-vol { display: flex; gap: 32px; margin: 0; }
.refs-vol > div { text-align: right; }
.refs-vol dt { font-family: var(--font-head); font-size: 26px; color: var(--navy); margin: 0; line-height: 1; }
.refs-vol dd { margin: 4px 0 0; font-size: 13px; color: var(--muted); }
.refs-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; margin-top: 40px;
}
.ref {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; display: flex; flex-direction: column;
}
.ref-quote { font-size: 15px; color: var(--ink); line-height: 1.55; margin-bottom: 18px; }
.ref-quote::before { content: "„"; }
.ref-quote::after { content: "“"; }
.ref-meta { margin-top: auto; }
.ref-name { font-weight: 700; color: var(--navy); font-size: 14.5px; }
.ref-role { font-size: 13px; color: var(--muted); }
.refs-foot { margin-top: 26px; color: var(--muted); font-size: 13.5px; text-align: center; }

/* ---------- Über uns ---------- */
.about { background: var(--navy); color: #fff; }
.about h2 { color: #fff; }
.about-inner { max-width: 860px; }
.about-lead { font-size: clamp(18px, 2.4vw, 23px); line-height: 1.5; color: #dbe4f0; margin: 20px 0 26px; }
.about-lead strong { color: #fff; }
.about-values { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 14px; }
.about-values li { padding-left: 20px; border-left: 2px solid var(--steel); color: #c3d0e2; font-size: 15.5px; }
.about-values strong { color: #fff; }
.about-tagline { font-family: var(--font-head); font-style: italic; font-size: 18px; color: #9fb2ca; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 40px 0; }
.footer-inner { display: flex; flex-direction: column; gap: 18px; }
.footer-brand { display: flex; flex-direction: column; gap: 3px; }
.footer-name { font-family: var(--font-head); font-weight: 700; color: var(--navy); }
.footer-sub { font-size: 13px; color: var(--muted); }
.footer-tagline { font-size: 13px; color: var(--muted); font-style: italic; }
.footer-legal { display: flex; gap: 22px; }
.footer-link { background: none; border: 0; cursor: pointer; color: var(--ink); font-size: 14px; padding: 0; }
.footer-link:hover { color: var(--steel); text-decoration: underline; }
.footer-fineprint { margin: 0; font-size: 12.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; }

/* ============================================================
   MODALS
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(11,31,58,.55); backdrop-filter: blur(3px); }
.modal-dialog {
  position: relative; background: #fff; border-radius: 12px; box-shadow: var(--shadow-lg);
  width: min(620px, 100%); max-height: 92vh; display: flex; flex-direction: column;
  animation: pop .2s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(12px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 24px; border-bottom: 1px solid var(--line);
}
.modal-kicker { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 6px; }
.modal-title { font-size: 22px; }
.modal-close {
  background: none; border: 0; cursor: pointer; font-size: 26px; line-height: 1;
  color: var(--muted); padding: 0 6px; border-radius: 6px;
}
.modal-close:hover { color: var(--navy); background: var(--bg-soft); }
.modal-body { padding: 24px; overflow-y: auto; }

/* ---------- Prüfungs-Dialog (mono, ISO-Prüfprotokoll-Look) ---------- */
.task-dialog .modal-body { font-family: var(--font-mono); font-size: 14px; line-height: 1.5; color: var(--ink); }
.task-doc { display: flex; flex-direction: column; gap: 18px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 10px; }
.task-meta span {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  border: 1px solid var(--line); border-radius: 4px; padding: 4px 9px; color: var(--muted); background: var(--bg-soft);
}
.task-instruction { font-family: var(--font-head); font-size: 17px; color: var(--navy); line-height: 1.4; }
.task-timer {
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted);
}
.task-timer .time { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--navy); }
.task-timer .time.low { color: var(--alarm); }
.task-bar { height: 6px; background: var(--line); border-radius: 4px; overflow: hidden; }
.task-bar > i { display: block; height: 100%; width: 100%; background: var(--steel); transition: width .1s linear; }
.task-bar > i.low { background: var(--alarm); }

/* Felder / Optionen */
.opt-grid { display: grid; gap: 12px; }
.opt-grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.opt-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.opt {
  font-family: var(--font-mono); font-size: 14px; cursor: pointer;
  border: 1.5px solid var(--line); border-radius: 8px; background: #fff;
  padding: 16px; text-align: left; transition: border-color .15s, background .15s, transform .08s;
  min-height: 58px; display: grid; place-items: center; color: var(--ink);
}
.opt:hover { border-color: var(--steel); }
.opt:active { transform: scale(.985); }
.opt.picked { border-color: var(--steel); background: #eaf1fa; }
.opt.red { background: #e5534b; color: #fff; border-color: #e5534b; }
.opt.green { background: #3f9d5f; color: #fff; border-color: #3f9d5f; }
.opt.blue { background: var(--steel); color: #fff; border-color: var(--steel); }
.opt:disabled { cursor: default; opacity: .55; }
.opt.hidden-cell { visibility: hidden; }

/* Mini-Uhr-Kacheln (Director / Generalist) */
.tile-grid { display: grid; gap: 12px; grid-template-columns: repeat(3, 1fr); }
.tile-grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
.tile {
  border: 1.5px solid var(--line); border-radius: 8px; padding: 12px; cursor: pointer;
  background: #fff; text-align: center; transition: border-color .15s, background .15s;
}
.tile:hover { border-color: var(--steel); }
.tile .t-name { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.tile .t-bar { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
.tile .t-bar > i { display: block; height: 100%; width: 100%; background: var(--steel); }
.tile .t-bar > i.low { background: var(--alarm); }
.tile .t-time { font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.tile.done { border-color: var(--steel); background: #eaf1fa; cursor: default; }
.tile .t-check { color: var(--steel); font-weight: 700; font-size: 13px; }

/* Ergebnis */
.task-result { border: 1.5px solid var(--line); border-radius: 8px; padding: 20px; background: var(--bg-soft); }
.task-result .r-label { font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.task-result .r-msg { font-family: var(--font-head); font-size: 16px; color: var(--navy); line-height: 1.45; margin-bottom: 12px; }
.task-result .r-suspend { font-size: 13px; color: var(--alarm); font-weight: 600; border-top: 1px dashed var(--line); padding-top: 12px; }
.task-canceled { font-size: 13px; color: var(--muted); font-style: italic; }

/* ---------- Rechtliches-Modal ---------- */
.legal-body { font-size: 14.5px; line-height: 1.6; color: var(--ink); }
.legal-body h3 { font-size: 16px; color: var(--navy); margin: 20px 0 8px; }
.legal-body h3:first-child { margin-top: 0; }
.legal-body ul { padding-left: 20px; margin: 8px 0; }
.legal-body p { margin: 0 0 12px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 980px) {
  .stage-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .cards-3, .steps, .refs-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .nav { display: none; }
}
@media (max-width: 640px) {
  .wrap { width: 100% - 32px; }
  .header-inner { gap: 14px; }
  .brand-sub { display: none; }
  .btn-header { font-size: 14px; padding: 10px 16px; }
  .stage-grid, .cards-3, .steps, .refs-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr; }
  .stat { border-left: 0; border-top: 1px solid var(--line); padding: 18px 0; }
  .stat:first-child { border-top: 0; padding-top: 0; }
  .refs-head { flex-direction: column; align-items: flex-start; }
  .refs-vol > div { text-align: left; }
  .footer-inner { align-items: flex-start; }
}
