/* ══════════════════════════════════════════════════════════════════════════
   MORSAN - AI Cybersecurity Guide
   Design System & Global Styles
   ══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;600&family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ── CSS Variables ──────────────────────────────────────────────────────── */
:root {
  --bg-primary:    #07090F;
  --bg-secondary:  #0B0F18;
  --bg-card:       #0F1520;
  --bg-card-hover: #141C28;
  --bg-input:      #0A1018;
  --bg-code:       #0D1117;

  --cyan:          #00C8F0;
  --cyan-dim:      #00C8F040;
  --green:         #00D68A;
  --red:           #FF4B6A;
  --orange:        #FFB020;
  --purple:        #A78BFA;

  --text-primary:  #EEF2F6;
  --text-secondary:#8A9BB0;
  --text-dim:      #3A5060;
  --text:          #EEF2F6;

  --border:        #1A2E3A;
  --border-light:  #243848;

  --radius-sm:     6px;
  --radius-md:     10px;
  --radius-lg:     16px;
  --radius-xl:     24px;

  --shadow:        0 4px 24px rgba(0,0,0,0.4);
  --shadow-cyan:   0 0 20px var(--cyan-bg-15);

  --cyan-bg-08:    rgba(0,200,240,0.08);
  --cyan-bg-15:    rgba(0,200,240,0.15);
  --cyan-bg-20:    rgba(0,200,240,0.2);

  --trans-fast:    0.15s;
  --trans-base:    0.2s;
  --trans-slow:    0.25s;

  --font-body:     'Outfit', -apple-system, sans-serif;
  --font-mono:     'JetBrains Mono', monospace;

  --sidebar-w:     260px;
  --topbar-h:      56px;
  --right-w:       300px;
}

/* ── Reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font-body); border: none; }
input, textarea { font-family: var(--font-body); }
img { max-width: 100%; }
::selection { background: var(--cyan); color: var(--bg-primary); }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── Utility Classes ────────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.text-dim { color: var(--text-dim); }
.text-secondary { color: var(--text-secondary); }
.mono { font-family: var(--font-mono); }
.hidden { display: none !important; }

/* Shared primitives - per-component rules below add size/padding/etc. */
.btn-nav, .btn-primary, .btn-auth, .btn-modal-primary, .btn-send,
.btn-survey-complete, .btn-buy-tokens { background: var(--cyan); color: var(--bg-primary); }
.btn-nav:hover, .btn-primary:hover, .btn-auth:hover,
.btn-modal-primary:hover, .btn-send:hover { opacity: 0.85; }

.btn-secondary, .btn-modal-cancel, .btn-logout, .btn-edit-company {
  background: none; border: 1px solid var(--border);
  border-radius: var(--radius-sm); transition: all var(--trans-base);
}

.feature-card, .platform-card, .welcome-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); transition: all var(--trans-base);
}
.feature-card:hover, .platform-card:hover, .welcome-card:hover {
  border-color: var(--cyan); transform: translateY(-2px);
}

/* ══════════════════════════════════════════════════════════════════════════
   LANDING PAGE
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Landing Nav ────────────────────────────────────────────────────────── */
.landing-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  padding: 16px 32px;
  background: rgba(7,9,15,0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.landing-nav .logo {
  font-size: 1.4rem; font-weight: 800; letter-spacing: 3px; color: var(--text-primary);
}
.landing-nav .logo span { color: var(--cyan); }
.landing-nav-links { display: flex; gap: 28px; align-items: center; }
.landing-nav-links a {
  color: var(--text-secondary); font-size: 0.9rem; font-weight: 500;
  letter-spacing: 0.5px; transition: color var(--trans-base);
}
.landing-nav-links a:hover { color: var(--cyan); text-decoration: none; }
.landing-nav-links a.btn-nav { color: var(--bg-primary); }
.landing-nav-links a.btn-nav:hover { color: var(--bg-primary); }
.btn-nav {
  padding: 8px 20px; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.9rem;
  transition: opacity var(--trans-base);
}
.btn-nav:hover { text-decoration: none; }

/* ── Landing Hero ───────────────────────────────────────────────────────── */
.landing-hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 120px 24px 80px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0,200,240,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 80%, rgba(0,214,138,0.04) 0%, transparent 50%),
    var(--bg-primary);
}
.hero-content { max-width: 720px; }
.hero-badge {
  display: inline-block; padding: 6px 16px; border-radius: 20px;
  background: var(--cyan-dim); color: var(--cyan);
  font-size: 0.8rem; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 24px;
}
.hero-title {
  font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 800;
  line-height: 1.1; margin-bottom: 20px;
}
.hero-title .accent { color: var(--cyan); }
.hero-subtitle {
  font-size: 1.1rem; color: var(--text-secondary);
  max-width: 540px; margin: 0 auto 36px; line-height: 1.7;
}
.hero-actions { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }
.btn-primary {
  padding: 14px 32px; border-radius: var(--radius-sm);
  font-weight: 700; font-size: 1.0rem;
  transition: opacity var(--trans-base); display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { text-decoration: none; }
.btn-secondary {
  color: var(--text-primary); padding: 14px 32px;
  font-weight: 600; font-size: 1.0rem;
}
.btn-secondary:hover { border-color: var(--cyan); color: var(--cyan); text-decoration: none; }
.hero-quote {
  margin-top: 48px; font-style: italic; color: var(--text-dim);
  font-size: 0.9rem;
}

/* ── Landing Stats ──────────────────────────────────────────────────────── */
.landing-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px;
  max-width: 800px; margin: -40px auto 0; position: relative; z-index: 2;
  background: var(--border);
}
.stat-card {
  background: var(--bg-secondary); padding: 32px 24px; text-align: center;
}
.stat-num { font-size: 2rem; font-weight: 800; color: var(--cyan); }
.stat-label { font-size: 0.85rem; color: var(--text-secondary); margin-top: 4px; }

/* ── Landing Sections ───────────────────────────────────────────────────── */
.landing-section {
  padding: 100px 24px;
}
.landing-section:nth-child(even) { background: var(--bg-secondary); }
.section-badge {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  letter-spacing: 3px; text-transform: uppercase; color: var(--cyan);
  margin-bottom: 12px;
}
.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 700;
  margin-bottom: 16px; line-height: 1.2;
}
.section-subtitle {
  font-size: 1rem; color: var(--text-secondary);
  line-height: 1.7;
}

/* ── Journey Steps ──────────────────────────────────────────────────────── */
.journey-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2px; margin-top: 48px; background: var(--border);
}
.journey-step {
  background: var(--bg-card); padding: 32px 24px;
  transition: background var(--trans-base);
}
.journey-step:hover { background: var(--bg-card-hover); }
.journey-num {
  font-size: 0.75rem; font-weight: 700; color: var(--cyan);
  letter-spacing: 2px; margin-bottom: 12px;
}
.journey-step h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 8px; }
.journey-step p { font-size: 0.9rem; color: var(--text-secondary); }

/* ── Feature Grid ───────────────────────────────────────────────────────── */
.feature-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px; margin-top: 48px;
}
.feature-card { padding: 28px; }
.feature-icon {
  width: 40px; height: 40px; border-radius: var(--radius-sm);
  background: var(--cyan-dim); display: flex; align-items: center;
  justify-content: center; margin-bottom: 16px; font-size: 1.2rem;
}
.feature-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: 8px; }
.feature-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.6; }

