/* Brunner Mobil – Projekt-Status-Tracker
 * Markentreues Design (Richtung A). Leitfarbe: Brunner-Blau (aus Logo abgeleitet).
 * Bewusst ohne Web-Fonts von Drittservern (DSGVO) – System-Schrift, dafuer
 * klare Typo-Hierarchie, Haarlinien statt schwerer Schatten, viel Weissraum. */
:root {
  --brand: #0f76be;
  --brand-2: #0a5a92;
  --brand-3: #083f66;
  --brand-tint: #eef5fb;
  --brand-tint-2: #dcebf8;
  --ink: #15212e;
  --muted: #5c6776;
  --line: #e5e9f0;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --green: #10b981;
  --gold: #fbbf24; /* nur fuer den freundlichen Bruno-Avatar */
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 32, 48, 0.05), 0 10px 28px rgba(16, 32, 48, 0.06);
  --shadow-sm: 0 1px 2px rgba(16, 32, 48, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Kopfleiste: weiss, damit das blaue Logo sichtbar bleibt */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 40;
}
.header-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: 10px; }
#logo { height: 40px; width: auto; display: block; }
.logo-text { font-weight: 800; letter-spacing: 0.3px; font-size: 18px; color: var(--brand); }
.header-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
}

/* Layout */
.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 26px 20px 100px;
}
.screen { display: none; animation: fade 0.25s ease; }
.screen.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.screen-title { font-size: 24px; letter-spacing: -0.02em; margin: 6px 0 8px; }
.screen-lead { color: var(--muted); margin: 0 0 22px; }

/* Hero (Startseite) */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(155deg, var(--brand) 0%, var(--brand-2) 70%, var(--brand-3) 100%);
  color: #fff;
  padding: 36px 30px 58px;
  margin-bottom: 24px;
}
.hero-eyebrow {
  text-transform: uppercase;
  letter-spacing: 2px;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.85;
  margin: 0 0 10px;
}
.hero-title {
  font-size: 30px;
  line-height: 1.12;
  letter-spacing: -0.025em;
  font-weight: 800;
  margin: 0 0 10px;
  max-width: 20ch;
}
.hero-sub { margin: 0; opacity: 0.92; max-width: 44ch; }
.hero-ridge {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  width: 100%;
  height: 64px;
  display: block;
}

.link-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 9px 16px;
  border-radius: 10px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.12s ease, transform 0.12s ease, color 0.12s ease;
}
.link-back:hover { border-color: var(--brand); color: var(--brand); transform: translateX(-3px); }

/* Rollenauswahl */
.role-grid { display: grid; gap: 16px; }
@media (min-width: 560px) { .role-grid { grid-template-columns: 1fr 1fr; } }
.role-card {
  position: relative;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}
.role-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--brand);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.18s ease;
}
.role-card:hover { transform: translateY(-4px); border-color: var(--brand); box-shadow: var(--shadow); }
.role-card:hover::before { transform: scaleX(1); }
.role-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, var(--brand), var(--brand-2));
  margin-bottom: 4px;
}
.role-icon svg { width: 25px; height: 25px; }
.role-card-title { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; }
.role-card-sub { color: var(--muted); font-size: 13.5px; }
.role-card-go {
  margin-top: 6px;
  font-weight: 700;
  font-size: 13px;
  color: var(--brand);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}
.role-card:hover .role-card-go { opacity: 1; transform: none; }

/* Eingabe */
.lookup-form { display: flex; gap: 10px; flex-wrap: wrap; }
.lookup-input {
  flex: 1 1 220px;
  padding: 14px 16px;
  font-size: 18px;
  letter-spacing: 1px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
}
.lookup-input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15, 118, 190, 0.18); }
.btn-primary {
  padding: 14px 22px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--brand);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.btn-primary:hover { background: var(--brand-2); }
.btn-primary:disabled { opacity: 0.6; cursor: default; }
.form-error { color: #c0362c; min-height: 20px; margin-top: 12px; font-size: 14px; }

/* Projekt-Karte */
.project-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 16px;
}
.project-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.project-name { font-size: 21px; letter-spacing: -0.02em; margin: 0; }
.project-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-2);
  background: var(--brand-tint);
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.4px;
}
.project-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
  margin: 20px 0 0;
}
.project-meta dt { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.project-meta dd { margin: 3px 0 0; font-weight: 600; }

/* Status / Fortschritt */
.status-summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 22px 24px;
  margin-bottom: 16px;
}
.progress { display: flex; align-items: center; gap: 14px; }
.progress-bar { flex: 1; height: 8px; background: var(--brand-tint); border-radius: 999px; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--brand), #3aa0e0); transition: width 0.7s ease; }
.progress-label { font-weight: 800; font-size: 15px; color: var(--brand-2); min-width: 48px; text-align: right; }
.status-detail { margin: 16px 0 0; font-size: 15px; color: var(--ink); }

