/* ============================================================
   SRAC Navigator — applies the nextgov iT design system to the
   citizen-services dashboard. Tokens live in colors_and_type.css.
   ============================================================ */

:root {
  /* Map legacy var names → nextgov iT tokens so existing markup
     keeps working without renames. */
  --color-bg:           var(--ngi-cream);
  --color-card:         var(--ngi-paper);
  --color-text:         var(--ngi-purple-900);
  --color-text-muted:   var(--ngi-purple-500);
  --color-accent:       var(--ngi-purple-700);
  --color-accent-soft:  var(--ngi-orange-100);
  --color-warn:         #B35900;
  --color-success:      #2A7A3A;
  --color-border:       var(--ngi-rule);
  --color-divider:      var(--ngi-rule);
  --radius:             4px;
  --shadow-sm:          var(--ngi-shadow-soft);
  --shadow-md:          var(--ngi-shadow-lift);
  --font:               var(--ngi-font-sans);
  --max-width:          960px;
}

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

body {
  font-family: var(--ngi-font-sans);
  font-feature-settings: var(--ngi-font-features);
  background: var(--ngi-cream);
  color: var(--ngi-ink);
  letter-spacing: -0.005em;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--ngi-purple-700);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

button { font: inherit; cursor: pointer; }

/* ---------- Topbar — purple over cream, orange accent dot ---------- */

.topbar {
  background: var(--ngi-purple-700);
  color: #fff;
  padding: 18px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px; height: 38px;
  border-radius: 4px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -0.04em;
}
.brand-mark::after {
  content: '';
  position: absolute;
  right: -2px; bottom: 4px;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--ngi-orange-600);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.18; }
.brand-text strong {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.7;
  margin-top: 2px;
}
.city-chip {
  background: rgba(255,255,255,0.10);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.city-chip::after { content: " ↓"; opacity: 0.6; margin-left: 2px; }
.city-chip:hover { background: rgba(255,255,255,0.18); border-color: rgba(255,255,255,0.32); }

/* ---------- Main layout ---------- */

.app {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 28px 64px;
}

.section { margin-bottom: 44px; }
.section h2 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ngi-purple-700);
}
.section p.section-sub {
  margin: 0 0 22px;
  color: var(--ngi-purple-500);
  font-size: 15px;
}

/* Eyebrow — all-caps tracked-out orange label above section heads. */
.eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ngi-orange-600);
  margin: 0 0 10px;
}
.eyebrow::before {
  content: '';
  display: inline-block;
  width: 28px; height: 2px;
  background: var(--ngi-orange-600);
  margin-right: 12px;
  vertical-align: middle;
}

/* ---------- Cards ---------- */

.card {
  background: var(--ngi-paper);
  border: 1px solid var(--ngi-rule);
  border-radius: 4px;
  padding: 20px;
  box-shadow: var(--ngi-shadow-soft);
}
.card.clickable {
  text-align: left;
  width: 100%;
  display: block;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.08s ease;
}
.card.clickable:hover {
  border-color: var(--ngi-rule-strong);
  box-shadow: var(--ngi-shadow-lift);
}
.card.clickable:active { transform: translateY(0); }

/* ---------- City picker ---------- */

.city-picker { display: grid; gap: 10px; }
.city-picker-intro { margin-bottom: 22px; }
.city-picker-intro h1 {
  margin: 0 0 8px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--ngi-purple-700);
}
.city-picker-intro p { margin: 0; color: var(--ngi-purple-500); font-size: 16px; }

.city-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-top: 3px solid transparent;
}
.city-row:hover { border-top-color: var(--ngi-orange-600); }
.city-row .city-crest {
  width: 44px; height: 44px;
  border-radius: 4px;
  background: var(--ngi-orange-100);
  color: var(--ngi-purple-700);
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px;
  letter-spacing: -0.02em;
}
.city-row .city-info { flex: 1; min-width: 0; }
.city-row .city-info strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ngi-purple-700);
  letter-spacing: -0.01em;
}
.city-row .city-info span {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ngi-purple-300);
  margin-top: 3px;
  display: inline-block;
}
.city-row .city-go { color: var(--ngi-purple-300); font-size: 18px; }