/* Platform Section */
.platform-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px; margin-top: 48px;
}
.platform-card { padding: 32px; position: relative; overflow: hidden; }
.platform-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px; background: linear-gradient(90deg, var(--cyan), transparent);
  opacity: 0; transition: opacity var(--trans-slow);
}
.platform-card:hover::before { opacity: 1; }
.platform-card-icon {
  font-size: 2rem; margin-bottom: 16px;
}
.platform-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 10px; color: var(--text-primary); }
.platform-card p { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.7; }

/* ── Landing Footer ─────────────────────────────────────────────────────── */
.landing-footer {
  padding: 32px 24px; text-align: center;
  border-top: 1px solid var(--border);
  font-size: 0.85rem; color: var(--text-dim);
}

/* ══════════════════════════════════════════════════════════════════════════
   AUTH SCREENS
   ══════════════════════════════════════════════════════════════════════════ */
.auth-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(ellipse at 50% 30%, rgba(0,200,240,0.05) 0%, transparent 60%),
    var(--bg-primary);
  padding: 24px;
}
.auth-box {
  width: 100%; max-width: 420px; background: var(--bg-secondary);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 40px 36px; box-shadow: var(--shadow);
}
.auth-logo {
  text-align: center; font-size: 1.6rem; font-weight: 800;
  letter-spacing: 4px; margin-bottom: 8px;
}
.auth-logo span { color: var(--cyan); }
.auth-tagline {
  text-align: center; font-size: 0.8rem; color: var(--text-dim);
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 32px;
}
.auth-tabs {
  display: flex; gap: 0; margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.auth-tab {
  flex: 1; padding: 10px; text-align: center; font-size: 0.9rem;
  font-weight: 600; color: var(--text-dim); background: none;
  border-bottom: 2px solid transparent; transition: all var(--trans-base);
}
.auth-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.auth-tab:hover { color: var(--text-secondary); }
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block; font-size: 0.85rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input {
  width: 100%; padding: 12px 14px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 0.95rem; outline: none;
  transition: border-color var(--trans-base);
}
.form-group input:focus { border-color: var(--cyan); }
.btn-auth {
  width: 100%; padding: 14px; border-radius: var(--radius-sm);
  font-size: 1.0rem; font-weight: 700; transition: opacity var(--trans-base);
  margin-top: 8px;
}
.btn-auth:disabled { opacity: 0.5; cursor: not-allowed; }
.auth-error {
  background: rgba(255,75,106,0.1); border: 1px solid rgba(255,75,106,0.3);
  border-radius: var(--radius-sm); padding: 10px 14px; margin-bottom: 16px;
  font-size: 0.9rem; color: var(--red);
}
.auth-switch {
  text-align: center; margin-top: 20px; font-size: 0.9rem;
  color: var(--text-secondary);
}
.auth-switch a { color: var(--cyan); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════════════════
   APP LAYOUT (3-column)
   ══════════════════════════════════════════════════════════════════════════ */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr var(--right-w);
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh; overflow: hidden;
  transition: grid-template-columns 0.18s ease;
}
.app-layout.left-collapsed { grid-template-columns: 0 1fr var(--right-w); }
.app-layout.right-collapsed { grid-template-columns: var(--sidebar-w) 1fr 0; }
.app-layout.left-collapsed.right-collapsed { grid-template-columns: 0 1fr 0; }
.app-layout.left-collapsed .sidebar-left,
.app-layout.right-collapsed .sidebar-right {
  display: none;
}

/* Edge chevrons: discreet hover-reveal toggles at the sidebar/content seam.
   Hidden by default, visible on hover of a wide invisible hitbox. When the
   sidebar is collapsed the chevron stays faintly visible at the viewport
   edge to stay discoverable. Replaces the old topbar arrow buttons at
   every breakpoint. */
.edge-toggle {
  position: fixed;
  top: calc(50% + var(--topbar-h) / 2);
  transform: translateY(-50%);
  width: 16px; height: 48px; padding: 0;
  background: var(--bg-card);
  color: var(--text-dim);
  border: 1px solid var(--border);
  cursor: pointer;
  z-index: 501;
  align-items: center; justify-content: center;
  font-size: 12px; line-height: 1; font-weight: 700;
  opacity: 0;
  transition: opacity var(--trans-base) ease,
              background var(--trans-fast) ease,
              color var(--trans-fast) ease,
              border-color var(--trans-fast) ease,
              left var(--trans-base) ease,
              right var(--trans-base) ease;
}
/* Invisible hitbox to make the 16px sliver easy to find */
.edge-toggle::before {
  content: '';
  position: absolute;
  top: -40px; bottom: -40px;
  left: -10px; right: -10px;
}
.edge-toggle-left  { left: var(--sidebar-w); border-left: none; border-radius: 0 4px 4px 0; }
.edge-toggle-right { right: var(--right-w);  border-right: none; border-radius: 4px 0 0 4px; }
.app-layout.left-collapsed  .edge-toggle-left  { left: 0; }
.app-layout.right-collapsed .edge-toggle-right { right: 0; }
/* Discoverable when collapsed: faint by default, full on hover */
.app-layout.left-collapsed  .edge-toggle-left,
.app-layout.right-collapsed .edge-toggle-right { opacity: 0.5; }
.edge-toggle:hover,
.edge-toggle:focus-visible {
  opacity: 1;
  color: var(--cyan);
  border-color: var(--cyan-dim);
  outline: none;
}
/* Tablet: right sidebar becomes a drawer at min(320px, 88vw). Keep the
   chevron at its inside edge so users can tap to close. Touch has no
   hover, so keep it visibly persistent. */
@media (max-width: 1100px) {
  .edge-toggle-right { right: min(320px, 88vw); opacity: 0.85; }
  .app-layout.right-collapsed .edge-toggle-right { right: 0; opacity: 0.7; }
}
/* Phone: both sidebars become drawers. Left drawer is min(280px, 85vw). */
@media (max-width: 768px) {
  .edge-toggle-left { left: min(280px, 85vw); opacity: 0.85; }
  .app-layout.left-collapsed .edge-toggle-left { left: 0; opacity: 0.7; }
}

/* ── Top Bar ────────────────────────────────────────────────────────────── */
.topbar {
  grid-column: 1 / -1; grid-row: 1;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; position: relative;
}
.topbar-logo {
  font-size: 1.2rem; font-weight: 800; letter-spacing: 3px;
  margin-right: 16px;
}
.topbar-logo span { color: var(--cyan); }
.topbar-mode {
  font-size: 0.85rem; color: var(--text-secondary);
  display: flex; align-items: center; gap: 8px;
  margin-right: auto;
}
.topbar-mode .mode-badge {
  background: var(--cyan-dim); color: var(--cyan);
  padding: 4px 10px; border-radius: 12px; font-weight: 600;
  font-size: 0.8rem; letter-spacing: 0.5px;
}
.topbar-user {
  display: flex; align-items: center; gap: 12px;
}
.topbar-user .user-name { font-size: 0.9rem; color: var(--text-secondary); }
.btn-logout {
  color: var(--text-dim); font-size: 0.85rem; padding: 6px 12px;
}
.btn-logout:hover { border-color: var(--red); color: var(--red); }

/* ── Left Sidebar ───────────────────────────────────────────────────────── */
.sidebar-left {
  grid-column: 1; grid-row: 2;
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 10px 10px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 3px;
}
.sidebar-section-label {
  font-size: 0.7rem; font-weight: 700; color: var(--text-dim);
  letter-spacing: 1.5px; text-transform: uppercase;
  padding: 6px 10px 3px; margin-top: 2px;
}
.sidebar-section-label--with-action {
  display: flex; align-items: baseline; gap: 8px; white-space: nowrap;
}
.sidebar-section-label--with-action > span { white-space: nowrap; }
.session-toggle--inline {
  width: auto; padding: 0 2px; margin: 0; line-height: 1;
  font-size: 1rem; letter-spacing: 0; text-transform: none;
  font-weight: 700; color: var(--cyan); flex-shrink: 0;
}
.session-toggle--inline:hover { background: none; color: var(--cyan); opacity: 0.7; }
.mode-btn {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 10px; border-radius: var(--radius-sm);
  background: none; color: var(--text-secondary);
  font-size: 0.9rem; font-weight: 500; width: 100%; line-height: 1.2;
  text-align: left; transition: all var(--trans-fast);
}
.mode-btn:hover { background: var(--bg-card); color: var(--text-primary); }
.mode-btn.active { background: var(--cyan-dim); color: var(--cyan); font-weight: 600; }
.mode-btn .mode-icon { font-size: 1rem; width: 22px; text-align: center; }

/* Profile Switcher */
.profile-switcher {
  display: flex; gap: 4px; padding: 3px;
  background: var(--bg-tertiary, rgba(255,255,255,0.05));
  border-radius: var(--radius-sm);
  margin-bottom: 2px;
}
.profile-tab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 6px; border-radius: var(--radius-sm);
  background: none; color: var(--text-dim);
  font-size: 0.8rem; font-weight: 600;
  transition: all var(--trans-base); cursor: pointer; border: none;
}
.profile-tab:hover { background: var(--bg-card); color: var(--text-primary); }
.profile-tab.active { background: var(--cyan-dim); color: var(--cyan); }
.profile-tab-icon { font-size: 0.95rem; }

