/* ══════════════════════════════════════════════════
   AI Strategy Engine — Studio Auralis
   Unique AI-themed design — Premium level
   ══════════════════════════════════════════════════ */

:root {
  --noir:         #060910;
  --noir-card:    #0B0F18;
  --noir-border:  #1E2536;
  --noir-hover:   #111726;
  --gold:         #00E5CC;
  --gold-bright:  #50FFEB;
  --gold-dim:     #00BFA6;
  --gold-glow:    rgba(0,229,204,.45);
  --gold-bg:      rgba(0,229,204,.05);
  --gold-border:  rgba(0,229,204,.10);
  --text-100:     #E8EAED;
  --text-80:      #B8BCC5;
  --text-60:      #7A8494;
  --text-40:      #4F5B6E;

  --font-display: 'Outfit', sans-serif;
  --font-serif:   'Instrument Serif', serif;
  --font-mono:    'JetBrains Mono', monospace;

  --ease-out:     cubic-bezier(.23,1,.32,1);
  --ease-smooth:  cubic-bezier(.4,0,.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-80);
  background: var(--noir);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { border: none; background: none; font: inherit; cursor: pointer; }
::selection { background: rgba(0,229,204,.2); color: var(--text-100); }

/* ---- Utility ---- */
.serif-gold {
  font-family: var(--font-serif);
  font-style: italic;
  color: var(--gold);
}

.overline {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
  position: relative;
  padding-left: 28px;
}
.overline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 18px;
  height: 1px;
  background: var(--gold);
}

/* ══════════ AI BACKGROUND (unique) ══════════ */
.ai-bg {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 80% at 50% 100%, rgba(6,9,16,0) 30%, rgba(6,9,16,1) 70%),
    radial-gradient(ellipse 100% 100% at 50% 50%, #060910 0%, #080C16 100%);
}

/* Perspective data grid */
.ai-grid {
  position: absolute;
  bottom: 0; left: -20%;
  width: 140%; height: 65%;
  background:
    linear-gradient(rgba(0,229,204,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,229,204,.04) 1px, transparent 1px);
  background-size: 60px 60px;
  transform: perspective(500px) rotateX(55deg);
  transform-origin: bottom center;
  mask-image: linear-gradient(to top, rgba(0,0,0,.5) 0%, rgba(0,0,0,.1) 40%, transparent 70%);
  -webkit-mask-image: linear-gradient(to top, rgba(0,0,0,.5) 0%, rgba(0,0,0,.1) 40%, transparent 70%);
  animation: gridScroll 20s linear infinite;
}

@keyframes gridScroll {
  0% { background-position: 0 0, 0 0; }
  100% { background-position: 0 60px, 0 0; }
}

/* Floating orbs — neural network glow */
.ai-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
}

.ai-orb--1 {
  width: 500px; height: 500px;
  top: -10%; left: -5%;
  background: radial-gradient(circle, rgba(0,229,204,.12) 0%, rgba(0,100,200,.06) 50%, transparent 70%);
  animation: orbFloat1 12s ease-in-out infinite;
}

.ai-orb--2 {
  width: 400px; height: 400px;
  top: 30%; right: -10%;
  background: radial-gradient(circle, rgba(80,100,220,.1) 0%, rgba(0,229,204,.04) 50%, transparent 70%);
  animation: orbFloat2 16s ease-in-out infinite;
}

.ai-orb--3 {
  width: 350px; height: 350px;
  bottom: 10%; left: 20%;
  background: radial-gradient(circle, rgba(0,191,166,.08) 0%, rgba(40,80,180,.04) 50%, transparent 70%);
  animation: orbFloat3 14s ease-in-out infinite;
}

/* Central horizon glow */
.ai-glow {
  position: absolute;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; height: 300px;
  background: radial-gradient(ellipse 60% 100% at 50% 100%, rgba(0,229,204,.06) 0%, transparent 60%);
}

