/* ============================================
   Vigil Design System — vigil.css
   Single CSS file for the entire Vigil dashboard
   ============================================ */

/* --- Design Tokens --- */
:root {
    --bg: #0a0c10;
    --surface: #13161e;
    --surface-hover: #1a1d27;
    --border: rgba(255, 255, 255, 0.07);
    --border-hover: rgba(255, 255, 255, 0.15);
    --text: #e4e6eb;
    --muted: #8b8fa3;
    --accent: #6366f1;
    --accent-glow: rgba(99, 102, 241, 0.15);
    --accent-hover: #818cf8;
    --green: #22c55e;
    --red: #ef4444;
    --orange: #f59e0b;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

/* --- Reset --- */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Container --- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* --- Navigation --- */
.vigil-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 12, 16, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}
.nav-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.nav-logo {
    font-size: 1.3em;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    text-decoration: none;
}
.nav-logo:hover { text-decoration: none; color: var(--accent); }
.nav-links { display: flex; gap: 24px; }
.nav-links a {
    color: var(--muted);
    font-size: 0.9em;
    text-decoration: none;
    transition: color var(--transition);
}
.nav-links a:hover { color: var(--text); text-decoration: none; }
.nav-links a.active { color: var(--accent); font-weight: 600; }
.nav-auth { display: flex; align-items: center; gap: 12px; }
.nav-login-btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.9em;
    text-decoration: none;
    transition: opacity var(--transition);
}
.nav-login-btn:hover { opacity: 0.9; text-decoration: none; }
.nav-mobile-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.3em;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

/* --- Card Component --- */
.vigil-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: border-color var(--transition), transform var(--transition);
}
.vigil-card:hover {
    border-color: var(--border-hover);
    transform: translateY(-2px);
}

/* --- Metric Display --- */
.metric-value { font-size: 2.2em; font-weight: 700; line-height: 1.2; }
.metric-label {
    font-size: 0.8em;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.positive { color: var(--green); }
.negative { color: var(--red); }

/* --- Badge System --- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
}
.badge-win { background: rgba(34, 197, 94, 0.15); color: var(--green); border: 1px solid var(--green); }
.badge-loss { background: rgba(239, 68, 68, 0.15); color: var(--red); border: 1px solid var(--red); }
.badge-bear-exit { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge-stop-loss { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge-tp { background: rgba(34, 197, 94, 0.15); color: var(--green); }
.badge-trailing { background: rgba(99, 102, 241, 0.15); color: var(--accent); }

/* --- Tier Locked Overlay --- */
.tier-locked { position: relative; overflow: hidden; cursor: pointer; }
.tier-locked::after {
    content: '🔒 Upgrade to unlock';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 12, 16, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius);
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9em;
    z-index: 5;
}

/* --- Tier Badges --- */
.tier-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}
.tier-owner { background: rgba(99, 102, 241, 0.2); color: var(--accent); border: 1px solid var(--accent); }
.tier-guardian { background: rgba(245, 158, 11, 0.15); color: var(--orange); border: 1px solid var(--orange); }
.tier-sentinel { background: rgba(34, 197, 94, 0.15); color: var(--green); border: 1px solid var(--green); }
.tier-observer { background: rgba(139, 143, 163, 0.15); color: var(--muted); border: 1px solid var(--muted); }

/* --- Grid System --- */
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* --- Footer --- */
.vigil-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
    text-align: center;
    color: var(--muted);
    font-size: 0.85em;
}
.vigil-footer a { color: var(--muted); }
.vigil-footer a:hover { color: var(--text); }

/* --- Tables --- */
.vigil-table { width: 100%; border-collapse: collapse; }
.vigil-table th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.8em;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}
.vigil-table td {
    padding: 12px 16px;
    font-size: 0.9em;
    border-bottom: 1px solid var(--border);
}
.vigil-table tr:hover td { background: var(--surface-hover); }