/* ---------- Lebenssituationen grid ---------- */

.ls-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.ls-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
  cursor: pointer;
  background: var(--ngi-paper);
  border: 1px solid var(--ngi-rule);
  border-top: 3px solid transparent;
  border-radius: 4px;
  padding: 18px;
  box-shadow: var(--ngi-shadow-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ls-card:hover {
  border-color: var(--ngi-rule-strong);
  border-top-color: var(--ngi-orange-600);
  box-shadow: var(--ngi-shadow-lift);
}
.ls-card-icon {
  width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ngi-orange-100);
  color: var(--ngi-purple-700);
  border-radius: 4px;
  font-size: 22px;
}
.ls-card strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--ngi-purple-700);
  letter-spacing: -0.01em;
}
.ls-card .ls-card-desc {
  font-size: 13px;
  color: var(--ngi-purple-500);
  line-height: 1.45;
}

/* ---------- Lebenssituation detail ---------- */

.ls-hero {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ngi-rule);
}
.ls-hero .ls-card-icon { width: 56px; height: 56px; font-size: 30px; border-radius: 4px; }
.ls-hero h1 {
  margin: 0;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--ngi-purple-700);
}
.ls-hero p {
  margin: 6px 0 0;
  color: var(--ngi-purple-500);
  font-size: 15px;
}

.steps { display: flex; flex-direction: column; gap: 14px; }
.step {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 16px;
  align-items: flex-start;
  background: var(--ngi-paper);
  border: 1px solid var(--ngi-rule);
  border-radius: 4px;
  padding: 18px;
  cursor: pointer;
  box-shadow: var(--ngi-shadow-soft);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.step:hover { border-color: var(--ngi-rule-strong); box-shadow: var(--ngi-shadow-lift); }
.step-badge {
  width: 34px; height: 34px;
  border-radius: 4px;
  background: var(--ngi-purple-700);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800;
  font-size: 14px;
  font-feature-settings: "tnum";
  letter-spacing: -0.02em;
}
.step-body strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--ngi-purple-700);
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}
.step-body .step-note { font-size: 13px; color: var(--ngi-purple-500); line-height: 1.5; }

/* ---------- Service detail ---------- */

.service-detail h1 {
  margin: 10px 0 8px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.028em;
  color: var(--ngi-purple-700);
}
.service-detail .category-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: transparent;
  color: var(--ngi-orange-600);
  border: 1px solid var(--ngi-rule);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.field-group {
  background: var(--ngi-paper);
  border: 1px solid var(--ngi-rule);
  border-radius: 4px;
  padding: 20px;
  margin-top: 16px;
}
.field-group h3 {
  margin: 0 0 10px;
  font-size: 11px;
  color: var(--ngi-orange-600);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
}
.field-group p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ngi-purple-900); }
.field-group ul { margin: 0; padding-left: 0; list-style: none; }
.field-group ul li {
  margin: 6px 0;
  font-size: 14px;
  color: var(--ngi-purple-900);
  padding-left: 40px;
  position: relative;
}
.field-group ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 28px;
  height: 2px;
  background: var(--ngi-orange-600);
}

.responsibility-note {
  background: var(--ngi-orange-100);
  border: 1px solid rgba(232,80,15,0.25);
  border-left: 3px solid var(--ngi-orange-600);
  color: var(--ngi-purple-900);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  margin-top: 14px;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn-primary {
  background: var(--ngi-orange-600);
  color: #fff;
}
.btn-primary:hover { background: #D9450A; text-decoration: none; }
.btn-secondary {
  background: transparent;
  color: var(--ngi-purple-700);
  border-color: var(--ngi-rule-strong);
}
.btn-secondary:hover { border-color: var(--ngi-purple-700); text-decoration: none; }

.office-card {
  background: var(--ngi-paper);
  border: 1px solid var(--ngi-rule);
  border-top: 3px solid var(--ngi-purple-700);
  border-radius: 4px;
  padding: 20px;
  margin-top: 16px;
}
.office-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--ngi-purple-700);
  letter-spacing: -0.01em;
}
.office-card .office-address {
  color: var(--ngi-purple-500);
  font-size: 14px;
  margin-bottom: 14px;
}
.office-card .hours-grid {
  display: grid;
  grid-template-columns: 110px 1fr;
  row-gap: 6px;
  font-size: 14px;
  font-feature-settings: "tnum";
}
.office-card .hours-grid .day {
  color: var(--ngi-purple-300);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  align-self: center;
}

