/* =====================
   RESET & ROOT
   ===================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f5f3ef;
  --surface: #ffffff;
  --surface-2: #f0ede8;
  --border: #e2ddd6;
  --text: #1a1714;
  --text-muted: #6b6460;
  --accent: #1a56a0;
  --accent-light: #e4edf8;
  --accent-dark: #113d78;
  --user-bg: #1a56a0;
  --user-text: #ffffff;
  --ai-bg: #ffffff;
  --success: #2d7a4f;
  --success-light: #e8f5ee;
  --radius: 16px;
  --radius-sm: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.11);
  --header-bg: #0f1f3d;
  --header-border: #1e3560;
  --header-text-muted: rgba(255,255,255,0.55);
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.app-header {
  background: var(--header-bg);
  border-bottom: 1px solid var(--header-border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.app-logo__wordmark {
  font-family: 'DM Sans', sans-serif;
  font-size: 1.35rem;
  color: #ffffff;
  letter-spacing: -0.01em;
  line-height: 1;
}

.app-logo__wordmark em {
  font-style: normal;
  color: #FEC13E;
}

.app-logo__divider {
  width: 1px;
  height: 18px;
  background: var(--header-border);
}

.app-logo__label {
  font-size: 0.8rem;
  color: var(--header-text-muted);
  font-weight: 400;
}

.progress-info {
  font-size: 0.78rem;
  color: var(--header-text-muted);
  background: rgba(255,255,255,0.08);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.1);
}

/* MAIN LAYOUT */
.app-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 140px;
}

/* MESSAGES */
.messages {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.msg {
  display: flex;
  gap: 12px;
  animation: fadeUp 0.3s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.msg--ai   { align-items: flex-start; }
.msg--user { align-items: flex-start; flex-direction: row-reverse; }

.msg__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 2px;
}

.msg--ai   .msg__avatar { background: var(--accent-light); }
.msg--user .msg__avatar { background: var(--user-bg); }

.msg__bubble {
  max-width: 85%;
  padding: 14px 18px;
  border-radius: var(--radius);
  line-height: 1.65;
  font-size: 0.95rem;
}

.msg--ai .msg__bubble {
  background: var(--ai-bg);
  border: 1px solid var(--border);
  border-top-left-radius: 4px;
  box-shadow: var(--shadow);
}

.msg--user .msg__bubble {
  background: var(--user-bg);
  color: var(--user-text);
  border-top-right-radius: 4px;
}

.msg__bubble p + p { margin-top: 8px; }
.msg__bubble strong { font-weight: 600; }

/* TYPING INDICATOR */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.3s ease both;
}

.typing-dots {
  background: var(--ai-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  border-top-left-radius: 4px;
  padding: 14px 18px;
  display: flex;
  gap: 5px;
  align-items: center;
  box-shadow: var(--shadow);
}

.typing-dots span {
  width: 7px; height: 7px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* SECTION DIVIDER */
.section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 8px 0;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* INPUT AREA */
.input-area {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, var(--bg) 75%, transparent);
  padding: 12px 16px 16px;
}

.input-inner {
  max-width: 760px;
  margin: 0 auto;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 10px 10px 16px;
  box-shadow: var(--shadow-lg);
  transition: border-color 0.2s;
}

.input-inner:focus-within { border-color: var(--accent); }

#userInput {
  flex: 1;
  border: none;
  outline: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  background: transparent;
  color: var(--text);
  resize: none;
  max-height: 120px;
  line-height: 1.5;
}

#userInput::placeholder { color: var(--text-muted); }

#sendBtn {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--accent);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.1s;
  flex-shrink: 0;
}

#sendBtn:hover    { background: var(--accent-dark); }
#sendBtn:active   { transform: scale(0.94); }
#sendBtn:disabled { background: var(--border); cursor: default; }
#sendBtn svg      { width: 18px; height: 18px; }

/* SHIFT+ENTER HINT */
.input-hint {
  max-width: 760px;
  margin: 6px auto 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  opacity: 0.7;
}

/* QUICK REPLIES (voor later gebruik) */
.quick-replies {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  max-width: 760px;
  margin-inline: auto;
}

.chip {
  padding: 7px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  transition: all 0.15s;
}

.chip:hover { background: var(--accent); color: #fff; }

/* RESULT PANEL */
.result-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  margin-top: 8px;
}

.result-header {
  background: var(--success-light);
  border-bottom: 1px solid #c3e6d0;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.result-header h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--success);
}

.result-body { padding: 20px; }

.result-service {
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.result-service:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.result-service h4 {
  font-family: 'DM Serif Display', serif;
  font-size: 1.1rem;
  color: var(--accent);
  margin-bottom: 12px;
}

.result-field {
  margin-bottom: 8px;
  font-size: 0.9rem;
  line-height: 1.6;
}

.result-field strong {
  display: block;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
  font-weight: 600;
}

.result-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}

.copy-btn:hover { background: var(--accent-dark); }

.new-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  cursor: pointer;
  transition: all 0.2s;
}

.new-btn:hover { border-color: var(--accent); color: var(--accent); }