/* Personal Quick-Start Tiles */
/* Security Score Ring */
.score-ring {
  width: 100px; height: 100px; border-radius: 50%; margin: 0 auto 8px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
}
.score-ring::before {
  content: ''; position: absolute; inset: 4px; border-radius: 50%;
  background: var(--bg-secondary);
}

/* Session list */
.session-item {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: var(--radius-sm);
  background: none; color: var(--text-secondary);
  font-size: 0.85rem; width: 100%; text-align: left;
  transition: all var(--trans-fast); border: none; cursor: pointer;
}
.session-item:hover { background: var(--bg-card); color: var(--text-primary); }
.session-item.active { background: var(--bg-card); color: var(--cyan); }
.session-item .session-icon { font-size: 0.8rem; opacity: 0.5; flex-shrink: 0; }
.session-item .session-time {
  font-size: 0.72rem; color: var(--text-dim); font-variant-numeric: tabular-nums;
  flex-shrink: 0; min-width: 48px;
}
.session-item .session-title {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.session-toggle {
  width: 100%; padding: 5px 12px; margin-top: 2px;
  background: none; border: none; cursor: pointer;
  color: var(--text-dim); font-size: 0.78rem; text-align: left;
  border-radius: var(--radius-sm); transition: all var(--trans-fast);
}
.session-toggle:hover { background: var(--bg-card); color: var(--cyan); }

.btn-new-session {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: var(--radius-sm);
  background: var(--cyan-dim); color: var(--cyan);
  font-size: 0.9rem; font-weight: 600; width: 100%;
  text-align: left; transition: all var(--trans-fast); border: none;
}
.btn-new-session:hover { background: var(--cyan-bg-20); }

/* ── Main Chat Area ─────────────────────────────────────────────────────── */
.main-area {
  grid-column: 2; grid-row: 2;
  display: flex; flex-direction: column;
  background: var(--bg-primary);
  overflow: hidden;
}

/* Welcome Screen */
.welcome-screen {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 40px 24px;
}
.welcome-title {
  font-size: 1.8rem; font-weight: 700; margin-bottom: 8px;
}
.welcome-subtitle {
  font-size: 1.0rem; color: var(--text-secondary); margin-bottom: 36px;
}
.welcome-cards {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; max-width: 520px; width: 100%;
}
.welcome-card {
  padding: 18px; cursor: pointer; text-align: left;
}
.welcome-card h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 4px; }
.welcome-card p { font-size: 0.8rem; color: var(--text-secondary); }
.welcome-card--action { border-left: 3px solid var(--cyan); }

/* GDPR Consent */
.gdpr-checkbox {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 0.8rem; color: var(--text-secondary);
  margin: 8px 0 16px; cursor: pointer; line-height: 1.5;
}
.gdpr-checkbox input[type="checkbox"] {
  margin-top: 3px; accent-color: var(--cyan); flex-shrink: 0;
}
.gdpr-checkbox a { color: var(--cyan); text-decoration: underline; }
.gdpr-checkbox a:hover { opacity: 0.8; }
.gdpr-content { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.7; }
.gdpr-content h3 { color: var(--text-primary); font-size: 0.95rem; margin: 20px 0 8px; }
.gdpr-content ul { padding-left: 20px; margin: 8px 0; }
.gdpr-content li { margin-bottom: 4px; }

