/* HAVAG Kundenassistent – Präsentation
   Gemeinsames Stylesheet für alle Seiten.
   Optik angelehnt an havag.com (Primärrot #9E100E, Akzent-Bordeaux #842245,
   Schrift "Source Sans 3", stark abgerundete Ecken, weiche Schatten
   statt harter Linien, Pill-Navigation). */

@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@300;400;600;700;800&display=swap');

:root {
  --red: #9e100e;        /* HAVAG Primärrot */
  --red-dark: #7a0c0a;
  --red-tint: #fbeceb;
  --accent: #842245;     /* HAVAG Link-/Akzentfarbe (Bordeaux) */
  --ink: #212529;
  --ink-soft: #495057;
  --grey: #6c757d;
  --grey-light: #8a8f98;
  --line: #e6dfe1;
  --bg: #fbfaf8;
  --card: #ffffff;
  --cream: #f9f3f5;      /* weicher rosé-Ton, wie HAVAG-Panels */
  --good: #198754;
  --good-bg: #e9f5ef;
  --risk-bg: #fbeceb;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 22px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 10px rgba(33, 16, 14, 0.07);
  --shadow: 0 12px 28px rgba(33, 16, 14, 0.10);
  --shadow-red: 0 10px 22px rgba(158, 16, 14, 0.24);
  --maxw: 980px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Source Sans 3', -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  font-size: 16px;
}

img { max-width: 100%; display: block; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--red); text-decoration: underline; }

/* ---------- Kopfzeile / Marke ---------- */

.topbar {
  background: #fff;
  color: var(--ink);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.topbar .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.topbar .brand .dot {
  width: 20px; height: 20px;
  border-radius: 6px;
  background: var(--red);
  box-shadow: 0 3px 8px rgba(158, 16, 14, 0.35);
  flex: none;
  transform: skew(-8deg);
}
.topbar .pagejump {
  display: flex;
  gap: 2px;
  background: var(--cream);
  border-radius: var(--radius-pill);
  padding: 4px;
  overflow-x: auto;
}
.topbar .pagejump a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}
.topbar .pagejump a:hover { background: #fff; color: var(--red); box-shadow: var(--shadow-sm); }
.topbar .pagejump a.active { color: #fff; background: var(--red); box-shadow: var(--shadow-red); }
.topbar .pagejump .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(33,37,41,0.08);
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 700;
  flex: none;
}
.topbar .pagejump a.active .num { background: rgba(255,255,255,0.25); color: #fff; }

@media (max-width: 880px) {
  .topbar { flex-direction: column; align-items: stretch; gap: 10px; }
  .topbar .pagejump { flex-wrap: nowrap; }
}

/* ---------- Layout ---------- */

main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 44px 24px 30px 24px;
}

.eyebrow {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 16px;
  box-shadow: var(--shadow-red);
}

h1 {
  font-size: 33px;
  font-weight: 800;
  margin: 0 0 8px 0;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.15;
}
.subtitle {
  font-size: 16.5px;
  color: var(--grey);
  margin-bottom: 8px;
  max-width: 640px;
}

h2 {
  font-size: 21px;
  font-weight: 800;
  color: var(--ink);
  border-bottom: 3px solid var(--red);
  padding-bottom: 8px;
  margin: 44px 0 18px 0;
  letter-spacing: -0.01em;
}
h2:first-of-type { margin-top: 30px; }
h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 22px 0 8px 0;
}
h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 14px 0 6px 0;
}
p { margin: 6px 0 12px 0; }
ul, ol { margin: 6px 0 12px 0; padding-left: 20px; }
li { margin-bottom: 4px; }

/* ---------- Karten / Grids ---------- */

.grid {
  display: grid;
  gap: 16px;
  margin: 16px 0;
}
.grid.cols-2 { grid-template-columns: 1fr 1fr; }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}
.card h4 { margin-top: 0; }
.card .icon { font-size: 22px; margin-bottom: 8px; display: block; }