/* Timeline */
.timeline { list-style: none; margin: 22px 0 0; padding: 0; }
.timeline li {
  position: relative;
  display: flex;
  gap: 14px;
  padding-bottom: 22px;
  animation: tl-in 0.45s ease both;
  animation-delay: calc(var(--i, 0) * 90ms);
}
.timeline li:last-child { padding-bottom: 0; }
@keyframes tl-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.tl-node {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  color: #c2c7d6;
  z-index: 1;
}
.tl-node svg { width: 16px; height: 16px; }
.timeline li::after {
  content: "";
  position: absolute;
  left: 15px;
  top: 34px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}
.timeline li:last-child::after { display: none; }

.tl-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.tl-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  padding: 4px 0;
  margin: 0;
  cursor: pointer;
  text-align: left;
  color: inherit;
  font: inherit;
}
.step-label { font-weight: 700; }
.step-date { font-size: 13px; color: var(--muted); }
.tl-caret { margin-left: auto; color: var(--muted); font-size: 12px; transition: transform 0.18s ease; }
.timeline li.open .tl-caret { transform: rotate(180deg); }
.tl-detail { display: none; padding: 2px 0 8px; }
.timeline li.open .tl-detail { display: block; animation: fade 0.2s ease; }
.tl-now { margin: 0 0 8px; font-size: 14.5px; }
.tl-next { margin: 0 0 8px; font-size: 14.5px; }
.tl-next strong { color: var(--brand-2); }
.tl-tip { margin: 0; font-size: 13.5px; color: var(--ink); background: var(--brand-tint); border-radius: 8px; padding: 9px 11px; }
.tl-dauer { margin: 0 0 8px; font-size: 13.5px; color: var(--brand-2); font-weight: 600; }
.tl-richtwert { font-size: 10.5px; font-weight: 700; letter-spacing: 0.3px; text-transform: uppercase; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; margin-left: 4px; vertical-align: middle; }
.timeline li.pending .tl-caret,
.timeline li.pending .step-date { opacity: 0.7; }

.timeline li.done .tl-node { background: var(--green); border-color: var(--green); color: #fff; }
.timeline li.done::after { background: var(--green); }
.timeline li.active .tl-node {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  animation: node-pulse 2s infinite;
}
.timeline li.active .step-label { color: var(--brand-2); }
.timeline li.pending .step-label { color: var(--muted); }
@keyframes node-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(15, 118, 190, 0.45); }
  70%  { box-shadow: 0 0 0 10px rgba(15, 118, 190, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 118, 190, 0); }
}

/* Footer */
.site-footer {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 20px 30px;
  color: var(--muted);
  font-size: 13px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: space-between;
}
.site-footer a { color: var(--brand); text-decoration: none; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-links a:hover { text-decoration: underline; }

/* ---- Bruno Chat ---- */
.bruno-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(155deg, var(--brand), var(--brand-2));
  box-shadow: var(--shadow);
  cursor: pointer;
  display: grid;
  place-items: center;
  z-index: 50;
  transition: transform 0.15s ease;
  animation: bruno-pulse 2.4s infinite;
}
.bruno-fab:hover { transform: scale(1.08); }
.bruno-fab.quiet { animation: none; box-shadow: var(--shadow); }
@keyframes bruno-pulse {
  0%   { box-shadow: var(--shadow), 0 0 0 0 rgba(15, 118, 190, 0.5); }
  70%  { box-shadow: var(--shadow), 0 0 0 18px rgba(15, 118, 190, 0); }
  100% { box-shadow: var(--shadow), 0 0 0 0 rgba(15, 118, 190, 0); }
}
.bruno-avatar { width: 38px; height: 38px; }
.bruno-avatar.sm { width: 30px; height: 30px; }