/* ---------- Breadcrumb ---------- */

.crumbs {
  display: flex;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ngi-purple-300);
  margin-bottom: 22px;
  flex-wrap: wrap;
}
.crumbs a {
  color: var(--ngi-purple-300);
  text-decoration: none;
}
.crumbs a:hover { color: var(--ngi-purple-700); text-decoration: none; }
.crumbs span.sep { opacity: 0.5; }

/* ---------- Search ---------- */

.search-wrap {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.search-wrap input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 4px;
  border: 1px solid var(--ngi-rule);
  background: var(--ngi-paper);
  font: inherit;
  font-size: 16px;
  color: var(--ngi-ink);
  transition: border-color 0.15s ease;
}
.search-wrap input::placeholder { color: var(--ngi-purple-300); }
.search-wrap input:focus {
  outline: none;
  border-color: var(--ngi-orange-600);
}

.search-results { display: flex; flex-direction: column; gap: 12px; }
.search-hit {
  padding: 16px 18px;
  border-top: 3px solid transparent;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.search-hit:hover { border-top-color: var(--ngi-orange-600); }
.search-hit strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--ngi-purple-700);
  display: block;
  margin-top: 4px;
  letter-spacing: -0.01em;
}
.search-hit .hit-category {
  font-size: 10px;
  color: var(--ngi-orange-600);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.search-hit .hit-snippet {
  font-size: 13.5px;
  color: var(--ngi-purple-500);
  margin-top: 6px;
  line-height: 1.5;
}
.search-hit mark {
  background: var(--ngi-orange-100);
  color: var(--ngi-purple-900);
  padding: 0 3px;
  border-radius: 2px;
  font-weight: 500;
}

/* ---------- Footer ---------- */

.footer {
  text-align: center;
  padding: 28px 20px 36px;
  color: var(--ngi-purple-300);
  font-size: 12px;
  border-top: 1px solid var(--ngi-rule);
  background: var(--ngi-paper);
}

/* ---------- Misc ---------- */

.notice {
  background: var(--ngi-paper);
  border: 1px solid var(--ngi-rule);
  border-top: 3px solid var(--ngi-orange-600);
  border-radius: 4px;
  padding: 16px;
  text-align: center;
  color: var(--ngi-purple-700);
}

.loading {
  display: flex;
  justify-content: center;
  padding: 60px 20px;
  color: var(--ngi-purple-300);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.error {
  background: var(--ngi-paper);
  border: 1px solid rgba(232,80,15,0.4);
  border-left: 3px solid var(--ngi-orange-600);
  color: var(--ngi-purple-900);
  padding: 12px 16px;
  border-radius: 4px;
  margin: 10px 0;
  font-size: 14px;
}

/* ---------- Tabs (Start / Suchen / Chat) — editorial style ---------- */

.tabs {
  display: flex;
  gap: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--ngi-rule);
  padding-bottom: 0;
}
.tab {
  padding: 12px 2px;
  border: none;
  background: transparent;
  color: var(--ngi-purple-300);
  border-bottom: 2px solid transparent;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.tab:hover { color: var(--ngi-purple-700); }
.tab.active {
  color: var(--ngi-purple-700);
  border-bottom-color: var(--ngi-orange-600);
}

/* ---------- Chat — editorial bubbles, orange tick, eyebrow vorschlaege ---------- */

.chat-section { display: flex; flex-direction: column; }

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 6px 0 16px;
  min-height: 320px;
  max-height: calc(100vh - 360px);
  overflow-y: auto;
}

.chat-bubble {
  max-width: 86%;
  padding: 16px 18px;
  border-radius: 4px;
  box-shadow: var(--ngi-shadow-soft);
}
.chat-bubble-user {
  align-self: flex-end;
  background: var(--ngi-purple-700);
  color: #fff;
  border-bottom-right-radius: 2px;
}
.chat-bubble-user .chat-paragraph { color: #fff; }
.chat-bubble-user .chat-paragraph strong { color: #fff; }

.chat-bubble-assistant {
  align-self: flex-start;
  background: var(--ngi-paper);
  border: 1px solid var(--ngi-rule);
  border-top: 3px solid var(--ngi-orange-600);
  border-bottom-left-radius: 2px;
}

.chat-body {
  font-size: 15.5px;
  line-height: 1.6;
  color: var(--ngi-purple-900);
}
.chat-paragraph { margin: 0 0 10px; }
.chat-paragraph:last-child { margin-bottom: 0; }
.chat-list { margin: 8px 0 8px; padding-left: 0; list-style: none; }
.chat-list li {
  margin: 6px 0;
  padding-left: 40px;
  position: relative;
}
.chat-list li::before {
  content: '';
  position: absolute;
  left: 0; top: 0.7em;
  width: 28px; height: 2px;
  background: var(--ngi-orange-600);
}
.chat-bubble-user .chat-list li::before { background: var(--ngi-orange-500); }
.chat-body strong { font-weight: 700; color: var(--ngi-purple-700); }
.chat-error { color: #8A2A1F; }

.chat-thinking {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ngi-purple-300);
  padding: 4px 0;
}
.chat-thinking .dot {
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--ngi-orange-600);
  animation: chat-pulse 1.4s ease-in-out infinite;
}
.chat-thinking .dot:nth-child(2) { animation-delay: 0.2s; }
.chat-thinking .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes chat-pulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

.chat-refs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.chat-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
}
.chat-chip-ls {
  background: var(--ngi-purple-700);
  color: #fff;
}
.chat-chip-service {
  background: transparent;
  color: var(--ngi-orange-600);
  border-color: var(--ngi-rule);
}
.chat-chip:hover { filter: brightness(1.05); text-decoration: none; }
.chat-chip-service:hover { border-color: var(--ngi-orange-600); }

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
}
.chat-suggestions-label {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--ngi-orange-600);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-right: 6px;
}
.chat-suggestions-label::before {
  content: '';
  display: inline-block;
  width: 18px; height: 2px;
  background: var(--ngi-orange-600);
  margin-right: 8px;
}
.chat-suggestion {
  background: var(--ngi-paper);
  border: 1px solid var(--ngi-rule);
  border-radius: 4px;
  padding: 9px 14px;
  font-size: 13px;
  color: var(--ngi-purple-700);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
  text-align: left;
  font-family: inherit;
}
.chat-suggestion:hover {
  background: var(--ngi-orange-100);
  border-color: var(--ngi-orange-600);
}