.card.accent {
  background: var(--cream);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: var(--radius-lg);
}

/* ---------- Callouts ---------- */

.callout {
  background: var(--cream);
  border: 1px solid var(--line);
  border-left: 4px solid var(--grey);
  padding: 14px 18px;
  border-radius: var(--radius);
  margin: 14px 0;
  font-size: 15px;
  box-shadow: var(--shadow-sm);
}
.callout strong.label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey);
  margin-bottom: 4px;
}
.callout.good { border-left-color: var(--good); background: var(--good-bg); }
.callout.good strong.label { color: var(--good); }
.callout.risk { border-left-color: var(--red); background: var(--risk-bg); }
.callout.risk strong.label { color: var(--red-dark); }

/* ---------- Tabellen ---------- */

table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px 0;
  font-size: 14.5px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
}
th {
  background: var(--ink);
  color: #fff;
  text-align: left;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 13px;
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:nth-child(even) td { background: #fbf8f6; }

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  color: #fff;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.tag.prio1 { background: var(--red); }
.tag.prio2 { background: var(--grey); }
.tag.live { background: #b3620c; }
.tag.rag { background: var(--good); }
.tag.write { background: var(--accent); }
.tag.hold { background: #9a9fa6; }

/* ---------- Screenshot-Rahmen ---------- */

.shot {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid #1f2226;
  margin: 18px 0;
}
.shot img { width: 100%; }
.shot-caption {
  font-size: 13.5px;
  color: var(--grey);
  margin-top: -6px;
  margin-bottom: 20px;
}

/* ---------- Timeline (Phasenplan) ---------- */

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 16px 0;
}
@media (max-width: 760px) { .timeline { grid-template-columns: 1fr; } }
.timeline .phase {
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.timeline .phase .num {
  font-size: 11px;
  font-weight: 700;
  color: var(--red-dark);
  letter-spacing: 0.06em;
}
.timeline .phase .when {
  font-size: 12px;
  color: var(--grey-light);
  margin-bottom: 6px;
}
.timeline .phase p { font-size: 13.5px; margin: 6px 0 0 0; }

/* ---------- Sitemap-Kacheln (Startseite) ---------- */

.sitemap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0 8px 0;
}
@media (max-width: 760px) { .sitemap { grid-template-columns: 1fr 1fr; } }
.sitemap a.tile {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px;
  text-decoration: none;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.sitemap a.tile:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: var(--shadow); }
.sitemap a.tile .num {
  font-size: 11px; font-weight: 700; color: var(--red-dark);
  letter-spacing: 0.06em; text-transform: uppercase;
}
.sitemap a.tile .t { font-size: 15px; font-weight: 700; margin-top: 5px; }
.sitemap a.tile .d { font-size: 12.5px; color: var(--grey); margin-top: 3px; }

/* ---------- Datenschutz-Box (Seite 5) ---------- */

.privacy-box {
  margin: 34px 0 10px 0;
  background: var(--red-tint);
  border: 1px solid var(--line);
  border-left: 5px solid var(--red);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 13.5px;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.privacy-box .picon {
  font-size: 18px;
  line-height: 1;
  margin-top: 1px;
}
.privacy-box strong { color: var(--ink); }
.privacy-box .l {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--red-dark);
  display: block;
  margin-bottom: 2px;
}

/* ---------- Abkürzungen (Mouse-Over-Erläuterung) ---------- */

abbr[title] {
  text-decoration: underline dotted;
  text-decoration-color: currentColor;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: help;
}

/* ---------- Prev/Next Navigation ---------- */

.pagenav {
  max-width: var(--maxw);
  margin: 14px auto 60px auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.pagenav a, .pagenav span.disabled {
  flex: 1;
  max-width: 320px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: var(--radius);
  padding: 13px 18px;
  text-decoration: none;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, background 0.15s, transform 0.15s, box-shadow 0.15s;
}
.pagenav a:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.pagenav a.prev:hover { border-color: var(--grey-light); }
.pagenav a.next {
  background: var(--red);
  color: #fff;
  border-color: var(--red);
  box-shadow: var(--shadow-red);
  text-align: right;
  margin-left: auto;
}
.pagenav a.next:hover { background: var(--red-dark); border-color: var(--red-dark); }
.pagenav .dir {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--grey-light);
  display: block;
}
.pagenav a.next .dir { color: rgba(255,255,255,0.75); }
.pagenav span.disabled {
  opacity: 0.35;
  cursor: default;
  box-shadow: none;
}
.pagenav .spacer { flex: 1; }

/* ---------- Footer ---------- */

footer.sitefoot {
  text-align: center;
  font-size: 12px;
  color: var(--grey-light);
  padding: 0 24px 50px 24px;
}
footer.sitefoot .confidential {
  max-width: 640px;
  margin: 10px auto 0 auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1.5;
  color: var(--grey-light);
}

/* ---------- Chat-Widget (siehe chat-widget.js) ---------- */

#havag-chat-bubble {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 900;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
  border: none;
  cursor: pointer;
  box-shadow: var(--shadow-red);
  font-size: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s;
}
#havag-chat-bubble:hover { transform: scale(1.06); }

#havag-chat-teaser {
  position: fixed;
  right: 92px;
  bottom: 34px;
  z-index: 899;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 4px var(--radius);
  padding: 10px 14px;
  font-size: 13.5px;
  max-width: 220px;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(6px);
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s;
}
#havag-chat-teaser.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#havag-chat-teaser button {
  border: none; background: none; position: absolute; top: 4px; right: 7px;
  color: var(--grey-light); font-size: 13px; cursor: pointer;
}