.bruno-hint {
  position: fixed;
  right: 92px;
  bottom: 34px;
  background: var(--brand-3);
  color: #fff;
  padding: 9px 14px;
  border-radius: 14px;
  border-bottom-right-radius: 4px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 49;
  opacity: 0;
  transform: translateX(8px);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.bruno-hint.show { opacity: 1; transform: none; }

.bruno-panel {
  position: fixed;
  right: 20px;
  bottom: 92px;
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 130px));
  background: var(--surface);
  border-radius: 18px;
  box-shadow: 0 14px 44px rgba(16, 32, 48, 0.26);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 50;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}
.bruno-panel.is-open { opacity: 1; transform: none; pointer-events: auto; }

.bruno-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  background: linear-gradient(155deg, var(--brand), var(--brand-2));
  color: #fff;
}
.bruno-head-text { display: flex; flex-direction: column; line-height: 1.15; }
.bruno-head-text small { color: #d6e8f6; font-size: 11px; }
.bruno-close { margin-left: auto; background: none; border: none; color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }

.bruno-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.msg {
  max-width: 82%;
  padding: 10px 13px;
  border-radius: 16px;
  font-size: 14.5px;
  word-wrap: break-word;
  animation: pop 0.18s ease;
}
@keyframes pop { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.msg-bruno { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; align-self: flex-start; box-shadow: var(--shadow-sm); }
.msg-bruno a { color: var(--brand); }
.msg-user { background: var(--brand); color: #fff; border-bottom-right-radius: 4px; align-self: flex-end; }

.msg-typing { display: inline-flex; gap: 4px; align-items: center; }
.msg-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.msg-typing span:nth-child(2) { animation-delay: 0.2s; }
.msg-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }

.bruno-quick { display: flex; gap: 8px; padding: 10px 12px 0; flex-wrap: wrap; background: var(--surface); }
.bruno-quick-btn {
  font-size: 12.5px;
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.bruno-quick-btn:hover { border-color: var(--brand); color: var(--brand); }

.bruno-form { display: flex; gap: 8px; padding: 12px; background: var(--surface); border-top: 1px solid var(--line); }
.bruno-input { flex: 1; padding: 11px 14px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; color: var(--ink); }
.bruno-input:focus { outline: none; border-color: var(--brand); }
.bruno-send { width: 42px; border: none; border-radius: 50%; background: var(--brand); color: #fff; font-size: 16px; cursor: pointer; }
.bruno-send:hover { background: var(--brand-2); }

/* Bruno-Avatar: blinzeln + pulsierende Antenne */
.bruno-eye { transform-box: fill-box; transform-origin: center; animation: bruno-blink 4.5s infinite; }
@keyframes bruno-blink { 0%, 94%, 100% { transform: scaleY(1); } 97% { transform: scaleY(0.12); } }
.bruno-antenna { transform-box: fill-box; transform-origin: center; animation: bruno-antenna 2s infinite; }
@keyframes bruno-antenna { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---- Kontakt-Block + Rückruf-Formular (Weg B, ersetzt den Chatbot) ---- */
.help-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap; margin-top: 28px; padding: 18px 20px;
  background: var(--brand-tint); border: 1px solid var(--brand-tint-2); border-radius: var(--radius);
}
.help-text { display: flex; flex-direction: column; gap: 3px; }
.help-title { font-size: 15px; }
.help-contact { color: var(--muted); font-size: 14px; }
.help-contact a { color: var(--brand); text-decoration: none; }
.help-contact a:hover { text-decoration: underline; }
.btn-ghost {
  padding: 11px 18px; font-size: 15px; font-weight: 700; cursor: pointer;
  color: var(--brand); background: var(--surface);
  border: 1px solid var(--brand); border-radius: 10px;
  transition: background .12s ease, color .12s ease; white-space: nowrap;
}
.btn-ghost:hover { background: var(--brand); color: #fff; }

.ticket-form { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; color: var(--ink); }
.field input, .field textarea {
  padding: 12px 14px; font-size: 16px; font-family: inherit; font-weight: 400;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink);
}
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(15,118,190,.18);
}
.field textarea { resize: vertical; }
.ticket-form .btn-primary { align-self: flex-start; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.ticket-privacy { margin-top: 16px; font-size: 13px; color: var(--muted); max-width: 520px; }
.ticket-privacy a { color: var(--brand); }
.ticket-success {
  margin-top: 18px; padding: 18px 20px; max-width: 520px;
  background: #ecfdf5; border: 1px solid #a7f3d0; border-radius: var(--radius); color: #065f46;
}