@keyframes orbFloat1 {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(1); }
  10% { opacity: .6; }
  50% { opacity: .4; transform: translate(80px, 40px) scale(1.1); }
  90% { opacity: .6; }
}
@keyframes orbFloat2 {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(1); }
  15% { opacity: .5; }
  50% { opacity: .3; transform: translate(-60px, 30px) scale(1.15); }
  85% { opacity: .5; }
}
@keyframes orbFloat3 {
  0%, 100% { opacity: 0; transform: translate(0, 0) scale(1); }
  20% { opacity: .5; }
  50% { opacity: .35; transform: translate(40px, -20px) scale(1.08); }
  80% { opacity: .5; }
}

@media (prefers-reduced-motion: reduce) {
  .ai-orb, .ai-grid { animation: none !important; opacity: 0; }
}

/* ---- Grain ---- */
.grain {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 9998;
  pointer-events: none;
  opacity: .022;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

/* ---- Particle Canvas ---- */
#particles-canvas {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ══════════ GLASS CARD ══════════ */
.glass-card {
  background: rgba(11, 15, 24, .65);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--noir-border);
  border-radius: 6px;
  position: relative;
}
.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: .5;
  border-radius: 1px;
}

/* ══════════ NAVBAR ══════════ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 5%;
  border-bottom: 1px solid transparent;
}
.navbar.is-scrolled {
  background: rgba(6,9,16,.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--noir-border);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 12px 0;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 0 0 220px;
}
.nav-logo-icon {
  width: 40px; height: 40px;
  background: rgba(255,255,255,.03);
  border: 1px solid var(--noir-border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 18px;
  color: var(--gold);
  transition: transform .3s var(--ease-out), border-color .3s;
}
.nav-logo-dot { color: var(--gold-bright); }
.nav-logo:hover .nav-logo-icon {
  transform: scale(1.05);
  border-color: rgba(0,229,204,.25);
}

.nav-logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.nav-logo-studio {
  font-weight: 300;
  font-size: 8px;
  letter-spacing: 4px;
  color: var(--text-60);
  text-transform: uppercase;
}
.nav-logo-name {
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 2.5px;
  color: var(--text-100);
}
.nav-logo-name .dot { color: var(--gold); }

.nav-center {
  text-align: center;
  flex: 1;
}
.nav-title {
  display: block;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.nav-subtitle {
  display: block;
  font-size: 11px;
  color: var(--text-60);
  font-weight: 300;
  letter-spacing: 0.5px;
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex: 0 0 220px;
}

/* Demo banner — top of page */
.demo-banner {
  position: relative;
  z-index: 101;
  text-align: center;
  padding: 8px 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.5px;
  color: #f5c542;
  background: rgba(245,158,11,.06);
  border-bottom: 1px solid rgba(245,158,11,.15);
}
.demo-banner span {
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}
.demo-banner-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: #f59e0b;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  box-shadow: 0 0 8px rgba(245,158,11,.5);
  animation: demoPulse 2s ease-in-out infinite;
}
@keyframes demoPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Back button — prominent */
/* Back button — animated border rectangle */
.back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  padding: 11px 28px;
  margin-bottom: 32px;
  background: rgba(0,229,204,.03);
  border: 1px solid transparent;
  border-radius: 4px;
  transition: all .3s var(--ease-smooth);
  white-space: nowrap;
  background-clip: padding-box;
}
.back-btn::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 5px;
  padding: 1px;
  background: linear-gradient(135deg, #00E5CC, #50FFEB, #00BFA6, #00E5CC);
  background-size: 300% 300%;
  animation: borderShift 4s ease-in-out infinite;
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: .6;
  transition: opacity .3s;
}
@keyframes borderShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
.back-btn-text {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--text-100);
  transition: color .3s;
}
.back-btn:hover {
  background: rgba(0,229,204,.06);
  box-shadow: 0 0 24px rgba(0,229,204,.12);
}
.back-btn:hover::before {
  opacity: 1;
}
.back-btn:hover .back-btn-text {
  color: var(--gold);
}

/* ── Main ── */
.main { position: relative; z-index: 1; }

/* ── Sections ── */
.section {
  display: none;
  animation: fadeIn 0.7s var(--ease-smooth);
}
.section.active { display: block; }

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

/* ══════════ FORM SECTION ══════════ */
.form-container {
  max-width: 700px;
  margin: 0 auto;
  padding: 5rem 1.5rem 5rem;
}

.form-header {
  text-align: center;
  margin-bottom: 3rem;
}