/* --- Hero Section --- */
.hero {
    text-align: center;
    padding: 100px 0 60px;
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-size: 3.2em;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    position: relative;
}
.hero h1 span { color: var(--accent); }
.hero .tagline {
    font-size: 1.25em;
    color: var(--muted);
    max-width: 550px;
    margin: 0 auto 12px;
    position: relative;
}
.hero .sub-tagline {
    font-size: 0.95em;
    color: var(--muted);
    max-width: 500px;
    margin: 0 auto 36px;
    position: relative;
    opacity: 0.7;
}
.hero .cta {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 16px 36px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1.05em;
    transition: all var(--transition);
    position: relative;
}
.hero .cta:hover {
    opacity: 0.9;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 30px var(--accent-glow);
}
.hero .badge {
    background: rgba(34, 197, 94, 0.12);
    color: var(--green);
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
    margin-bottom: 20px;
}

/* --- Stats Bar --- */
.stats-bar {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 32px 0;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    text-align: center;
}
.stat-value { font-size: 1.8em; font-weight: 700; }
.stat-value.green { color: var(--green); }
.stat-label { font-size: 0.85em; color: var(--muted); margin-top: 4px; }

/* --- Section Defaults --- */
section { padding: 60px 0; }
section h2 { font-size: 1.8em; font-weight: 700; margin-bottom: 12px; }
section .subtitle { color: var(--muted); margin-bottom: 32px; }

/* --- Proof Bar --- */
.proof-bar { text-align: center; padding: 40px 0; }
.proof-bar p { color: var(--muted); font-size: 0.9em; }
.proof-bar .highlight { color: var(--accent); font-weight: 600; }

/* --- Signal Example --- */
.signal-example {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    max-width: 420px;
    margin: 32px auto 0;
    font-family: monospace;
    font-size: 0.85em;
    line-height: 1.8;
}
.signal-example .sig-header { color: var(--green); font-weight: 700; font-size: 1.1em; margin-bottom: 8px; }
.signal-example .sig-line { color: var(--muted); }
.signal-example .sig-disclaimer { color: var(--orange); font-size: 0.75em; margin-top: 12px; }

/* --- Performance Cards --- */
.perf-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.perf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.perf-metric { text-align: center; }
.perf-metric .value { font-size: 1.4em; font-weight: 700; }
.perf-metric .label { font-size: 0.8em; color: var(--muted); }
.paper-badge {
    display: inline-block;
    background: rgba(245, 158, 11, 0.15);
    color: var(--orange);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
}

/* --- Steps --- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.step {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
}
.step .num { color: var(--accent); font-weight: 700; font-size: 0.9em; margin-bottom: 8px; }
.step h3 { font-size: 1.1em; margin-bottom: 8px; }
.step p { color: var(--muted); font-size: 0.9em; }

/* --- Model Cards --- */
.model-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.model-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
}
.model-card h4 { font-size: 0.95em; margin-bottom: 4px; }
.model-card p { color: var(--muted); font-size: 0.85em; }

/* --- Pricing --- */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.price-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    text-align: center;
}
.price-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 40px var(--accent-glow);
    position: relative;
}
.price-card.featured::before {
    content: "Most Popular";
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    padding: 2px 16px;
    border-radius: 12px;
    font-size: 0.75em;
    font-weight: 600;
}
.price-card h3 { font-size: 1.2em; margin-bottom: 8px; }
.price-amount { font-size: 2.2em; font-weight: 700; }
.price-amount span { font-size: 0.4em; color: var(--muted); font-weight: 400; }
.price-features { list-style: none; text-align: left; margin: 20px 0; }
.price-features li { padding: 6px 0; font-size: 0.9em; color: var(--muted); }
.price-features li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.price-features li.no::before { content: "— "; color: var(--muted); }
.price-btn {
    display: block;
    padding: 12px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-align: center;
    margin-top: 16px;
    text-decoration: none;
}
.price-btn:hover { text-decoration: none; }
.price-btn.primary { background: var(--accent); color: #fff; }
.price-btn.primary:hover { opacity: 0.9; }
.price-btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.price-btn.secondary:hover { border-color: var(--border-hover); }

/* --- Risk Box --- */
.risk-box {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: var(--radius);
    padding: 24px;
}
.risk-box h3 { color: var(--red); margin-bottom: 12px; }
.risk-box ul { padding-left: 20px; color: var(--muted); }
.risk-box li { margin-bottom: 8px; font-size: 0.9em; }

/* --- Waitlist --- */
.waitlist {
    text-align: center;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 48px 24px;
    border: 1px solid var(--border);
}
.waitlist h2 span { color: var(--accent); }
.waitlist input {
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1em;
    width: 300px;
    margin-right: 8px;
}
.waitlist input:focus { outline: none; border-color: var(--accent); }
.waitlist button {
    padding: 14px 28px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    transition: all var(--transition);
}
.waitlist button:hover { box-shadow: 0 4px 20px var(--accent-glow); }

/* --- Testimonials --- */
.testimonials { text-align: center; }
.testimonial-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 24px; }
.testimonial {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    text-align: left;
}
.testimonial .quote { color: var(--muted); font-size: 0.9em; font-style: italic; margin-bottom: 12px; }
.testimonial .author { font-size: 0.8em; color: var(--accent); }

