/* Technolog – CAIDAO.culture
   Kopfzeile nach der CAIDAO-Produktspezifikation (Kopf von foresight.caidao.de).
   Akzent: CAIDAO.culture Petrol #30646B (KT05) und Grün #47998E (KT04).
   Schrift: Lato, selbst ausgeliefert (SIL OFL 1.1). */

@font-face { font-family: "Lato"; font-style: normal; font-weight: 300; font-display: swap; src: url("fonts/lato-latin-300-normal.716309aab2bc.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/lato-latin-400-normal.e1b3b5908c9c.woff2") format("woff2"); }
@font-face { font-family: "Lato"; font-style: normal; font-weight: 700; font-display: swap; src: url("fonts/lato-latin-700-normal.de69cf9e514d.woff2") format("woff2"); }

:root {
  --surface: #FFFFFF;
  --surface-2: #E6EBF1;
  --line: #CFD8E2;
  --line-strong: #AAB8C8;
  --ink: #101A26;
  --ink-2: #46566A;
  --ink-3: #78889C;
  --navy: #244061;
  --navy-2: #152740;
  --on-navy: #F4F7FB;
  --petrol: #30646B;      /* CAIDAO.culture, KT05 */
  --petrol-2: #244d53;
  --gruen: #47998E;       /* „.culture“, KT04 */
  --petrol-hell: #EAF1F1;
  --f-body: "Lato", "Segoe UI", Helvetica, Arial, sans-serif;
  --radius: 14px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--surface);
  display: flex;
  flex-direction: column;
}
body.chat { background: var(--petrol-hell); }

/* ---------- Kopfzeile (Spezifikation caidao-produktkopfzeile) ---------- */
.sitehead { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); }
.sitehead .inner { display: flex; align-items: center; gap: 18px; padding: 12px 24px; max-width: 1120px; margin: 0 auto; width: 100%; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; margin-right: auto; min-width: 0; }
.logo img { height: 30px; width: auto; display: block; flex: none; }
/* Platzhalter für die Wortmarke: Produktname in Lato Light 300, Höhe wie das Bild */
.logo .wortmarke-text { font-weight: 300; font-size: 27px; line-height: 30px; height: 30px; color: var(--petrol); letter-spacing: .01em; flex: none; }
.logo span {
  font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 700;
  padding-left: 12px; border-left: 1px solid var(--line);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (max-width: 560px) { .logo span { display: none; } }
.sitenav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sitenav a.link { color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 7px 10px; border-radius: 5px; }
.sitenav a.link:hover { background: var(--surface-2); color: var(--ink); }

/* ---------- Schaltflächen (Spezifikation) ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  cursor: pointer; background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: 6px;
  padding: 9px 16px; font: inherit; font-size: 14px; font-weight: 500;
  color: var(--ink); text-decoration: none;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: var(--on-navy); }
.btn.primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn.primary:disabled { background: var(--line-strong); border-color: var(--line-strong); cursor: default; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn.sm { padding: 5px 11px; font-size: 13px; }
.badge { background: var(--petrol-hell); color: var(--petrol); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 99px; }

/* ---------- Chat ---------- */
.chat-wrap { flex: 1; min-height: 0; width: 100%; max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; }
.chat-log { flex: 1; overflow-y: auto; padding: 24px 16px 8px; display: flex; flex-direction: column; gap: 10px; scroll-behavior: smooth; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 88%; animation: pop .25s ease-out; }
.msg.bot { align-self: flex-start; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.avatar { width: 36px; height: 36px; border-radius: 50%; flex: none; }
.bubble { padding: 10px 14px; border-radius: var(--radius); white-space: pre-line; overflow-wrap: anywhere; }
.msg.bot .bubble { background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.user .bubble { background: var(--petrol); color: #fff; border-bottom-right-radius: 4px; }
.msg.closing .bubble { background: var(--surface); border: 1.5px solid var(--gruen); }
.typing .bubble { display: inline-flex; gap: 4px; }
.typing .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); animation: blink 1s infinite; }
.typing .dot:nth-child(2) { animation-delay: .15s; } .typing .dot:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 50% { opacity: .3; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { .msg, .typing .dot { animation: none; } .chat-log { scroll-behavior: auto; } }

.chat-input { background: var(--surface); border-top: 1px solid var(--line); padding: 12px 16px; }
.chat-input[aria-disabled="true"] { opacity: .6; pointer-events: none; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.choices:empty { display: none; }
.opt {
  font: inherit; font-size: 16px;
  padding: 9px 16px; min-height: 44px;
  border: 1.5px solid var(--petrol); border-radius: 99px;
  background: var(--surface); color: var(--petrol);
  cursor: pointer; text-align: left;
}
.opt:hover { background: var(--petrol-hell); }
.opt[aria-checked="true"] { background: var(--petrol); color: #fff; }
.opt.multi::before { content: "☐ "; } .opt.multi[aria-checked="true"]::before { content: "☑ "; }
.opt:focus-visible, .btn:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--gruen); outline-offset: 2px; }
textarea { width: 100%; min-height: 84px; resize: vertical; font: inherit; color: var(--ink); padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 6px; }
textarea:focus { border-color: var(--petrol); }
.counter { font-size: 13px; color: var(--ink-3); text-align: right; }
.actions { display: flex; gap: 8px; justify-content: flex-end; }
.actions .btn { min-height: 44px; font-size: 15px; padding: 8px 20px; }
#back { margin-right: auto; }
.error { color: #8a1c1c; background: #fbeaea; border-radius: 6px; padding: 8px 12px; margin-bottom: 10px; font-size: 15px; }
.notice { margin: 40px 16px; padding: 24px; background: var(--surface); border-radius: 8px; border: 1px solid var(--line); }

/* ---------- Inhaltsseiten ---------- */
.page { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 32px 24px 48px; }
.page h1 { font-weight: 300; font-size: 34px; color: var(--petrol); margin: 0 0 20px; }
.page h2 { font-size: 17px; font-weight: 700; color: var(--ink); margin: 28px 0 6px; }
.page p { color: var(--ink-2); margin: 0 0 10px; }
.page a { color: var(--petrol); }
.todo { background: #FFF6E5; border: 1px solid #F0D49B; border-radius: 6px; padding: 10px 14px; margin: 10px 0 16px; color: var(--ink-2); font-size: 15px; }

/* ---------- Fußzeile ---------- */
.sitefoot { background: var(--surface); border-top: 1px solid var(--line); }
.sitefoot .inner { display: flex; align-items: center; gap: 16px; padding: 10px 24px; max-width: 1120px; margin: 0 auto; }
.sitefoot img.culture { height: 18px; width: auto; display: block; }
.sitefoot nav { margin-left: auto; display: flex; gap: 14px; }
.sitefoot a { color: var(--ink-3); font-size: 12.5px; text-decoration: none; }
.sitefoot a:hover { color: var(--ink); text-decoration: underline; }
body.chat .sitefoot .inner { padding: 6px 24px; }

@media (max-width: 560px) {
  body { font-size: 16px; }
  .sitehead .inner { padding: 10px 16px; }
  .msg { max-width: 94%; }
  .opt { width: 100%; }
  .sitefoot .inner { padding: 6px 16px; }
}
