/* KI-Portal – Phase 1 */
:root {
  --paper: #f3f6f7;
  --card: #ffffff;
  --ink: #1d2a33;
  --muted: #5b6b76;
  --line: #dfe7ea;
  --brand: #1f5673;
  --brand-dark: #143d53;
  --focus: #7fb3cf;
  --accent: #ee7f00; /* DJV-Orange - zentral hier anpassbar */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

h1, h2, .brand {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0.1px;
}
h1 { font-size: 1.8rem; margin: 0 0 0.6rem; }
h2 { font-size: 1.2rem; margin: 0 0 0.4rem; }

a { color: var(--brand); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

/* Kopfzeile */
.topbar {
  background: #14252f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  flex-wrap: wrap;
}
.brand { color: #fff; text-decoration: none; font-size: 1.25rem; }
.topnav { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.topnav a { color: #dbe7ee; text-decoration: none; }
.topnav a:hover { color: #fff; }
.hello { color: #9db4c0; }

main { max-width: 1020px; margin: 0 auto; padding: 28px 20px 48px; }

/* Held-Bereich */
.hero { padding: 18px 0 8px; max-width: 640px; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 6px;
}
.lede { color: var(--muted); font-size: 1.05rem; }
.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin-top: 18px; }
.link-quiet { color: var(--muted); }

/* Signatur-Element: das Protokoll-Prinzip */
.stamp {
  border: 2px dashed var(--brand);
  background: var(--card);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 18px 0 6px;
  color: var(--ink);
}
.stamp strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--brand);
  margin-bottom: 4px;
}

/* Karten */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: 10px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.card p { margin: 0; color: var(--muted); }
.card .btn, .card .badge { margin-top: auto; align-self: flex-start; }
.card-soon { border-left-color: var(--line); }
.card-soon h2 { color: var(--muted); }
.price { color: var(--ink) !important; font-weight: 600; }
.badge {
  background: #e8eef1;
  color: var(--muted);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 0.85rem;
}

/* Knöpfe */
.btn {
  display: inline-block;
  background: var(--brand);
  color: #fff;
  border: 1px solid var(--brand);
  border-radius: 7px;
  padding: 9px 16px;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn:disabled { background: #b9c6cd; border-color: #b9c6cd; cursor: not-allowed; }
.btn-big { padding: 12px 22px; }
.btn-ghost { background: transparent; color: var(--brand); }
.btn-ghost:hover { background: #e8eef1; color: var(--brand-dark); }
.topnav .btn-ghost { color: #dbe7ee; border-color: #4a6373; }
.topnav .btn-ghost:hover { background: #1f3947; color: #fff; }

/* Formulare & Panels */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  max-width: 480px;
  margin: 24px auto;
}
.panel-wide {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  margin: 24px 0;
}
label { display: block; margin: 0 0 14px; font-weight: 600; }
label input[type="text"], label input[type="email"], label input[type="password"] {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 10px 12px;
  font: inherit;
  font-weight: 400;
  border: 1px solid #b9c6cd;
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
}
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; gap: 10px; font-weight: 400; align-items: flex-start; }
.check input { margin-top: 4px; }
.opt { color: var(--muted); font-weight: 400; font-size: 0.9rem; }
.alt { color: var(--muted); margin-top: 16px; }

/* Hinweise */
.flash {
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 0 14px;
  border: 1px solid transparent;
}
.flash-success { background: #e4f2e8; color: #245c36; border-color: #bfdec9; }
.flash-error   { background: #f7e6e6; color: #8a2f2f; border-color: #e3c1c1; }
.flash-info    { background: #e6eef4; color: #1f4a63; border-color: #c4d8e4; }

.devbox {
  border: 2px dashed #b7791f;
  background: #fdf6e9;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
}
.devbox p { margin: 0 0 10px; }
.devbox p:last-child { margin-bottom: 0; }

/* Fußzeile */
footer {
  max-width: 1020px;
  margin: 0 auto;
  padding: 18px 20px 30px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.9rem;
}
footer a { color: var(--muted); }

@media (max-width: 540px) {
  .row2 { grid-template-columns: 1fr; }
  h1 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ===== Chat (Phase 3) ===== */
.chat-wrap { max-width: none; margin: 0; }

.ki-banner {
  border: 2px dashed var(--brand);
  background: var(--card);
  border-radius: 8px;
  padding: 12px 16px;
  margin: 4px 0 16px;
}
.ki-banner strong {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  color: var(--brand);
  margin-bottom: 4px;
}

.chat-log {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  min-height: 320px;
  max-height: 60vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-empty { color: var(--muted); margin: auto; text-align: center; }

.msg { display: flex; }
.msg-user { justify-content: flex-end; }
.bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.5;
}
.msg-user .bubble {
  background: var(--brand);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.msg-bot .bubble {
  background: #eaf0f3;
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.typing .bubble { color: var(--muted); font-style: italic; }

.chat-input { display: flex; gap: 10px; margin-top: 12px; align-items: flex-end; }
.chat-input textarea {
  flex: 1;
  resize: none;
  padding: 10px 12px;
  font: inherit;
  border: 1px solid #b9c6cd;
  border-radius: 7px;
  color: var(--ink);
}
.chat-error { color: #8a2f2f; min-height: 1.3em; margin: 8px 0 0; }
.chat-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

/* ===== Phase 3.1: Vollbreite, DJV-Orange, Markdown-Darstellung ===== */
body.page-chat main { max-width: none; padding-left: 24px; padding-right: 24px; }
.chat-wrap h1 { color: var(--accent); }
.ki-banner strong { color: var(--accent); }
body.page-chat .chat-log { max-height: calc(100vh - 360px); min-height: 320px; }

.bubble.md { white-space: normal; }
.bubble.md p { margin: 0 0 10px; }
.bubble.md p:last-child { margin-bottom: 0; }
.bubble.md .md-h { font-weight: 700; margin: 14px 0 6px; }
.bubble.md p.md-h:first-child { margin-top: 0; }
.bubble.md ul, .bubble.md ol { margin: 0 0 10px; padding-left: 22px; }
.bubble.md li { margin: 3px 0; }
.bubble.md code { background: #dde6ea; border-radius: 4px; padding: 1px 5px; font-size: 0.92em; }
.bubble.md a { color: var(--brand); }

@media (max-width: 720px) {
  body.page-chat main { padding-left: 12px; padding-right: 12px; }
  .bubble { max-width: 94%; }
  .chat-input textarea { font-size: 16px; } /* verhindert Auto-Zoom auf dem iPhone */
}
/* DJV-Branding, eingefuegt 2026-07-16 */
.eyebrow-djv { color:#C86A00; font-weight:700; letter-spacing:.08em; text-transform:uppercase; }
.eyebrow-djv::after { content:""; display:block; width:56px; height:3px; margin-top:6px; background:#EE7F00; border-radius:2px; }
/* DJV-Feinschliff 2026-07-16 */
.eyebrow.eyebrow-djv { color:#EE7F00; font-size:1.9rem; font-weight:800; letter-spacing:.05em; text-transform:uppercase; line-height:1.15; }
.eyebrow.eyebrow-djv::after { width:84px; height:4px; background:#EE7F00; }
main { max-width:1080px; margin:0 auto; padding:0 20px; box-sizing:border-box; }
.grid { display:grid; grid-template-columns:repeat(auto-fit, minmax(280px, 1fr)); gap:1.4rem; align-items:stretch; }
.grid .card { width:auto; max-width:none; }
.hero .btn, .grid .card .btn { background:#EE7F00; border-color:#EE7F00; color:#132a33; font-weight:700; }
.hero .btn:hover, .grid .card .btn:hover { background:#D97400; border-color:#D97400; color:#132a33; }
@media (max-width:640px) {
  .eyebrow.eyebrow-djv { font-size:1.4rem; }
  .hero h1 { font-size:1.55rem; }
}
/* === cyber1: Schnellstart, Notfall-Knopf, Hinweis-Varianten === */
.chat-kopfzeile { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.chat-kopfzeile h1 { margin:0; }
.notfall-knopf { background:#c62828; color:#fff !important; border-radius:8px; padding:.45rem .85rem;
  text-decoration:none; font-weight:600; white-space:nowrap; }
.notfall-knopf:hover { background:#a61f1f; }
.schnellstart { display:flex; flex-wrap:wrap; gap:8px; margin:10px 0 12px; }
.schnellstart .chip { display:inline-block; padding:.42rem .75rem; border:1px solid var(--accent-ink, #1a3e6e);
  border-radius:999px; font-size:.9rem; text-decoration:none; color:var(--accent-ink, #1a3e6e); background:#fff; }
.schnellstart .chip:hover { background:var(--accent, #ee7f00); border-color:var(--accent, #ee7f00); color:#fff; }
.schnellstart .chip-notfall { background:#c62828; border-color:#c62828; color:#fff; font-weight:600; }
.schnellstart .chip-notfall:hover { background:#a61f1f; border-color:#a61f1f; color:#fff; }
.ki-banner-makler  { border-left:5px solid var(--accent, #ee7f00); }
.ki-banner-service { border-left:5px solid var(--accent-ink, #1a3e6e); }
.uebergabe-hinweis { text-align:center; color:#555; font-style:italic; margin:.6rem 0; }