/* --- About --- */
.about-content { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; align-items: start; }
.credential {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    margin-bottom: 12px;
}
.credential h4 { font-size: 0.9em; margin-bottom: 4px; }
.credential p { color: var(--muted); font-size: 0.85em; }

/* --- ML Signal Panel --- */
.ml-gauge-bar {
    height: 20px;
    border-radius: 10px;
    background: #2c3e50;
    overflow: hidden;
    position: relative;
}
.ml-gauge-fill-up {
    height: 100%;
    background: linear-gradient(90deg, #27ae60, var(--green));
    transition: width 0.5s ease;
}
.ml-gauge-fill-down {
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--red), #c0392b);
    transition: width 0.5s ease;
}
.model-badge {
    font-size: 0.85em;
    padding: 4px 10px;
    border-radius: 12px;
    display: inline-block;
}
.model-active { background: rgba(34, 197, 94, 0.2); color: var(--green); border: 1px solid var(--green); }
.model-inactive { background: rgba(139, 143, 163, 0.2); color: var(--muted); border: 1px solid var(--muted); }
.regime-warning {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid var(--red);
    color: var(--red);
    padding: 8px 15px;
    border-radius: 5px;
    margin: 10px 0;
    font-weight: 600;
}

/* --- Bear Banner --- */
.bear-banner {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--red);
    border-radius: var(--radius-sm);
    padding: 12px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.bear-banner .bear-icon { font-size: 1.4em; }
.bear-banner .bear-title { color: var(--red); font-weight: 700; }
.bear-banner .bear-detail { font-size: 0.85em; color: var(--muted); margin-top: 2px; }

/* --- Utility --- */
.hidden { display: none !important; }

/* --- Login Form --- */
.login-container {
    max-width: 400px;
    margin: 80px auto;
    padding: 0 24px;
}
.login-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: center;
}
.login-card h2 { margin-bottom: 8px; }
.login-card .login-subtitle { color: var(--muted); font-size: 0.9em; margin-bottom: 24px; }
.login-card input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1em;
    margin-bottom: 16px;
}
.login-card input[type="password"]:focus { outline: none; border-color: var(--accent); }
.login-card button {
    width: 100%;
    padding: 14px;
    border-radius: var(--radius-sm);
    border: none;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 1em;
    cursor: pointer;
    transition: opacity var(--transition);
}
.login-card button:hover { opacity: 0.9; }
.login-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid var(--red);
    color: var(--red);
    padding: 10px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    margin-bottom: 16px;
}

/* --- Chart Containers --- */
.chart-container {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    position: relative;
    height: 400px;
}
.chart-container canvas { max-height: 350px; }

/* --- ML Mode Badges --- */
.ml-mode-badge { display: inline-block; padding: 3px 10px; border-radius: 10px; font-size: 0.8em; font-weight: 600; }
.ml-mode-ensemble { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.ml-mode-fallback { background: rgba(239, 68, 68, 0.2); color: var(--red); }
.ml-mode-low-confidence { background: rgba(243, 156, 18, 0.2); color: var(--orange); }
.ml-mode-single { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }

/* --- Responsive Breakpoints --- */
@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
    .nav-links { display: none; }
    .nav-mobile-toggle { display: block; }
    .nav-links.open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 16px 24px; gap: 12px; }
    .hero h1 { font-size: 2.2em; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .steps, .pricing-grid, .testimonial-grid { grid-template-columns: 1fr; }
    .model-grid { grid-template-columns: 1fr; }
    .perf-grid { grid-template-columns: repeat(2, 1fr); }
    .about-content { grid-template-columns: 1fr; }
    .waitlist input { width: 100%; margin-bottom: 8px; margin-right: 0; }
    .chart-container { height: 300px; }
}
