/* ================================================================
   taz Hilfs-Assistent – Styles
   ================================================================ */

/* ---------- tokens ---------- */
:root {
  --taz-red:         #E30613;
  --taz-red-dark:    #b6050f;
  --taz-red-light:   #fde7e9;
  --surface:         #ffffff;
  --surface-alt:     #f6f4f4;
  --text:            #1a1a1a;
  --text-muted:      #6a5a5c;
  --radius:          10px;
  --shadow:          0 2px 12px rgba(0,0,0,.08);
  --form-green:      #1f8f5d;
  --form-green-dark: #166b46;
  --form-green-bg:   #e8f5ee;
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--surface-alt);
  line-height: 1.6;
}
a { color: var(--taz-red); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- hero ---------- */
.hero {
  background: var(--taz-red);
  color: #fff;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}
.hero-inner { max-width: 640px; margin: 0 auto; }
.hero-logo {
  display: block;
  margin: 0 auto .6rem;
  width: 140px;
  height: auto;
}
.hero h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: .25rem; }
.hero-title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .7rem;
  flex-wrap: wrap;
}
.hero-title-row h1 { margin-bottom: 0; }
.hero-robot {
  display: inline-block;
  vertical-align: -0.25em;
  margin-right: .35rem;
}
.beta-badge {
  display: inline-block;
  background: #fff;
  color: #E30613;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .12em;
  padding: .22rem .6rem;
  border-radius: 999px;
  text-transform: uppercase;
}
.beta-note {
  margin: .7rem auto 0;
  max-width: 46rem;
  font-size: .85rem;
  color: var(--taz-red-dark, #b6050f);
  background: var(--taz-red-light, #fde7e9);
  border: 1px solid rgba(227,6,19,.35);
  padding: .45rem .9rem;
  border-radius: .5rem;
  text-align: left;
}
.hero-sub { font-size: 1rem; opacity: .92; }
.hero-sub a { color: #fff; text-decoration: underline; }
.hero-byline {
  margin-top: .6rem;
  font-size: .9rem;
  opacity: .95;
  background: rgba(255,255,255,.14);
  display: inline-block;
  padding: .35rem .85rem;
  border-radius: 999px;
}
.hero-byline a { color: #fff; text-decoration: underline; }
.hero-byline strong { font-weight: 700; }

/* ---------- container ---------- */
.container { max-width: 720px; margin: 0 auto; padding: 1rem 1rem 2rem; }

/* ---------- chat panel ---------- */
.chat-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.chat-messages {
  height: 400px;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.msg { display: flex; }
.msg.user { justify-content: flex-end; }
.msg.assistant { justify-content: flex-start; }
.msg-bubble {
  max-width: 80%;
  padding: .65rem 1rem;
  border-radius: var(--radius);
  font-size: .95rem;
  line-height: 1.55;
  white-space: pre-wrap;
}
.msg.user .msg-bubble {
  background: var(--taz-red);
  color: #fff;
  border-bottom-right-radius: 2px;
}
.msg.assistant .msg-bubble {
  background: var(--surface-alt);
  color: var(--text);
  border-bottom-left-radius: 2px;
}
.msg-bubble.typing::after {
  content: "●";
  animation: blink .8s infinite;
}
@keyframes blink { 50% { opacity: .2; } }

/* sources */
.msg-sources {
  margin-top: .4rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.msg-sources summary {
  cursor: pointer;
  user-select: none;
}
.msg-sources .src-item {
  display: block;
  margin-top: .3rem;
  padding: .4rem .6rem;
  background: var(--surface);
  border-radius: 6px;
  font-size: .78rem;
  line-height: 1.45;
  border: 1px solid #e2e6e4;
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease;
}
.msg-sources .src-item:hover {
  border-color: var(--taz-red);
  color: var(--taz-red-dark);
}

/* separate subdued "form/other page" bubble */
.msg.form {
  display: flex;
  margin-top: .45rem;
}
.msg-bubble.form {
  padding: 0;
  background: var(--form-green-bg);
  border: 1px solid #cfe7db;
  border-radius: 8px;
  overflow: hidden;
}
.w-form-link {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .5rem .85rem;
  color: var(--form-green-dark);
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease;
}
.w-form-link:hover { background: #d9efe4; }
.w-form-icon { font-size: 1.05em; line-height: 1; }

/* ---------- input row ---------- */
.chat-input-row {
  display: flex;
  border-top: 1px solid #e2e6e4;
  padding: .5rem;
  gap: .4rem;
}
#chat-input {
  flex: 1;
  border: none;
  outline: none;
  padding: .65rem .85rem;
  font-size: .95rem;
  background: transparent;
}
#send-btn {
  background: var(--taz-red);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s;
}
#send-btn:hover { background: var(--taz-red-dark); }
#send-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- info grid ---------- */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 2rem;
}
.info-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: var(--shadow);
}
.info-card h3 {
  font-size: 1rem;
  margin-bottom: .6rem;
  color: var(--taz-red);
}
.info-card p { font-size: .88rem; color: var(--text-muted); line-height: 1.55; }
.info-card ul { margin: .6rem 0 0; padding-left: 1.1rem; }
.info-card li { font-size: .85rem; color: var(--text-muted); margin-bottom: .35rem; line-height: 1.5; }
.info-card li strong { color: var(--text); font-weight: 600; }
.info-card code {
  background: var(--surface-alt);
  border: 1px solid #e6dede;
  border-radius: 4px;
  padding: .05rem .3rem;
  font-size: .8em;
  color: var(--taz-red-dark);
}

/* ---------- footer ---------- */
.site-footer {
  text-align: center;
  padding: 2rem 1rem;
  font-size: .82rem;
  color: var(--text-muted);
}
.site-footer p { margin-bottom: .35rem; }
.site-footer p:last-child { margin-bottom: 0; }
.footer-beta {
  font-weight: 700;
  color: #E30613;
}

/* ---------- responsive ---------- */
@media (max-width: 768px) {
  .info-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { padding: 1.5rem 1rem 1.25rem; }
  .hero h1 { font-size: 1.35rem; }
  .chat-messages { height: 380px; }
  .msg-bubble { max-width: 90%; }
}

/* ================================================================
   Floating Chat Widget
   ================================================================ */
#taz-widget-toggle {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 9999;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--taz-red);
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(227,6,19,.35);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .2s, background .15s;
}
#taz-widget-toggle:hover { background: var(--taz-red-dark); transform: scale(1.06); }
#taz-widget-toggle #taz-widget-logo {
  width: 34px;
  height: 13px;
  display: block;
  pointer-events: none;
  transition: opacity .2s;
}

#taz-widget-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  z-index: 9998;
  width: 370px;
  max-height: 620px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(.96);
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
#taz-widget-panel.open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
#taz-widget-panel .w-header {
  background: var(--taz-red);
  color: #fff;
  padding: .6rem 1rem;
  display: flex;
  align-items: center;
  gap: .6rem;
}
#taz-widget-panel .w-header-logo {
  height: 16px;
  width: auto;
  display: block;
}
#taz-widget-panel .w-header-title {
  font-weight: 700;
  font-size: .95rem;
}
#taz-widget-panel .w-beta {
  margin-left: auto;
  background: #fff;
  color: #E30613;
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .1em;
  padding: .14rem .45rem;
  border-radius: 999px;
  text-transform: uppercase;
  line-height: 1.2;
}
#taz-widget-panel .w-messages {
  flex: 1;
  overflow-y: auto;
  padding: .75rem;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  max-height: 470px;
}
#taz-widget-panel .w-input-row {
  display: flex;
  border-top: 1px solid #e2e6e4;
  padding: .4rem;
  gap: .35rem;
}
#taz-widget-panel .w-input {
  flex: 1;
  border: none;
  outline: none;
  padding: .55rem .7rem;
  font-size: .88rem;
}
#taz-widget-panel .w-send {
  background: var(--taz-red);
  color: #fff;
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: background .15s;
}
#taz-widget-panel .w-send:hover { background: var(--taz-red-dark); }
#taz-widget-panel .w-send:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 480px) {
  #taz-widget-panel {
    right: .5rem;
    left: .5rem;
    bottom: 5rem;
    width: auto;
    max-height: 70vh;
  }
}