.chat-empty {
  padding: 36px 24px;
  text-align: center;
  color: var(--ngi-purple-500);
}
.chat-empty-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--ngi-purple-700);
  margin-bottom: 8px;
  letter-spacing: -0.015em;
}
.chat-empty-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ngi-orange-600);
  margin-bottom: 16px;
}
.chat-empty .chat-suggestions { justify-content: center; }

.chat-input-row {
  display: flex;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--ngi-rule);
}
.chat-input-row input {
  flex: 1;
  padding: 13px 16px;
  border-radius: 4px;
  border: 1px solid var(--ngi-rule);
  background: var(--ngi-paper);
  font: inherit;
  font-size: 15px;
  color: var(--ngi-ink);
  transition: border-color 0.15s ease;
}
.chat-input-row input::placeholder { color: var(--ngi-purple-300); }
.chat-input-row input:focus { outline: none; border-color: var(--ngi-orange-600); }
.chat-input-row input:disabled { opacity: 0.5; }
.chat-send { padding: 13px 22px; font-weight: 700; }
.chat-send:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 640px) {
  .brand-sub { display: none; }
  .topbar { padding: 14px 18px; }
  .app { padding: 20px 16px 44px; }
  .section h2 { font-size: 24px; }
  .city-picker-intro h1 { font-size: 26px; }
  .ls-hero h1 { font-size: 26px; }
  .service-detail h1 { font-size: 26px; }
  .step { grid-template-columns: 34px 1fr; }
  .office-card .hours-grid { grid-template-columns: 96px 1fr; }
}
