/* Laumer Bewerbungsassistent — Chat-UI im Laumer Corporate Design.
   Farb-Tokens aus ~/.claude/laumer-ci/css/laumer.css (Master-CI). */
:root {
  --primary: #1D3A8F;         /* Laumer Corporate Blau */
  --primary-dark: #162E70;
  --accent: #2E75B6;          /* helleres Akzent-Blau */
  --accent-light: #D6E4F0;
  --bg: #F5F6FA;
  --card-bg: #FFFFFF;
  --text: #2C3E50;
  --text-muted: #7F8C8D;
  --border: #E1E8ED;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(29,58,143,0.12);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

/* ---- Navbar (Laumer CI) ---- */
.navbar {
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  height: 56px;
  padding: 0 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.nav-brand-link {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
}
.nav-logo {
  height: 26px;
  width: auto;
  filter: brightness(0) invert(1);   /* Marken-Blau-Logo → weiss auf Blau */
  flex-shrink: 0;
}
.nav-subtitle {
  color: rgba(255,255,255,0.65);
  font-size: 0.85rem;
  white-space: nowrap;
}
@media (max-width: 520px) { .nav-subtitle { display: none; } }

/* ---- Main / Chat-Layout ---- */
main {
  flex: 1;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.chat-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 1rem 0 0.5rem;
}
.chat-log {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow-y: auto;
  padding-bottom: 0.5rem;
}

/* ---- Nachrichten-Blasen ---- */
.msg { display: flex; }
.msg.assistant { justify-content: flex-start; }
.msg.user { justify-content: flex-end; }
.bubble {
  max-width: 82%;
  padding: 0.7rem 0.95rem;
  border-radius: var(--radius);
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow);
}
.msg.assistant .bubble {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 3px;
}
.msg.user .bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 3px;
}
/* RTL: Blasen-Ecken spiegeln */
[dir="rtl"] .msg.assistant .bubble { border-bottom-left-radius: var(--radius); border-bottom-right-radius: 3px; }
[dir="rtl"] .msg.user .bubble { border-bottom-right-radius: var(--radius); border-bottom-left-radius: 3px; }

/* ---- Tipp-Indikator ---- */
.typing {
  display: none;
  gap: 4px;
  padding: 0.5rem 0.25rem;
  align-items: center;
}
.typing.htmx-request { display: flex; }
.typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  opacity: 0.4;
  animation: blink 1.2s infinite both;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%,80%,100% { opacity: 0.3; } 40% { opacity: 1; } }

/* ---- Composer (sticky unten) ---- */
.composer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  background: var(--bg);
  padding: 0.6rem 0 0.4rem;
}
.composer .upload-form { display: flex; align-items: flex-end; }
.composer .chat-form { flex: 1; display: flex; align-items: flex-end; gap: 0.5rem; min-width: 0; }
.composer textarea {
  flex: 1 1 0;
  min-width: 0;            /* iOS Safari: Textarea in Flex-Zeile schrumpfen lassen (sonst Umbruch) */
  width: 100%;
  resize: none;
  max-height: 140px;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card-bg);
  font: inherit;
  color: var(--text);
  box-shadow: var(--shadow);
}
.composer textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border-radius: var(--radius);
  background: var(--card-bg);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1.2rem;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.upload-btn:hover { background: var(--accent-light); }
.composer button {
  height: 44px;
  padding: 0 1.1rem;
  border: none;
  border-radius: var(--radius);
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow);
  flex-shrink: 0;
  transition: background 0.15s;
}
.composer button:hover { background: var(--primary-dark); }
.composer button:disabled, .composer textarea:disabled { opacity: 0.55; cursor: default; }

.upload-hint {
  color: var(--text-muted);
  font-size: 0.78rem;
  text-align: center;
  padding: 0.15rem 0 0.5rem;
}

/* ---- Footer ---- */
.footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.78rem;
  padding: 0.75rem 1rem;
}
.footer a { color: var(--accent); }

/* ---- Einwilligungs-Gate (DSGVO) ---- */
.consent-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 1.5rem 0; }
.consent-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 1.5rem; max-width: 640px; width: 100%;
}
.consent-card h1 { font-size: 1.25rem; color: var(--primary); margin-bottom: 0.75rem; }
.consent-body { color: var(--text); margin-bottom: 0.75rem; }
.consent-more { margin-bottom: 1.25rem; font-size: 0.9rem; }
.consent-more a { color: var(--accent); }
.consent-btn {
  background: var(--primary); color: #fff; border: none; border-radius: var(--radius);
  padding: 0.75rem 1.3rem; font: inherit; font-weight: 600; cursor: pointer; box-shadow: var(--shadow);
}
.consent-btn:hover { background: var(--primary-dark); }
