/* ============================================================
   VentureIQ AI — Design tokens
   Color: void navy bg, aurora violet + signal cyan accents,
   verdict colors (positive/watch/risk) for scores.
   Type: Space Grotesk (display) / Inter (body) / JetBrains Mono (data)
   ============================================================ */

:root {
    --bg-void: #080b14;
    --bg-void-2: #0d1120;
    --glass-bg: rgba(255, 255, 255, 0.045);
    --glass-border: rgba(255, 255, 255, 0.09);
    --glass-highlight: rgba(255, 255, 255, 0.14);

    --aurora-violet: #7c5cff;
    --aurora-cyan: #00d9ff;

    --verdict-positive: #10d9a0;
    --verdict-watch: #f5a623;
    --verdict-risk: #ff4d6d;

    --text-primary: #eef1f8;
    --text-secondary: #9aa3bd;
    --text-tertiary: #5c6484;

    --radius-lg: 20px;
    --radius-md: 14px;
    --radius-sm: 9px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-void);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
}

h1, h2, h3, .display {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

.mono, .score-number, .metric-value {
    font-family: 'JetBrains Mono', ui-monospace, monospace;
    font-variant-numeric: tabular-nums;
}

a { color: inherit; text-decoration: none; }

/* ---------- Aurora background ---------- */

.aurora-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.aurora-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.35;
    animation: drift 22s ease-in-out infinite alternate;
}

.aurora-blob.b1 {
    width: 520px; height: 520px;
    top: -120px; left: -80px;
    background: var(--aurora-violet);
}
.aurora-blob.b2 {
    width: 460px; height: 460px;
    bottom: -140px; right: -60px;
    background: var(--aurora-cyan);
    animation-delay: -8s;
}
.aurora-blob.b3 {
    width: 340px; height: 340px;
    top: 40%; left: 55%;
    background: var(--verdict-positive);
    opacity: 0.12;
    animation-delay: -14s;
}

@keyframes drift {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(40px, -30px) scale(1.08); }
}

/* ---------- Glass primitives ---------- */

.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px) saturate(140%);
    -webkit-backdrop-filter: blur(20px) saturate(140%);
    border-radius: var(--radius-lg);
    position: relative;
}

.glass::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, var(--glass-highlight), transparent 40%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.glass-card {
    padding: 24px;
}

.glass-nav {
    background: rgba(10, 13, 24, 0.6);
    border-right: 1px solid var(--glass-border);
    backdrop-filter: blur(24px) saturate(140%);
    -webkit-backdrop-filter: blur(24px) saturate(140%);
}

/* ---------- Layout shell ---------- */

.app-shell {
    position: relative;
    z-index: 1;
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 232px;
    flex-shrink: 0;
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar .brand {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 19px;
    font-weight: 600;
    padding: 8px 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-mark {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--aurora-violet), var(--aurora-cyan));
    flex-shrink: 0;
}

.nav-link {
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.nav-link:hover { background: rgba(255,255,255,0.05); color: var(--text-primary); }
.nav-link.active {
    background: rgba(124, 92, 255, 0.14);
    color: var(--text-primary);
    box-shadow: inset 0 0 0 1px rgba(124, 92, 255, 0.35);
}

.main {
    flex: 1;
    padding: 28px 32px;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

.topbar h1 { font-size: 22px; margin: 0; font-weight: 600; }
.topbar .sub { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; }

/* ---------- Grid & widgets ---------- */

.grid {
    display: grid;
    gap: 18px;
}
.grid.cols-6 { grid-template-columns: repeat(6, 1fr); }
.grid.cols-5 { grid-template-columns: repeat(5, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 1100px) {
    .grid.cols-6 { grid-template-columns: repeat(3, 1fr); }
    .grid.cols-5 { grid-template-columns: repeat(3, 1fr); }
    .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
    .grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

.metric-card .label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 10px;
}
.metric-card .metric-value {
    font-size: 28px;
    font-weight: 600;
}
.metric-card .metric-sub {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin-top: 6px;
}

.verdict-dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.verdict-strong_buy, .verdict-buy { background: var(--verdict-positive); }
.verdict-watchlist { background: var(--verdict-watch); }
.verdict-high_risk, .verdict-reject { background: var(--verdict-risk); }

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.02em;
}
.badge.strong_buy, .badge.buy { background: rgba(16,217,160,0.15); color: var(--verdict-positive); }
.badge.watchlist { background: rgba(245,166,35,0.15); color: var(--verdict-watch); }
.badge.high_risk, .badge.reject { background: rgba(255,77,109,0.15); color: var(--verdict-risk); }

/* ---------- Forms ---------- */

.field { margin-bottom: 16px; }
.field label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.field input, .field select, .field textarea {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
}
.field input:focus, .field select:focus, .field textarea:focus {
    outline: 2px solid var(--aurora-violet);
    outline-offset: 1px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.15s;
}
.btn:hover { opacity: 0.92; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, var(--aurora-violet), #6845e0); color: white; }
.btn-secondary { background: rgba(255,255,255,0.07); color: var(--text-primary); border: 1px solid var(--glass-border); }
.btn-block { width: 100%; }

.auth-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.auth-card { width: 100%; max-width: 400px; padding: 36px; }
.auth-card h1 { font-size: 22px; margin: 0 0 6px; }
.auth-card .sub { color: var(--text-secondary); font-size: 13.5px; margin-bottom: 24px; }

.alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    margin-bottom: 16px;
}
.alert.error { background: rgba(255,77,109,0.12); color: #ffb0bf; border: 1px solid rgba(255,77,109,0.3); }
.alert.success { background: rgba(16,217,160,0.12); color: #a9f2dd; border: 1px solid rgba(16,217,160,0.3); }

/* ---------- Signal Ring (signature element) ---------- */

.signal-ring-wrap {
    display: flex;
    align-items: center;
    gap: 28px;
}
.signal-ring-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.signal-ring-verdict-number {
    font-family: 'JetBrains Mono', monospace;
    font-size: 34px;
    font-weight: 700;
}
.signal-ring-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 13px;
}
.signal-ring-legend .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.legend-swatch { width: 10px; height: 10px; border-radius: 3px; }

/* ---------- AI Chat Panel ---------- */

.chat-panel {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 56px);
    position: sticky;
    top: 28px;
    margin: 28px 28px 28px 0;
}
.chat-header {
    padding: 16px 18px;
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chat-pulse {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--verdict-positive);
    box-shadow: 0 0 8px var(--verdict-positive);
}
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.chat-msg {
    font-size: 13.5px;
    line-height: 1.5;
    padding: 10px 12px;
    border-radius: 12px;
    max-width: 90%;
}
.chat-msg.user {
    align-self: flex-end;
    background: rgba(124,92,255,0.18);
}
.chat-msg.assistant {
    align-self: flex-start;
    background: rgba(255,255,255,0.05);
}
.chat-input-row {
    padding: 14px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    gap: 8px;
}
.chat-input-row input {
    flex: 1;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    color: var(--text-primary);
    font-size: 13.5px;
}
.chat-input-row button {
    background: linear-gradient(135deg, var(--aurora-violet), var(--aurora-cyan));
    border: none;
    border-radius: var(--radius-sm);
    width: 38px;
    color: white;
    cursor: pointer;
}

.doc-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--glass-border);
    font-size: 13.5px;
}
.doc-row:last-child { border-bottom: none; }

.section-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.prose-block { font-size: 13.5px; line-height: 1.65; color: var(--text-secondary); }
.prose-block strong { color: var(--text-primary); }

.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-tertiary);
}