/* Chat Messages */
.chat-messages {
  flex: 1; overflow-y: auto; padding: 24px;
  display: flex; flex-direction: column; gap: 16px;
}
.message { display: flex; gap: 12px; max-width: 85%; animation: fadeIn 0.3s ease; }
.message.user { align-self: flex-end; flex-direction: row-reverse; }
.message.assistant { align-self: flex-start; }
.msg-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 700;
}
.message.user .msg-avatar { background: var(--border); color: var(--text-secondary); }
.message.assistant .msg-avatar { background: var(--cyan-dim); color: var(--cyan); }
.msg-content {
  padding: 14px 18px; border-radius: var(--radius-md);
  font-size: 0.95rem; line-height: 1.65;
}
.message.user .msg-content {
  background: var(--cyan); color: var(--bg-primary);
  border-bottom-right-radius: 4px;
}
.message.assistant .msg-content {
  background: var(--bg-card); border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

/* Risk cards in messages */
.risk-card {
  margin: 8px 0; padding: 10px 14px; border-radius: var(--radius-sm);
  border-left: 3px solid; display: flex; align-items: center; gap: 10px;
}
.risk-card.critical { border-color: var(--red); background: rgba(255,75,106,0.08); }
.risk-card.high { border-color: var(--orange); background: rgba(255,176,32,0.08); }
.risk-card.medium { border-color: var(--cyan); background: var(--cyan-bg-08); }
.risk-card.low { border-color: var(--green); background: rgba(0,214,138,0.08); }
.risk-badge {
  font-size: 0.7rem; font-weight: 700; letter-spacing: 1px;
  padding: 2px 8px; border-radius: 3px;
}
.risk-card.critical .risk-badge { background: var(--red); color: #fff; }
.risk-card.high .risk-badge { background: var(--orange); color: var(--bg-primary); }
.risk-card.medium .risk-badge { background: var(--cyan); color: var(--bg-primary); }
.risk-card.low .risk-badge { background: var(--green); color: var(--bg-primary); }
.risk-text { font-size: 0.9rem; }

/* Code blocks in messages */
.msg-content pre {
  background: var(--bg-code); padding: 12px 16px;
  border-radius: var(--radius-sm); margin: 8px 0; overflow-x: auto;
}
.msg-content code {
  font-family: var(--font-mono); font-size: 0.85rem; color: var(--green);
}
.msg-content h2, .msg-content h3 {
  font-size: 1rem; font-weight: 700; margin: 12px 0 6px;
  color: var(--cyan);
}
.msg-content strong { color: var(--text-primary); }
.msg-content .list-item {
  display: flex; gap: 8px; padding: 2px 0;
}
.msg-content .li-num { color: var(--cyan); font-weight: 700; }
.msg-content .spacer { height: 8px; }

/* Interactive choice buttons */
.choice-group {
  display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0;
}
.choice-group br { display: none; }
.choice-btn {
  padding: 10px 18px; border-radius: 10px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: all var(--trans-base);
  border: 1px solid var(--cyan-dim); background: rgba(0,200,240,0.06); color: var(--text);
}
.choice-btn:hover {
  background: var(--cyan-bg-15); border-color: var(--cyan); color: var(--cyan);
  transform: translateY(-1px);
}
.choice-btn:active { transform: translateY(0); }

/* Typing indicator */
.typing-indicator {
  display: flex; gap: 4px; padding: 14px 18px; align-items: center;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--cyan);
  animation: blink 1.4s infinite both;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Chat Input */
.chat-input-area {
  padding: 16px 24px; border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}
.quick-prompts {
  display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap;
}
.quick-prompt {
  padding: 6px 14px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 20px; color: var(--text-secondary); font-size: 0.83rem;
  transition: all var(--trans-fast); cursor: pointer;
}
.quick-prompt:hover { border-color: var(--cyan); color: var(--cyan); }
.chat-input-row {
  display: flex; gap: 10px; align-items: flex-end;
}
.chat-input {
  flex: 1; padding: 12px 16px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-md);
  color: var(--text-primary); font-size: 0.95rem; resize: none;
  outline: none; min-height: 44px; max-height: 120px;
  transition: border-color var(--trans-base); line-height: 1.4;
}
.chat-input:focus { border-color: var(--cyan); }
.chat-input::placeholder { color: var(--text-dim); }
.btn-send {
  width: 44px; height: 44px; border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem; transition: opacity var(--trans-base); flex-shrink: 0;
}
.btn-send:disabled { opacity: 0.3; cursor: not-allowed; }

/* ── Right Sidebar ──────────────────────────────────────────────────────── */
.sidebar-right {
  grid-column: 3; grid-row: 2;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  padding: 10px 10px;
  overflow-y: auto;
}
.right-section {
  margin-bottom: 10px;
}
.right-section-title {
  font-size: 0.7rem; font-weight: 700; color: var(--text-dim);
  letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 5px;
}

/* Company Profile Card */
.company-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 10px 12px;
}
.company-name { font-size: 1rem; font-weight: 700; margin-bottom: 2px; line-height: 1.25; }
.btn-edit-company {
  margin-top: 6px; padding: 5px 12px;
  color: var(--text-secondary); font-size: 0.83rem; width: 100%;
}
.btn-edit-company:hover { border-color: var(--cyan); color: var(--cyan); }

/* Posture Gauge */
.posture-gauge {
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 9px 12px; margin-bottom: 6px;
}
.gauge-bar {
  height: 6px; background: var(--border); border-radius: 3px;
  overflow: hidden; margin-top: 5px;
}
.gauge-fill {
  height: 100%; border-radius: 3px; transition: width 0.6s ease;
}

/* Compliance Grid */
.compliance-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px;
}
.compliance-item {
  background: var(--bg-card); border-radius: var(--radius-sm);
  padding: 6px 9px; display: flex; align-items: center; gap: 7px;
}
.compliance-icon { font-size: 1rem; }
.compliance-name { font-size: 0.83rem; font-weight: 600; line-height: 1.2; }
.compliance-status { font-size: 0.7rem; color: var(--text-dim); line-height: 1.2; }

/* Findings List */
.findings-list { display: flex; flex-direction: column; gap: 3px; }
.finding-item {
  display: flex; align-items: center; gap: 7px; padding: 5px 9px;
  background: var(--bg-card); border-radius: var(--radius-sm);
  font-size: 0.85rem; line-height: 1.25;
}
.finding-severity {
  width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0;
}
.finding-severity.critical { background: var(--red); }
.finding-severity.high { background: var(--orange); }
.finding-severity.medium { background: var(--cyan); }
.finding-severity.low { background: var(--green); }

/* ── Company Setup Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; backdrop-filter: blur(4px);
}
.modal {
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 32px;
  max-width: 500px; width: 90%; max-height: 85vh; overflow-y: auto;
}
.modal h2 { font-size: 1.2rem; margin-bottom: 20px; }
.modal .form-group select {
  width: 100%; padding: 12px 14px; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-primary); font-size: 0.95rem; outline: none;
}
.modal .form-group select:focus { border-color: var(--cyan); }
.modal-actions { display: flex; gap: 12px; margin-top: 24px; }
.btn-modal-primary {
  flex: 1; padding: 12px; border-radius: var(--radius-sm);
  font-weight: 700; transition: all var(--trans-base);
}
.btn-modal-cancel {
  padding: 12px 24px; color: var(--text-secondary);
}
.btn-modal-cancel:hover { border-color: var(--text-secondary); }

/* ── Animations ─────────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes blink {
  0%, 80%, 100% { opacity: 0.2; }
  40% { opacity: 1; }
}

.sidebar-backdrop,
.sidebar-backdrop-left { display: none; }

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .sidebar-backdrop { display: block; }
  .app-layout { grid-template-columns: var(--sidebar-w) 1fr; }
  .app-layout.left-collapsed { grid-template-columns: 0 1fr; }
  /* Right sidebar becomes a slide-in drawer on smaller screens so the
     Company Profile, Security Score and Compliance cards stay reachable
     on tablet and phone. */
  .sidebar-right {
    position: fixed;
    top: var(--topbar-h);
    right: 0;
    bottom: 0;
    width: min(320px, 88vw);
    z-index: 500;
    transform: translateX(100%);
    transition: transform var(--trans-slow) ease;
    box-shadow: -6px 0 20px rgba(0,0,0,0.35);
    overflow-y: auto;
    display: block;
  }
  .app-layout:not(.right-collapsed) .sidebar-right { transform: translateX(0); }
  .app-layout.right-collapsed .sidebar-right { transform: translateX(100%); display: block; }
  .sidebar-backdrop {
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,0.45);
    z-index: 499;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--trans-base) ease;
  }
  .app-layout:not(.right-collapsed) .sidebar-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}
/* Hamburger button - hidden on desktop */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}
.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s;
}
@media (max-width: 768px) {
  .app-layout { grid-template-columns: 1fr; }
  /* Left sidebar becomes a slide-in drawer on phones, mirroring the
     right sidebar pattern so chat modes and session history stay
     reachable. */
  .sidebar-left {
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    bottom: 0;
    width: min(280px, 85vw);
    z-index: 500;
    transform: translateX(-100%);
    transition: transform var(--trans-slow) ease;
    box-shadow: 6px 0 20px rgba(0,0,0,0.35);
    overflow-y: auto;
    display: block;
  }
  .app-layout:not(.left-collapsed) .sidebar-left { transform: translateX(0); }
  .app-layout.left-collapsed .sidebar-left { transform: translateX(-100%); display: block; }
  .sidebar-backdrop-left {
    position: fixed;
    inset: var(--topbar-h) 0 0 0;
    background: rgba(0,0,0,0.45);
    z-index: 499;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--trans-base) ease;
    display: block;
  }
  .app-layout:not(.left-collapsed) .sidebar-backdrop-left {
    opacity: 1;
    pointer-events: auto;
  }
  .hamburger-btn { display: flex; }
  .landing-nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 16px 24px;
    gap: 12px;
    z-index: 1000;
  }
  .landing-nav-links.mobile-open { display: flex; }
  .landing-nav-links .nav-lang-selector { width: 100%; }
  .landing-nav-links .btn-nav { text-align: center; }
  .landing-stats { grid-template-columns: 1fr; }
  .welcome-cards { grid-template-columns: 1fr; }
  .hero-title { font-size: 2rem; }

  /* Post-login topbar: drop non-essential elements, tighten spacing */
  .topbar { padding: 0 10px; }
  .topbar-mode { display: none; }
  .topbar-user { gap: 6px; }
  .topbar-user .user-name { display: none; }
  .nav-lang-btn { padding: 6px 8px; font-size: 0.8rem; }
  .btn-logout { padding: 6px 10px; font-size: 0.8rem; }
}