#havag-chat-panel {
  position: fixed;
  right: 22px;
  bottom: 94px;
  z-index: 901;
  width: 340px;
  max-width: calc(100vw - 44px);
  height: 460px;
  max-height: calc(100vh - 140px);
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 46px rgba(33, 16, 14, 0.28);
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
}
#havag-chat-panel.open { display: flex; }
#havag-chat-panel .hd {
  background: var(--red);
  color: #fff;
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#havag-chat-panel .hd .t { font-size: 13.5px; font-weight: 700; }
#havag-chat-panel .hd .s { font-size: 11px; color: rgba(255,255,255,0.75); }
#havag-chat-panel .hd button { background: none; border: none; color: rgba(255,255,255,0.8); font-size: 16px; cursor: pointer; }
#havag-chat-panel .msgs {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
}
#havag-chat-panel .msg {
  max-width: 84%;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  line-height: 1.4;
  white-space: pre-wrap;
}
#havag-chat-panel .msg.user { align-self: flex-end; background: var(--red); color: #fff; border-bottom-right-radius: 4px; }
#havag-chat-panel .msg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; box-shadow: var(--shadow-sm); }
#havag-chat-panel .msg.note { align-self: center; font-size: 11.5px; color: var(--grey-light); text-align: center; }
#havag-chat-panel .msg .src { display: block; margin-top: 5px; font-size: 11px; color: var(--grey-light); font-style: italic; }
#havag-chat-panel .typing { align-self: flex-start; font-size: 12px; color: var(--grey-light); padding: 0 4px; }
#havag-chat-panel .inputrow {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--line);
  background: #fff;
}
#havag-chat-panel .inputrow input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding: 9px 14px;
  font-size: 13.5px;
  font-family: inherit;
  background: var(--bg);
}
#havag-chat-panel .inputrow input:focus { outline: 2px solid var(--red-tint); border-color: var(--red); }
#havag-chat-panel .inputrow button {
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-pill);
  padding: 0 16px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
#havag-chat-panel .inputrow button:hover { background: var(--red-dark); }
