/* =====================================================
   PolicyLens — style.css
   Clean, modern, professional design
   ===================================================== */

/* ---- CSS Variables ---- */
:root {
  --bg:          #f8f9fc;
  --bg-card:     #ffffff;
  --bg-alt:      #f0f2f8;
  --border:      #e2e6f0;
  --border-focus:#6366f1;

  --text:        #111827;
  --text-muted:  #6b7280;
  --text-light:  #9ca3af;

  --primary:     #6366f1;
  --primary-dark:#4f46e5;
  --primary-light:#eef2ff;

  --success:     #10b981;
  --success-bg:  #ecfdf5;
  --warning:     #f59e0b;
  --warning-bg:  #fffbeb;
  --danger:      #ef4444;
  --danger-bg:   #fef2f2;

  --radius:      12px;
  --radius-sm:   8px;
  --radius-lg:   16px;
  --shadow:      0 1px 3px rgba(0,0,0,0.08), 0 4px 16px rgba(0,0,0,0.06);
  --shadow-lg:   0 4px 24px rgba(0,0,0,0.12);

  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --font-mono:   'Fira Code', monospace;

  --transition:  0.2s ease;

  --header-h:    64px;
}

/* ---- Dark Mode ---- */
[data-theme="dark"] {
  --bg:          #0f1117;
  --bg-card:     #1a1d27;
  --bg-alt:      #141720;
  --border:      #2d3148;
  --border-focus:#818cf8;

  --text:        #f1f5f9;
  --text-muted:  #94a3b8;
  --text-light:  #64748b;

  --primary:     #818cf8;
  --primary-dark:#6366f1;
  --primary-light:#1e1b4b;

  --success:     #34d399;
  --success-bg:  #064e3b;
  --warning:     #fbbf24;
  --warning-bg:  #451a03;
  --danger:      #f87171;
  --danger-bg:   #450a0a;

  --shadow:      0 1px 3px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.3);
  --shadow-lg:   0 4px 24px rgba(0,0,0,0.5);
}

/* ---- Reset & Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background var(--transition), color var(--transition);
  min-height: 100vh;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* =====================================================
   HEADER
   ===================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(255,255,255,0.88);
}
[data-theme="dark"] .site-header {
  background: rgba(26,29,39,0.88);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.logo-icon { font-size: 1.4rem; }

.header-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.header-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color var(--transition);
}
.header-nav a:hover { color: var(--primary); text-decoration: none; }

/* =====================================================
   BUTTONS
   ===================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
  text-decoration: none !important;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--bg-alt);
  color: var(--text);
}

.btn-lg { padding: 0.75rem 1.75rem; font-size: 1rem; border-radius: var(--radius); }
.btn-xl { padding: 0.9rem 2.5rem; font-size: 1.05rem; border-radius: var(--radius); }
.btn-sm { padding: 0.35rem 0.85rem; font-size: 0.82rem; border-radius: 6px; }

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-icon {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0.3rem 0.4rem;
  border-radius: 6px;
  transition: background var(--transition);
  color: var(--text-muted);
}
.btn-icon:hover { background: var(--bg-alt); }

/* =====================================================
   SPINNER
   ===================================================== */
.spinner {
  display: inline-block;
  width: 1rem;
  height: 1rem;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =====================================================
   MODAL
   ===================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}
.modal-header h2 { font-size: 1.1rem; font-weight: 700; }

.modal-body { padding: 1.5rem; }
.modal-close {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.25rem;
}
.modal-close:hover { color: var(--text); }

/* =====================================================
   FORMS
   ===================================================== */
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.4rem;
}
.label-hint {
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 0.5rem;
  font-size: 0.8rem;
}

.input-group {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  transition: border-color var(--transition);
}
.input-group:focus-within { border-color: var(--border-focus); }
.input-group .input {
  border: none;
  border-radius: 0;
  background: transparent;
  flex: 1;
}
.input-group .btn-icon { border-radius: 0; padding: 0.5rem 0.75rem; }

.input {
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-family: var(--font);
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
}
.input:focus { border-color: var(--border-focus); }