/* ══════════════════════════════════════════════════════════════════════════
   V2 STYLES - SSO, 2FA, Corporate, Language
   ══════════════════════════════════════════════════════════════════════════ */

.sso-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0 16px;
}
.sso-divider::before, .sso-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.sso-divider span {
  font-size: 0.8rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; white-space: nowrap;
}

.sso-buttons {
  display: flex; gap: 8px;
}
.sso-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 12px; border-radius: 8px; font-size: 0.85rem; font-weight: 600;
  cursor: pointer; transition: all var(--trans-base);
  border: 1px solid var(--border); background: var(--bg-card); color: var(--text);
}
.sso-btn:hover { background: var(--bg-card-hover); border-color: var(--cyan-dim); }
.sso-btn svg { flex-shrink: 0; }
.sso-google:hover { border-color: #4285F4; }
.sso-microsoft:hover { border-color: #00A4EF; }
.sso-facebook:hover { border-color: #1877F2; }

.twofa-icon {
  text-align: center; font-size: 2.5rem; margin-bottom: 8px;
}
#twoFAForm input {
  font-family: 'JetBrains Mono', monospace;
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal-box {
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 16px;
  padding: 32px; max-width: 500px; width: 90%; border-top: 3px solid var(--cyan);
}

.provider-tag {
  display: inline-block; padding: 4px 10px; border-radius: 4px;
  font-size: 0.8rem; font-weight: 600; color: var(--cyan);
  background: var(--cyan-bg-08); border: 1px solid var(--cyan-bg-20);
}

/* ── Language selector (topbar) ─────────────────────────────────────── */
.lang-search-box { padding: 8px; border-bottom: 1px solid var(--border); }
.lang-search-box input {
  width: 100%; padding: 8px 10px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 0.85rem;
}
.lang-list { overflow-y: auto; max-height: 340px; padding: 4px 0; }
.lang-group-label {
  padding: 6px 12px; font-size: 0.75rem; color: var(--text-dim);
  font-weight: 600; letter-spacing: 1px; text-transform: uppercase;
}
.lang-item {
  display: flex; justify-content: space-between; width: 100%; padding: 8px 14px;
  background: none; border: none; color: var(--text); font-size: 0.9rem;
  cursor: pointer; text-align: left;
}
.lang-item:hover { background: var(--bg-card-hover); }
.lang-item.active { color: var(--cyan); }
.lang-en { font-size: 0.8rem; color: var(--text-dim); }

/* ── Settings panel ─────────────────────────────────────────────────── */
.btn-settings {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); padding: 4px 8px; cursor: pointer; font-size: 0.95rem;
}
.btn-settings:hover { border-color: var(--cyan-dim); background: var(--bg-card); }

.settings-panel {
  position: fixed; top: 0; right: 0; width: 380px; height: 100vh;
  background: var(--bg-secondary); border-left: 1px solid var(--border);
  box-shadow: -8px 0 30px rgba(0,0,0,0.4); z-index: 600; overflow-y: auto;
  animation: slideIn 0.2s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.settings-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.settings-header h3 { margin: 0; color: var(--text); font-size: 1.1rem; }
.settings-close {
  background: none; border: none; color: var(--text-dim); font-size: 1.2rem;
  cursor: pointer; padding: 4px 8px;
}
.settings-close:hover { color: var(--text); }

.settings-section {
  padding: 20px 24px; border-bottom: 1px solid var(--border);
}
.settings-label { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.settings-desc { font-size: 0.9rem; color: var(--text-dim); margin: 4px 0; line-height: 1.5; }
.settings-desc-sm { font-size: 0.8rem; color: var(--text-dim); margin: 2px 0; }
.btn-settings-action {
  margin-top: 10px; padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 8px; color: var(--cyan); font-size: 0.85rem; font-weight: 600;
  cursor: pointer;
}
.btn-settings-action:hover { background: var(--bg-card-hover); border-color: var(--cyan-dim); }

/* ── Topbar user area fix ───────────────────────────────────────────── */
.topbar-user { display: flex; align-items: center; gap: 10px; }

/* ── Nav language selector (landing page) ──────────────────────────── */
.nav-lang-selector { position: relative; display: inline-block; }
.nav-lang-btn {
  background: var(--cyan-bg-08); border: 1px solid var(--cyan-dim); border-radius: 6px;
  color: var(--cyan); padding: 6px 14px; cursor: pointer; font-size: 0.9rem;
  font-weight: 600; transition: all var(--trans-base); white-space: nowrap;
}
.nav-lang-btn:hover { border-color: var(--cyan); background: var(--cyan-bg-15); }
.nav-lang-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 8px; width: 280px;
  background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.6); z-index: 500; max-height: 400px;
  overflow: hidden; display: flex; flex-direction: column;
}

/* ══════════════════════════════════════════════════════════════════════════
   LIGHT THEME
   ══════════════════════════════════════════════════════════════════════════ */
[data-theme="light"] {
  --bg-primary:    #F0F4F8;
  --bg-secondary:  #FFFFFF;
  --bg-card:       #FFFFFF;
  --bg-card-hover: #F5F7FA;
  --bg-input:      #F0F2F5;
  --bg-code:       #F6F8FA;

  --cyan:          #0B7E9B;
  --cyan-dim:      #0B7E9B30;
  --green:         #15803D;
  --red:           #DC2626;
  --orange:        #CC450D;
  --purple:        #7C3AED;

  --text:          #111827;
  --text-primary:  #111827;
  --text-secondary:#4B5563;
  --text-dim:      #9CA3AF;

  --border:        #E5E7EB;
  --border-light:  #D1D5DB;

  --shadow:        0 4px 24px rgba(0,0,0,0.08);
  --shadow-cyan:   0 0 20px rgba(11,126,155,0.1);
}

/* Overrides below only exist where light mode differs from what the
   variables already provide - intentional inversions (dark footer on
   light page), unique tints (#E0F2FE active-state), or behaviours not
   expressible via vars (box-shadow, backdrop-filter). Plain overrides
   that just set bg=#FFFFFF / border=#E5E7EB have been removed because
   the element's base rule already reads var(--bg-secondary)/var(--border). */

[data-theme="light"] .landing-nav { background: rgba(255,255,255,0.95); backdrop-filter: blur(12px); }
[data-theme="light"] .landing-hero { background: linear-gradient(180deg, #F5F7FA 0%, #E8EDF2 100%); }
[data-theme="light"] .landing-footer { background: #111827; }
[data-theme="light"] .auth-screen { background: var(--bg-input); }
[data-theme="light"] .auth-box { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
[data-theme="light"] .auth-error { background: rgba(220,38,38,0.06); border-color: rgba(220,38,38,0.2); color: var(--red); }
[data-theme="light"] .chat-messages { background: var(--bg-primary); }
[data-theme="light"] .chat-input { border: 1px solid var(--border-light); }
[data-theme="light"] .btn-logout { border-color: var(--border-light); color: var(--text-secondary); }
[data-theme="light"] .mode-btn { color: #374151; }
[data-theme="light"] .mode-btn.active { background: #E0F2FE; color: var(--cyan); }
[data-theme="light"] .profile-switcher { background: var(--bg-input); }
[data-theme="light"] .profile-tab { color: #6B7280; }
[data-theme="light"] .profile-tab:hover { background: var(--border); color: #374151; }
[data-theme="light"] .profile-tab.active { background: #E0F2FE; color: var(--cyan); }
[data-theme="light"] .sso-btn { color: #374151; }
[data-theme="light"] .sso-btn:hover { background: #F9FAFB; }
[data-theme="light"] .quick-prompt { color: #374151; }
[data-theme="light"] .quick-prompt:hover { background: #E0F2FE; }
[data-theme="light"] .company-card { background: #F9FAFB; }
[data-theme="light"] .welcome-card:hover { background: #F0F9FF; }
[data-theme="light"] .nav-lang-btn { background: rgba(11,126,155,0.06); border-color: var(--border-light); }
[data-theme="light"] .hero-quote { color: var(--cyan); }
[data-theme="light"] .accent { color: var(--cyan); }
[data-theme="light"] input, [data-theme="light"] textarea {
  background: #F9FAFB !important; border-color: var(--border-light) !important; color: var(--text-primary) !important;
}

/* Theme toggle button (shared) */
.theme-toggle {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-primary); padding: 4px 10px; cursor: pointer; font-size: 0.9rem;
  transition: all var(--trans-base);
}
.theme-toggle:hover { border-color: var(--cyan); }

/* Logo as clickable link */
a.logo, a.topbar-logo, a.auth-logo,
a.logo:visited, a.topbar-logo:visited, a.auth-logo:visited,
a.logo:hover, a.topbar-logo:hover, a.auth-logo:hover,
a.logo:active, a.topbar-logo:active, a.auth-logo:active {
  text-decoration: none; color: var(--text-primary); cursor: pointer;
}
a.logo span, a.topbar-logo span, a.auth-logo span,
a.logo:visited span, a.topbar-logo:visited span, a.auth-logo:visited span,
a.logo:hover span, a.topbar-logo:hover span, a.auth-logo:hover span,
a.logo:active span, a.topbar-logo:active span, a.auth-logo:active span {
  color: var(--cyan);
}

/* ── Cookie Consent Banner ─────────────────────────────────────────────── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10000;
  background: var(--bg-card); border-top: 1px solid var(--border);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.5);
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: center; gap: 16px;
  flex-wrap: wrap;
  animation: cookieSlideUp 0.3s ease-out;
}
@keyframes cookieSlideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.cookie-banner p {
  margin: 0; font-size: 0.85rem; color: var(--text-secondary);
  max-width: 700px; line-height: 1.5;
}
.cookie-banner a {
  color: var(--cyan); text-decoration: underline;
}
.cookie-banner-buttons {
  display: flex; gap: 8px; flex-shrink: 0;
}
.cookie-btn {
  padding: 8px 20px; border-radius: var(--radius-sm); font-size: 0.8rem;
  font-weight: 600; transition: all var(--trans-base); border: none; cursor: pointer;
}
.cookie-btn-accept {
  background: var(--cyan); color: var(--bg-primary);
}
.cookie-btn-accept:hover { opacity: 0.85; }
.cookie-btn-reject {
  background: transparent; color: var(--text-secondary);
  border: 1px solid var(--border);
}
.cookie-btn-reject:hover { border-color: var(--cyan); color: var(--text-primary); }

/* ── Onboarding Tour ───────────────────────────────────────────────────── */
.tour-overlay {
  position: fixed; inset: 0; z-index: 9000;
  background: rgba(0,0,0,0.5);
  transition: opacity 0.3s;
}
.tour-spotlight {
  position: fixed; z-index: 9001;
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 9999px rgba(0,0,0,0.5);
  transition: all 0.4s ease;
  pointer-events: none;
}
.tour-tooltip {
  position: fixed; z-index: 9002;
  background: var(--bg-card); border: 1px solid var(--cyan);
  border-radius: var(--radius-md); padding: 20px;
  max-width: 360px; width: max-content;
  box-shadow: 0 0 30px var(--cyan-bg-20);
  animation: tourFadeIn 0.3s ease;
}
@keyframes tourFadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.tour-step-num {
  font-size: 0.7rem; color: var(--cyan); font-weight: 600;
  letter-spacing: 1px; margin-bottom: 6px;
}
.tour-title {
  font-size: 1rem; font-weight: 700; color: var(--text-primary);
  margin-bottom: 8px;
}
.tour-text {
  font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5;
  margin-bottom: 16px;
}
.tour-actions {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.tour-btn {
  padding: 8px 20px; border-radius: var(--radius-sm); font-size: 0.8rem;
  font-weight: 600; transition: all var(--trans-base); border: none; cursor: pointer;
}
.tour-btn-next {
  background: var(--cyan); color: var(--bg-primary);
}
.tour-btn-next:hover { opacity: 0.85; }
.tour-btn-skip {
  background: transparent; color: var(--text-secondary); padding: 8px 12px;
}
.tour-btn-skip:hover { color: var(--text-primary); }
.tour-arrow {
  position: absolute; width: 12px; height: 12px;
  background: var(--bg-card); border: 1px solid var(--cyan);
  transform: rotate(45deg);
}
.tour-arrow-top { top: -7px; left: 30px; border-bottom: none; border-right: none; }
.tour-arrow-bottom { bottom: -7px; left: 30px; border-top: none; border-left: none; }
.tour-arrow-left { left: -7px; top: 20px; border-top: none; border-right: none; }
.tour-arrow-right { right: -7px; top: 20px; border-bottom: none; border-left: none; }

/* ══════════════════════════════════════════════════════════════════════════
   v3 - SURVEYS, FILE UPLOAD, TOKEN USAGE, PAYMENTS
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Survey Container ──────────────────────────────────────────────────── */
.survey-container {
  padding: 24px;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  overflow-y: auto;
  scrollbar-gutter: stable;
  height: 100%;
  box-sizing: border-box;
}
.survey-header { width: 100%; margin-bottom: 24px; }
.survey-header h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: 12px; color: var(--text-primary); }
.survey-overall-progress { display: flex; align-items: center; }
.survey-loading { text-align: center; padding: 40px; color: var(--text-dim); }

.survey-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: all var(--trans-base);
}
.survey-section:hover { border-color: var(--border-light); }

.survey-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  cursor: pointer;
  user-select: none;
}
.survey-section-header:hover { background: var(--bg-card-hover); }
.survey-section-left { display: flex; align-items: center; gap: 12px; }
.survey-section-right { display: flex; align-items: center; gap: 10px; }
.survey-section-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--cyan-dim); color: var(--cyan);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.85rem;
}
.survey-section-title { font-weight: 600; font-size: 0.95rem; }
.survey-chevron { font-size: 0.7rem; color: var(--text-dim); }

.survey-section-body {
  display: none;
  padding: 8px 16px 16px;
  border-top: 1px solid var(--border);
}
.survey-section.expanded .survey-section-body { display: block; }

.survey-status-badge {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.status-in_progress { background: rgba(255,176,32,0.15); color: var(--orange); }
.status-completed { background: rgba(0,214,138,0.15); color: var(--green); }

.btn-survey-pdf {
  background: var(--bg-input);
  border: 1px solid var(--border);
  color: var(--cyan);
  padding: 6px 14px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: background var(--trans-base);
  white-space: nowrap;
}
.btn-survey-pdf:hover { background: var(--cyan); color: var(--bg-card); }

/* ── Survey Questions ──────────────────────────────────────────────────── */
.survey-question {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.survey-question:last-of-type { border-bottom: none; }
.survey-question label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-primary);
}
.survey-options { display: flex; flex-wrap: wrap; gap: 6px; }
.survey-opt {
  flex: 1 1 0; min-width: 90px;
  padding: 6px 14px; text-align: center;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--trans-fast);
}
.survey-opt:hover { border-color: var(--cyan); color: var(--text-primary); }
.survey-opt.selected { background: var(--cyan-dim); border-color: var(--cyan); color: var(--cyan); font-weight: 600; }

.survey-scale { display: flex; align-items: center; gap: 6px; }
.survey-scale-btn {
  width: 36px; height: 36px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-secondary);
  font-weight: 700;
  cursor: pointer;
  transition: all var(--trans-fast);
}
.survey-scale-btn:hover { border-color: var(--cyan); }
.survey-scale-btn.selected { background: var(--cyan); color: var(--bg-primary); border-color: var(--cyan); }

.survey-text-input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.85rem;
  min-height: 60px;
  resize: vertical;
}
.survey-text-input:focus { border-color: var(--cyan); outline: none; }

.survey-section-actions {
  padding-top: 12px;
  display: flex;
  gap: 8px;
}
.btn-survey-complete {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity var(--trans-fast);
}
.btn-survey-complete:hover { opacity: 0.85; }

.survey-completed-banner {
  margin-top: 24px;
  padding: 20px;
  background: rgba(0,214,138,0.1);
  border: 1px solid var(--green);
  border-radius: var(--radius-md);
  text-align: center;
}
.survey-completed-banner h3 { color: var(--green); margin-bottom: 8px; }
.survey-score { font-size: 1.4rem; font-weight: 800; color: var(--cyan); }

/* ── File Upload ───────────────────────────────────────────────────────── */
.file-upload-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1.1rem;
  transition: all var(--trans-fast);
  flex-shrink: 0;
}
.file-upload-btn:hover { border-color: var(--cyan); background: var(--bg-card-hover); }

.file-limits-info {
  font-size: 0.75rem;
  color: var(--text-dim);
  padding: 4px 8px;
  text-align: center;
}
.file-item { padding: 4px 12px !important; gap: 6px; }
.file-download-btn {
  background: none; border: none; color: var(--cyan); cursor: pointer;
  font-size: 0.85rem; padding: 2px 4px; border-radius: 4px; flex-shrink: 0;
}
.file-download-btn:hover { background: var(--cyan-dim); }

/* ── Token Usage ───────────────────────────────────────────────────────── */
.token-usage-bar { padding: 4px 0; }
.token-limit-banner {
  margin-top: 8px;
  padding: 10px;
  background: rgba(255,75,106,0.1);
  border: 1px solid var(--red);
  border-radius: var(--radius-sm);
  text-align: center;
}
.token-limit-banner p { margin: 4px 0; color: var(--red); font-size: 0.85rem; }
.btn-buy-tokens {
  margin-top: 8px;
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: opacity var(--trans-fast);
}
.btn-buy-tokens:hover { opacity: 0.85; }

/* ── Payment Packages ──────────────────────────────────────────────────── */
.payment-packages {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px 0;
}
.payment-package-card {
  flex: 1;
  min-width: 120px;
  max-width: 160px;
  padding: 20px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-align: center;
  cursor: pointer;
  transition: all var(--trans-fast);
}
.payment-package-card:hover { border-color: var(--cyan); transform: translateY(-2px); box-shadow: var(--shadow-cyan); }
.package-tokens { font-weight: 700; font-size: 0.95rem; margin-bottom: 8px; color: var(--text-primary); }
.package-price { font-size: 1.2rem; font-weight: 800; color: var(--cyan); }
.payment-not-configured { text-align: center; padding: 16px; }

/* Survey/payment: override input-ish backgrounds to the slightly warmer
   --bg-primary tone (matches the rest of the light-mode surface). Other
   overrides here were redundant with the base vars and have been removed. */
[data-theme="light"] .survey-opt,
[data-theme="light"] .survey-scale-btn,
[data-theme="light"] .survey-text-input,
[data-theme="light"] .file-upload-btn { background: var(--bg-primary); }

/* ══ Vulnerabilities panel ══════════════════════════════════════════════ */

/* Layout */
.vulns-panel { padding: 24px 28px; overflow-y: auto; height: 100%; }
.vulns-container { max-width: 1200px; margin: 0 auto; }

/* Header */
.vulns-header {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 16px; gap: 10px; flex-wrap: wrap;
}
.vulns-title { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: 1px; }
.vulns-title-count {
  font-size: .85rem; color: var(--text-dim); font-weight: 500; margin-left: 8px;
}
.vulns-actions { display: flex; gap: 8px; position: relative; }
.vulns-actions .btn-modal-cancel.is-active { background: var(--bg-primary); }

/* Filters */
.vulns-filters {
  display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; align-items: center;
}
.vulns-vendor-wrap { position: relative; width: 260px; }
.vulns-input,
.vulns-select {
  padding: 8px 12px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary);
}
.vulns-vendor-wrap .vulns-input { width: 100%; }
.vulns-search { flex: 1; min-width: 200px; }
.vulns-search-btn { flex: 0 0 auto; padding: 8px 16px; font-size: 0.85rem; }
.vulns-vendor-suggest {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 6px; margin-top: 4px; max-height: 240px;
  overflow-y: auto; z-index: 20;
}
.vulns-suggest-item { padding: 6px 12px; cursor: pointer; font-size: 0.85rem; color: var(--text-primary); }
.vulns-suggest-item:hover { background: var(--bg-primary); color: var(--cyan); }
.vulns-vendor-bar input::placeholder { color: var(--text-secondary); opacity: 0.85; }
.vulns-kev-toggle {
  display: flex; align-items: center; gap: 6px;
  font-size: .9rem; cursor: pointer;
}

/* Vendor chips */
.vulns-chips {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 6px; margin-bottom: 14px;
}
.vulns-chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--cyan-bg-15); color: var(--cyan);
  padding: 3px 10px; border-radius: 14px; font-size: .85rem;
}
.vulns-chip-remove {
  background: none; border: none; color: var(--cyan);
  cursor: pointer; font-size: 1rem; line-height: 1; padding: 0;
}
.vulns-chip-suggest {
  background: rgba(255, 255, 255, 0.03); color: var(--text-secondary);
  border: 1px dashed var(--border-light);
  padding: 3px 10px; border-radius: 14px; font-size: .8rem; cursor: pointer;
}
.vulns-chip-clear { padding: 3px 10px; font-size: .8rem; margin-left: auto; }

/* Presets dropdown */
.vulns-presets {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--bg-secondary); border: 1px solid var(--border);
  border-radius: 8px; width: 320px; max-height: 380px; overflow-y: auto;
  z-index: 30; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35); padding: 10px;
}
.vulns-preset-save-row { display: flex; gap: 6px; margin-bottom: 8px; }
.vulns-preset-name-input {
  flex: 1; padding: 6px 10px;
  background: var(--bg-primary); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-primary); font-size: .85rem;
}
.vulns-preset-save-btn { padding: 6px 12px; font-size: .8rem; }
.vulns-preset-heading {
  font-size: .75rem; color: var(--text-dim); margin-bottom: 4px;
  text-transform: uppercase; letter-spacing: 1px;
}
.vulns-preset-empty {
  padding: 14px 4px; color: var(--text-dim);
  font-size: .85rem; text-align: center;
}
.vulns-preset-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 4px; border-top: 1px solid var(--border);
}
.vulns-preset-load {
  flex: 1; text-align: left; background: none; border: none;
  color: var(--text-primary); cursor: pointer;
  padding: 4px 6px; border-radius: 4px;
}
.vulns-preset-load:hover { background: var(--bg-primary); }
.vulns-preset-name { font-weight: 600; font-size: .88rem; }
.vulns-preset-summary { font-size: .75rem; color: var(--text-secondary); }
.vulns-preset-delete {
  background: none; border: none; color: var(--text-dim);
  cursor: pointer; padding: 4px 8px; font-size: 1rem;
}
.vulns-preset-delete:hover { color: var(--red); }

/* Table */
.vulns-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow-x: auto;
}
.vulns-table tr:last-child { border-bottom: 0; }
.vulns-table {
  width: 100%; border-collapse: collapse; font-size: .88rem; table-layout: fixed;
}
.vulns-table thead tr { text-align: left; border-bottom: 1px solid var(--border); }
.vulns-table th { padding: 10px 8px; }
.vulns-table th.is-sortable { cursor: pointer; }
.vulns-row { border-bottom: 1px solid var(--border); cursor: pointer; }
.vulns-cell { padding: 10px 8px; }
.vulns-cell--trunc { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vulns-cell-cve { font-family: var(--font-mono); font-weight: 700; color: var(--cyan); white-space: nowrap; }
.cve-id {
  display: inline-block; cursor: copy; padding: 2px 6px; border-radius: 4px;
  transition: background var(--trans-fast), color var(--trans-fast);
}
.cve-id:hover { background: var(--cyan-bg-20); }
[data-theme="light"] .cve-id:hover { background: rgba(11,126,155,0.18); }
.cve-id.copied,
.cve-id.copied:hover { background: var(--green); color: var(--bg-primary); }
.vulns-cell-vendor,
.vulns-cell-desc { color: var(--text-secondary); }
.vulns-cell-date { color: var(--text-secondary); white-space: nowrap; }
.vulns-cell-kev { color: var(--text-dim); }
.vulns-cell-kev.is-listed { color: var(--red); font-weight: 800; }
.vulns-cell-dash { opacity: .4; }

/* Severity badges */
.sev-badge {
  display: inline-block; min-width: 72px; padding: 4px 8px; margin: -2px 0; border-radius: 4px;
  background: #8898A6; color: #07090F; text-align: center;
  font-size: 10px; font-weight: 800; letter-spacing: .5px;
}
.sev-badge.sev-critical { background: #000000; color: #EEF2F6; border: 1px solid #EEF2F6; padding: 3px 7px; }
[data-theme="light"] .sev-badge.sev-critical { border: 0; padding: 4px 8px; }
.sev-badge.sev-high     { background: #FF0000; color: #EEF2F6; }
.sev-badge.sev-medium   { background: #FFC000; }
.sev-badge.sev-low      { background: #92D050; }
.sev-badge.sev-info     { background: #ACCBF9; }
.sev-badge.sev-na       { background: #BBBBBB; }

/* Empty / footer */
.vulns-empty { padding: 32px; text-align: center; color: var(--text-dim); }
.vulns-footer { text-align: center; margin-top: 16px; }
.vulns-footer-info { color: var(--text-dim); }
.vulns-footer-info--sm { font-size: .85rem; }

/* Expanded detail row */
.vulns-detail-row { background: var(--bg-card-hover); border-bottom: 1px solid var(--border); }
.vulns-detail-cell { padding: 16px 24px; }
.vulns-detail { line-height: 1.6; }
.vulns-detail-desc { margin: 0 0 12px; }
.vulns-detail-desc--translated { margin: 0 0 8px; }
.vulns-detail-original {
  margin: 0 0 12px; font-size: .88rem; color: var(--text-dim);
}
.vulns-detail-original > summary { cursor: pointer; color: var(--text-secondary); }
.vulns-detail-original > p { margin: 6px 0 0; }
.vulns-detail-meta {
  font-size: .82rem; color: var(--text-dim); margin-bottom: 10px;
}
.vulns-detail-meta > span { margin-right: 14px; }
.vulns-detail-meta > span:last-child { margin-right: 0; }
.vulns-detail-meta code { font-family: var(--font-mono); }
.vulns-detail-refs { font-size: .85rem; }
.vulns-detail-refs ul { margin: 6px 0 0 18px; padding: 0; }
.vulns-detail-refs a { color: var(--cyan); }
.vulns-detail-error { color: var(--red); }
.vulns-detail-loading { color: var(--text-dim); }

/* Vuln alerts modal contrast fixes (var(--text) was undefined, causing low-contrast text in dark mode) */
#modalVulnPrefs { color: var(--text-primary); }
#modalVulnPrefs label span,
#modalVulnPrefs .form-group label,
#modalVulnPrefs h2 { color: var(--text-primary); }
#modalVulnPrefs select,
#modalVulnPrefs input[type="text"] {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
#modalVulnPrefs select:focus,
#modalVulnPrefs input[type="text"]:focus {
  border-color: var(--cyan);
  outline: none;
}

/* ── Launch countdown (takeover screen) ─────────────────────────────────── */
.countdown-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 24px;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(0,200,240,0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 80%, rgba(0,214,138,0.05) 0%, transparent 55%),
    var(--bg-primary);
  color: var(--text-primary);
}
.countdown-box { max-width: 760px; width: 100%; text-align: center; }
.countdown-logo {
  font-size: 2.4rem; font-weight: 800; letter-spacing: 6px;
  color: var(--text-primary); margin-bottom: 12px;
}
.countdown-logo span { color: var(--cyan); }
.countdown-tagline {
  display: inline-block; padding: 6px 16px; border-radius: 20px;
  background: var(--cyan-dim); color: var(--cyan);
  font-size: 0.75rem; font-weight: 600; letter-spacing: 2px;
  text-transform: uppercase; margin-bottom: 28px;
}
.countdown-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700; margin-bottom: 36px;
  color: var(--text-secondary); letter-spacing: 1px;
}
.countdown-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; max-width: 640px; margin: 0 auto 32px;
}
.countdown-cell {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 8px);
  padding: 20px 8px;
}
.countdown-num {
  font-size: clamp(2rem, 7vw, 3.6rem);
  font-weight: 800; line-height: 1;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
  letter-spacing: 1px;
}
.countdown-label {
  margin-top: 10px;
  font-size: 0.75rem; letter-spacing: 2px;
  text-transform: uppercase; color: var(--text-dim);
}
.countdown-quote {
  margin-top: 24px; font-style: italic;
  color: var(--text-dim); font-size: 0.9rem;
}
@media (max-width: 520px) {
  .countdown-grid { grid-template-columns: repeat(2, 1fr); }
}