.form-header h2 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 1.2rem;
  line-height: 1.1;
  color: var(--text-100);
}

.form-desc {
  color: var(--text-80);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto;
  font-weight: 300;
  line-height: 1.8;
}

/* Form card */
#analysis-form {
  padding: 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-group.full-width { grid-column: 1 / -1; }

.form-group label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-80);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.required { color: var(--gold); }
.optional {
  color: var(--text-60);
  font-weight: 400;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
}

input, select, textarea {
  background: rgba(6,9,16,.7);
  border: 1px solid var(--noir-border);
  border-radius: 4px;
  color: var(--text-100);
  font-family: var(--font-display);
  font-weight: 300;
  font-size: 14px;
  padding: 12px 16px;
  transition: border-color .3s var(--ease-smooth), box-shadow .3s var(--ease-smooth), background .3s;
  outline: none;
  width: 100%;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(0,229,204,.35);
  box-shadow: 0 0 0 3px rgba(0,229,204,.04), inset 0 0 20px rgba(0,229,204,.02);
  background: rgba(6,9,16,.9);
}

input::placeholder, textarea::placeholder {
  color: var(--text-40);
  font-weight: 300;
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333D4F' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 2.5rem;
}
select option {
  background: var(--noir-card);
  color: var(--text-100);
}
textarea {
  resize: vertical;
  min-height: 100px;
}
.hidden { display: none !important; }

/* ── Buttons ── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 40px;
  background: var(--gold);
  color: var(--noir);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: 2px;
  cursor: pointer;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 3px;
  position: relative;
  overflow: hidden;
  transition: transform .2s var(--ease-out), box-shadow .4s;
}
.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,.15) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform .6s var(--ease-out);
}
.btn-primary:hover::after {
  transform: translateX(100%);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 40px rgba(0,229,204,.3), 0 0 80px rgba(0,229,204,.06);
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-primary:disabled::after { display: none; }

.btn-icon {
  transition: transform 0.25s var(--ease-out);
  font-size: 14px;
}
.btn-primary:hover .btn-icon { transform: translateX(4px); }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 32px;
  background: transparent;
  color: var(--text-80);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 500;
  border: 1px solid var(--noir-border);
  border-radius: 2px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 2px;
  transition: all .3s var(--ease-smooth);
}
.btn-secondary:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: rgba(0,229,204,.03);
  box-shadow: 0 0 20px rgba(0,229,204,.04);
}

/* ── Agent previews ── */
.agents-preview {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 3.5rem;
  flex-wrap: wrap;
}

.agent-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: 4px;
  background: rgba(11,15,24,.5);
  border: 1px solid var(--noir-border);
  transition: border-color .3s, background .3s;
}
.agent-preview:hover {
  border-color: rgba(0,229,204,.15);
  background: rgba(11,15,24,.8);
}

.agent-avatar-small {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,229,204,.03);
  border-radius: 4px;
  border: 1px solid var(--agent-color, var(--noir-border));
  color: var(--agent-color, var(--gold));
  flex-shrink: 0;
}
.agent-avatar-small svg { width: 14px; height: 14px; }

.agent-preview strong {
  font-size: 13px;
  font-weight: 600;
  display: block;
  color: var(--text-100);
  letter-spacing: 0.3px;
}
.agent-preview span {
  font-size: 11px;
  color: var(--text-60);
  font-weight: 300;
}

/* ══════════ ORCHESTRATION ══════════ */
.orchestration-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1rem;
  height: calc(100vh - 60px);
}

.steps-sidebar {
  background: rgba(11,15,24,.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--noir-border);
  border-radius: 6px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  position: relative;
}
.steps-sidebar::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,204,.2), transparent);
}

.steps-sidebar h3 {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 3px;
  color: var(--text-60);
}

.steps-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 400;
  color: var(--text-60);
  transition: all .3s var(--ease-smooth);
  border-left: 2px solid transparent;
}
.step-item.active {
  background: rgba(0,229,204,.03);
  color: var(--gold);
  font-weight: 400;
  border-left-color: var(--gold);
}
.step-item.done {
  color: var(--gold-dim);
  border-left-color: rgba(0,191,166,.3);
}