.hint-text {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* =====================================================
   ALERTS
   ===================================================== */
.alert {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
}
.alert-warning {
  background: var(--warning-bg);
  color: #92400e;
  border: 1px solid #fde68a;
}
[data-theme="dark"] .alert-warning { color: var(--warning); border-color: var(--warning); }

/* =====================================================
   MAIN LAYOUT
   ===================================================== */
.main { min-height: calc(100vh - var(--header-h)); }

.section-inner {
  max-width: 1000px;
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--text);
}

/* =====================================================
   HERO
   ===================================================== */
.hero {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 60%);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .hero {
  background: linear-gradient(135deg, #1e1b4b 0%, var(--bg) 70%);
}

.hero-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.35rem 1rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--primary);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1.25rem;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.chip {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* =====================================================
   COMPACT HERO BANNER
   ===================================================== */
.hero-compact {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg) 60%);
  border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .hero-compact {
  background: linear-gradient(135deg, #1e1b4b 0%, var(--bg) 70%);
}
.hero-compact-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 2rem 1.5rem 1.5rem;
  text-align: center;
}
.hero-title-compact {
  font-size: clamp(1.5rem, 3.5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}
.hero-subtitle-compact {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto 1rem;
  line-height: 1.6;
}
.hero-compact .hero-chips {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* =====================================================
   HOW IT WORKS
   ===================================================== */
.how-it-works {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 1.5rem;
}

.step {
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  transition: box-shadow var(--transition);
}
.step:hover { box-shadow: var(--shadow); }

.step-number {
  position: absolute;
  top: -0.75rem;
  left: 1.25rem;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.step-icon { font-size: 2rem; display: block; margin-bottom: 0.75rem; }

.step h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.step p {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* =====================================================
   UPLOAD SECTION
   ===================================================== */
.upload-section { border-bottom: 1px solid var(--border); }

/* CARDS */
.card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  transition: box-shadow var(--transition);
}

.card-header { margin-bottom: 1.25rem; }
.card-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.card-subtitle { font-size: 0.875rem; color: var(--text-muted); }

.step-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.required { color: var(--danger); margin-left: 0.1rem; }

/* ROLE GRID */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  padding: 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.role-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.role-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.role-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.role-icon { font-size: 1.5rem; }
.role-name { font-size: 0.875rem; font-weight: 600; }
.role-desc { font-size: 0.78rem; color: var(--text-muted); }

/* DROPZONE */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 2.5rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.dropzone-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }
.dropzone-text { font-size: 1rem; font-weight: 600; margin-bottom: 0.25rem; }
.dropzone-subtext { font-size: 0.875rem; color: var(--text-muted); margin-bottom: 0.75rem; }
.dropzone-formats {
  font-size: 0.78rem;
  color: var(--text-light);
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

.file-input-hidden {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.dropzone-loaded {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.file-preview {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.file-preview-icon { font-size: 1.5rem; }
.file-preview-name { font-size: 0.875rem; font-weight: 600; }
.file-preview-size { font-size: 0.78rem; color: var(--text-muted); }

/* EXAMPLE DOCUMENT ROW */
.example-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.85rem;
  justify-content: center;
  flex-wrap: wrap;
}
.example-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.btn-example {
  background: none;
  border: 1px dashed var(--primary);
  color: var(--primary);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-sans);
}
.btn-example:hover {
  background: var(--primary-light);
}

/* EXTRACTED TEXT PREVIEW */
.extracted-preview {
  margin-top: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.extracted-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--bg-alt);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.char-count {
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.extracted-text {
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  background: var(--bg-card);
  max-height: 140px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ANALYZE ROW */
.analyze-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 0 0.5rem;
}

.analyze-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  min-height: 1.2em;
  transition: color 0.2s;
}
.analyze-hint:not(:empty) {
  color: var(--primary);
  font-weight: 500;
}

/* =====================================================
   RESULTS SECTION
   ===================================================== */
.results-section { border-bottom: 1px solid var(--border); }

.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.results-meta { font-size: 0.875rem; color: var(--text-muted); }

.results-actions { display: flex; gap: 0.75rem; flex-shrink: 0; }

.risk-badge-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
}
.risk-badge.low  { background: var(--success-bg); color: var(--success); }
.risk-badge.medium { background: var(--warning-bg); color: #92400e; }
.risk-badge.high { background: var(--danger-bg); color: var(--danger); }
[data-theme="dark"] .risk-badge.medium { color: var(--warning); }

.doc-type-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: 0.3rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
}

/* BREAKDOWN GRID */
.breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 2.5rem;
}

@media (max-width: 700px) {
  .breakdown-grid { grid-template-columns: 1fr; }
}

.breakdown-card {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 0;
}

.full-width { grid-column: 1 / -1; }

.bcard-icon { font-size: 1.5rem; flex-shrink: 0; }

.bcard-title {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
  color: var(--text);
}

.bcard-body {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.bcard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.bcard-list li {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-left: 1.25rem;
  position: relative;
  line-height: 1.55;
}
.bcard-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

.obligations-list li::before { content: '✓'; color: var(--success); }
.action-list li::before { content: '→'; color: var(--warning); }

.deadline-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.6rem 0.85rem;
  background: var(--warning-bg);
  border-left: 3px solid var(--warning);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
[data-theme="dark"] .deadline-item { background: rgba(251,191,36,0.08); }
.deadline-date { font-size: 0.78rem; font-weight: 700; color: #92400e; white-space: nowrap; }
[data-theme="dark"] .deadline-date { color: var(--warning); }
.deadline-desc { font-size: 0.82rem; color: var(--text-muted); }

/* No deadlines */
.no-deadlines {
  font-size: 0.875rem;
  color: var(--success);
  font-weight: 500;
}

/* GLOSSARY */
.glossary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.75rem;
}

.glossary-item {
  padding: 0.85rem 1rem;
  background: var(--bg-alt);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.glossary-term {
  font-size: 0.82rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.glossary-def {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* =====================================================
   CHAT SECTION
   ===================================================== */
.chat-section {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.chat-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}
.chat-header h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 0.2rem; }
.chat-header p { font-size: 0.82rem; color: var(--text-muted); }

.chat-messages {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 180px;
  max-height: 480px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.chat-message {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.user-message { flex-direction: row-reverse; }

.message-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: var(--bg-alt);
  flex-shrink: 0;
}

.message-bubble {
  max-width: 80%;
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  line-height: 1.6;
}

.assistant-message .message-bubble {
  background: var(--bg-alt);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.user-message .message-bubble {
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}

/* Chat loading bubble */
.typing-indicator {
  display: flex;
  gap: 4px;
  align-items: center;
  padding: 0.5rem;
}
.typing-dot {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: bounce 1.2s infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes bounce {
  0%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-6px); }
}

.chat-input-row {
  display: flex;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  background: var(--bg);
}

.chat-input {
  flex: 1;
  padding: 0.6rem 1rem;
  font-family: var(--font);
  font-size: 0.9rem;
  background: var(--bg-card);
  color: var(--text);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color var(--transition);
}
.chat-input:focus { border-color: var(--border-focus); }

.chat-hint {
  padding: 0 1.25rem 0.75rem;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* =====================================================
   ERROR TOAST
   ===================================================== */
.error-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-width: 90vw;
}
.error-toast button {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--danger);
  font-size: 1rem;
  padding: 0;
}

/* =====================================================
   FOOTER
   ===================================================== */
.site-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 2rem 1.5rem;
  text-align: center;
}
.footer-inner {
  max-width: 700px;
  margin: 0 auto;
  font-size: 0.875rem;
  color: var(--text-muted);
}
.footer-disclaimer {
  margin-top: 0.5rem;
  font-size: 0.78rem;
  color: var(--text-light);
}

/* =====================================================
   UTILITIES
   ===================================================== */
.hidden { display: none !important; }

/* Scroll to results animation */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
.results-section:not(.hidden) {
  animation: fadeInUp 0.4s ease;
}

/* Responsive */
@media (max-width: 640px) {
  .hero-title { font-size: 2rem; }
  .section-inner { padding: 2.5rem 1rem; }
  .card { padding: 1.25rem; }
  .role-grid { grid-template-columns: 1fr 1fr; }
  .breakdown-grid { grid-template-columns: 1fr; }
  .results-header { flex-direction: column; }
  .header-nav a { display: none; }
}