.step-icon {
  flex-shrink: 0;
  width: 16px; height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.step-icon svg { width: 14px; height: 14px; }
.step-item.active .step-icon svg { animation: spinStep 1.2s linear infinite; }
.step-item.done .step-icon { color: var(--gold-dim); }

@keyframes spinStep { to { transform: rotate(360deg); } }

.company-info {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--noir-border);
  font-size: 12px;
  font-weight: 300;
  color: var(--text-60);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.company-info strong {
  color: var(--text-80);
  font-weight: 600;
}

/* Chat panel */
.chat-panel {
  background: rgba(11,15,24,.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--noir-border);
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.chat-panel::before {
  content: '';
  position: absolute;
  top: 0; left: 20%; right: 20%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,229,204,.2), transparent);
  z-index: 1;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  border-bottom: 1px solid var(--noir-border);
  flex-shrink: 0;
}
.chat-header h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-100);
  letter-spacing: 0.3px;
}

.live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.live-dot {
  width: 5px; height: 5px;
  background: var(--gold);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--gold-glow);
  animation: blink 1.5s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.2; }
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  scroll-behavior: smooth;
}

/* Chat message */
.chat-message {
  display: flex;
  gap: 12px;
  animation: messageIn 0.4s var(--ease-smooth);
}

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

.agent-avatar {
  flex-shrink: 0;
  width: 36px; height: 36px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,229,204,.02);
  border: 1px solid var(--agent-color, var(--noir-border));
  color: var(--agent-color, var(--gold));
}
.agent-avatar svg { width: 16px; height: 16px; }
.agent-avatar--sm { width: 28px; height: 28px; }
.agent-avatar--sm svg { width: 13px; height: 13px; }

.message-content { flex: 1; min-width: 0; }

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}
.message-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--agent-color, var(--text-100));
  letter-spacing: 0.3px;
}
.message-tag {
  font-size: 10px;
  padding: 3px 10px;
  border-radius: 2px;
  background: rgba(0,229,204,.04);
  border: 1px solid var(--noir-border);
  color: var(--text-60);
  font-family: var(--font-mono);
  letter-spacing: 1px;
  text-transform: uppercase;
}

.message-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text-80);
  font-weight: 300;
  word-wrap: break-word;
}
.message-body strong { color: var(--text-100); font-weight: 600; }
.message-body ul, .message-body ol { padding-left: 1.2rem; margin: 6px 0; }
.message-body li { margin-bottom: 3px; }
.message-body h1, .message-body h2, .message-body h3,
.message-body h4, .message-body h5, .message-body h6 {
  color: var(--text-100);
  margin-top: 1rem;
  margin-bottom: 6px;
  font-weight: 700;
}
.message-body h3 { color: var(--gold); font-size: 15px; }
.message-body code {
  font-family: var(--font-mono);
  font-size: 12px;
  background: rgba(0,229,204,.04);
  border: 1px solid var(--noir-border);
  padding: 2px 6px;
  border-radius: 2px;
}
.message-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 8px 0;
  font-size: 13px;
}
.message-body th, .message-body td {
  padding: 8px 14px;
  border: 1px solid var(--noir-border);
  text-align: left;
}
.message-body th {
  background: rgba(0,229,204,.04);
  color: var(--gold);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Thinking indicator */
.thinking-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  animation: messageIn 0.3s var(--ease-smooth);
}
.thinking-dots {
  display: flex;
  gap: 3px;
}
.thinking-dots span {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--agent-color, var(--gold));
  animation: dotBounce 1.4s ease-in-out infinite;
}
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotBounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.25; }
  40% { transform: translateY(-4px); opacity: 1; }
}
.thinking-text {
  font-size: 13px;
  color: var(--text-60);
  font-style: italic;
  font-weight: 300;
}

/* ══════════ REPORT ══════════ */
.report-container {
  max-width: 880px;
  margin: 0 auto;
  padding: 5rem 1.5rem 5rem;
}

.report-header {
  text-align: center;
  margin-bottom: 3rem;
}
.report-header h2 {
  font-size: clamp(1.8rem, 4.5vw, 2.8rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  margin-bottom: 8px;
  color: var(--text-100);
}
.report-header p {
  color: var(--text-80);
  font-weight: 300;
  font-size: 16px;
}

.report-content {
  background: rgba(11,15,24,.65);
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  border: 1px solid var(--noir-border);
  border-radius: 6px;
  padding: 3rem;
  margin-bottom: 3rem;
  font-size: 14px;
  line-height: 1.8;
  position: relative;
}
.report-content::before {
  content: '';
  position: absolute;
  top: 0; left: 15%; right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
  opacity: .4;
}

.report-content h1 {
  font-size: 1.8rem;
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: -0.04em;
  background: linear-gradient(135deg, var(--gold), var(--gold-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.report-content h2 {
  font-size: 13px;
  color: var(--text-40);
  font-weight: 300;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--noir-border);
  letter-spacing: 0.3px;
}
.report-content h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 2rem;
  margin-bottom: 10px;
}
.report-content h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-100);
  margin-top: 1.25rem;
  margin-bottom: 6px;
}
.report-content p {
  color: var(--text-80);
  margin-bottom: 10px;
  font-weight: 300;
}
.report-content strong { color: var(--text-100); font-weight: 600; }
.report-content ul, .report-content ol { padding-left: 1.4rem; margin-bottom: 10px; }
.report-content li { margin-bottom: 5px; color: var(--text-80); font-weight: 300; }
.report-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 14px;
}
.report-content th {
  background: rgba(0,229,204,.04);
  color: var(--gold);
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--noir-border);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
}
.report-content td {
  padding: 10px 14px;
  border: 1px solid var(--noir-border);
  color: var(--text-80);
  font-weight: 300;
}
.report-content hr {
  border: none;
  border-top: 1px solid var(--noir-border);
  margin: 2rem 0;
}

.report-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 3rem;
}
.btn-cta { padding: 16px 40px; }

.report-footer {
  text-align: center;
  padding: 2rem;
  border-top: 1px solid var(--noir-border);
  font-size: 14px;
  color: var(--text-60);
  font-weight: 300;
  line-height: 1.8;
}
.report-footer strong { color: var(--gold); font-weight: 600; }

/* ══════════ LOADING ══════════ */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(6,9,16,.94);
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}
.loading-spinner {
  width: 36px; height: 36px;
  border: 2px solid var(--noir-border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p {
  color: var(--text-60);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 1px;
}

/* ══════════ ERROR TOAST ══════════ */
.error-toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: rgba(40,15,20,.92);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,74,106,.2);
  color: #ff8a9e;
  padding: 12px 20px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 300;
  animation: slideUp 0.3s var(--ease-smooth);
  max-width: 90vw;
}
.error-toast button {
  background: none;
  border: none;
  color: #ff8a9e;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ══════════ SCROLLBAR ══════════ */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--noir-border); border-radius: 2px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-40); }

/* ══════════ RESPONSIVE ══════════ */
@media (max-width: 900px) {
  .orchestration-layout {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 60px);
  }
  .steps-sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 1rem;
  }
  .steps-sidebar h3 { width: 100%; }
  .step-item { padding: 5px 8px; font-size: 11px; border-left: none; border-bottom: 2px solid transparent; }
  .step-item.active { border-left: none; border-bottom-color: var(--gold); }
  .step-item.done { border-left: none; border-bottom-color: rgba(0,191,166,.3); }
  .company-info { display: none; }
  .chat-panel { min-height: 60vh; }
}

@media (max-width: 640px) {
  .demo-banner { font-size: 9px; padding: 6px 12px; }
  .nav-inner { flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px 0; }
  .nav-logo, .nav-right { flex: unset; }
  .nav-logo-text, .nav-center { display: none; }
  .back-btn { padding: 9px 20px; margin-bottom: 24px; }
  .back-btn-text { font-size: 12px; }
  .form-container { padding: 2.5rem 1rem 3rem; }
  .form-header h2 { font-size: 1.5rem; }
  .form-grid { grid-template-columns: 1fr; }
  #analysis-form { padding: 1.5rem; }
  .agents-preview { flex-direction: column; align-items: center; gap: 8px; }
  .report-container { padding: 2.5rem 1rem 3rem; }
  .report-content { padding: 1.5rem; }
  .report-header h2 { font-size: 1.5rem; }
  .btn-cta .btn-text { font-size: 9px; }
  .ai-grid { display: none; }
}
