/* CipherSentinel — customer-facing platform styles
   Dark, technical, professional. Inspired by Linear, Cloudflare, Tailscale dashboards. */

:root {
    --bg: #0a0e1a;
    --bg-panel: #131826;
    --bg-card: #1a2033;
    --bg-elevated: #232b42;
    --border: #2d3550;
    --border-light: #3a4366;
    --text: #e6e9f2;
    --text-muted: #8b94a8;
    --text-dim: #6a7387;
    --accent: #5b8def;
    --accent-hover: #6f9cff;
    --accent-bg: #1d2842;
    --success: #22c55e;
    --warn: #f59e0b;
    --danger: #ef4444;
    --critical: #dc2626;
    --info: #06b6d4;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 16px rgba(0,0,0,0.3);
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body {
    margin: 0; padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
code { font-family: var(--mono); background: var(--bg-elevated); padding: 1px 6px;
       border-radius: 4px; font-size: 0.9em; color: #b4c5e8; }
pre.code-block { background: #050810; border: 1px solid var(--border);
                  border-radius: var(--radius); padding: 16px; overflow-x: auto;
                  font-family: var(--mono); font-size: 13px; color: #b4c5e8; margin: 8px 0; }

/* ── Top bar ───────────────────────────────────────────────────── */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-panel); border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700;
         font-size: 18px; color: var(--text); text-decoration: none; }
.brand-icon { font-size: 22px; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: var(--text-muted); font-weight: 500; font-size: 14px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.logout-link { color: var(--text-dim) !important; }

/* ── Container ─────────────────────────────────────────────────── */
.container { max-width: 1200px; margin: 0 auto; padding: 40px 32px; }

/* ── Buttons ──────────────────────────────────────────────────── */
.btn-primary, .btn-secondary, button[type=submit] {
    display: inline-block;
    padding: 10px 18px;
    border-radius: var(--radius);
    font-weight: 600; font-size: 14px; cursor: pointer;
    text-decoration: none !important;
    border: 1px solid transparent;
    transition: all 0.15s ease;
}
.btn-primary, button[type=submit] {
    background: var(--accent); color: white; border-color: var(--accent);
}
.btn-primary:hover, button[type=submit]:hover {
    background: var(--accent-hover); border-color: var(--accent-hover);
    color: white;
}
.btn-secondary {
    background: var(--bg-elevated); color: var(--text);
    border-color: var(--border-light);
}
.btn-secondary:hover { background: var(--border-light); color: white; }
.btn-lg { padding: 14px 28px; font-size: 16px; }
.btn-block { display: block; width: 100%; text-align: center; margin-top: 16px; }

/* ── Hero (landing) ───────────────────────────────────────────── */
.hero { text-align: center; padding: 60px 0 80px; }
.hero h1 { font-size: 52px; margin: 0 0 24px; font-weight: 700;
           background: linear-gradient(135deg, #fff 0%, #8aabff 100%);
           -webkit-background-clip: text; background-clip: text;
           -webkit-text-fill-color: transparent; }
.hero .lead { font-size: 19px; color: var(--text-muted); max-width: 720px;
              margin: 0 auto 40px; }
.cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* ── Live stats ───────────────────────────────────────────────── */
.live-stats { background: var(--bg-panel); border: 1px solid var(--border);
              border-radius: var(--radius-lg); padding: 32px; margin: 60px 0; }
.live-stats h2 { margin: 0 0 24px; font-size: 18px; color: var(--text-muted);
                 text-transform: uppercase; letter-spacing: 0.5px; text-align: center; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
             gap: 24px; }
.stat-card { text-align: center; }
.stat-number { font-size: 42px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.stat-fresh { color: var(--success); }
.stat-label { color: var(--text-muted); font-size: 13px; text-transform: uppercase;
              letter-spacing: 0.5px; }

/* ── Features ─────────────────────────────────────────────────── */
.features { padding: 60px 0; }
.features h2 { text-align: center; font-size: 32px; margin: 0 0 40px; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
                gap: 24px; }
.feature-card { background: var(--bg-card); border: 1px solid var(--border);
                border-radius: var(--radius-lg); padding: 28px; }
.feature-card h3 { margin: 0 0 12px; font-size: 17px; }
.feature-card p { margin: 0; color: var(--text-muted); font-size: 14px; }

/* ── Pricing ──────────────────────────────────────────────────── */
.pricing { padding: 60px 0; }
.pricing h2 { text-align: center; font-size: 32px; margin: 0 0 40px; }
.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
                gap: 24px; max-width: 1100px; margin: 0 auto; }
.pricing-card { background: var(--bg-card); border: 1px solid var(--border);
                border-radius: var(--radius-lg); padding: 32px 24px;
                text-align: center; position: relative; }
.pricing-card.featured { border-color: var(--accent); transform: scale(1.03);
                         box-shadow: 0 0 30px rgba(91,141,239,0.15); }
.popular-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
                  background: var(--accent); color: white; padding: 4px 12px;
                  border-radius: 12px; font-size: 11px; font-weight: 600;
                  text-transform: uppercase; letter-spacing: 0.5px; }
.pricing-card h3 { margin: 0 0 16px; font-size: 18px; color: var(--text-muted);
                    text-transform: uppercase; letter-spacing: 0.5px; }
.price { margin: 16px 0 24px; }
.price .dollar { font-size: 22px; color: var(--text-muted); vertical-align: top; }
.price .amount { font-size: 48px; font-weight: 700; }
.price .period { color: var(--text-muted); font-size: 16px; }
.features-list { list-style: none; padding: 0; margin: 0 0 24px; text-align: left; }
.features-list li { padding: 6px 0; color: var(--text-muted); font-size: 14px;
                    border-bottom: 1px solid rgba(255,255,255,0.04); }
.features-list li:last-child { border-bottom: none; }
.features-list li.dim { color: var(--text-dim); opacity: 0.55; }
.features-list li strong { color: var(--text); }

.pricing-sub { text-align: center; margin: -16px 0 32px; font-size: 14px; }
.tier-blurb { margin: -8px 0 4px; font-size: 12px; color: var(--text-dim);
              font-style: italic; text-align: center; }
.tier-target { margin: 0 0 18px; font-size: 13px; color: var(--text-muted);
               text-align: center; }
.price .from-label { font-size: 13px; color: var(--text-muted);
                     vertical-align: top; margin-right: 4px;
                     text-transform: uppercase; letter-spacing: 0.5px; }

/* ── Auth pages ───────────────────────────────────────────────── */
.auth-container { display: flex; justify-content: center; padding: 40px 0; }
.auth-card { background: var(--bg-card); border: 1px solid var(--border);
             border-radius: var(--radius-lg); padding: 40px; max-width: 440px; width: 100%; }
.auth-card-wide { max-width: 640px; }
.auth-card h1 { margin: 0 0 12px; font-size: 26px; }
.auth-card label { display: block; margin: 16px 0; font-size: 13px;
                   color: var(--text-muted); font-weight: 500; }
.auth-card input { display: block; width: 100%; padding: 11px 14px; margin-top: 6px;
                    background: var(--bg-elevated); border: 1px solid var(--border-light);
                    border-radius: var(--radius); color: var(--text); font-size: 15px;
                    font-family: inherit; }
.auth-card input:focus { outline: none; border-color: var(--accent); }
.auth-switch { margin-top: 24px; color: var(--text-muted); font-size: 14px; text-align: center; }
.api-key-display { margin: 24px 0; }
.api-key-display label { display: block; margin-bottom: 8px; font-size: 13px;
                         color: var(--text-muted); font-weight: 600; }
.api-key-box { display: flex; gap: 8px; align-items: center;
                background: var(--bg-elevated); border: 1px solid var(--border-light);
                border-radius: var(--radius); padding: 12px 16px; }
.api-key-box code { background: none; padding: 0; font-size: 13px; word-break: break-all; flex: 1; }
.next-steps { line-height: 2; color: var(--text-muted); }
.next-steps li { margin: 6px 0; }

/* ── Dashboard ────────────────────────────────────────────────── */
.dashboard-header { display: flex; align-items: center; justify-content: space-between;
                    margin-bottom: 32px; flex-wrap: wrap; gap: 16px; }
.dashboard-header h1 { margin: 0 0 4px; font-size: 28px; }
.dash-actions { display: flex; gap: 12px; }
.dashboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
                  gap: 24px; margin-bottom: 32px; }
.dash-card { background: var(--bg-card); border: 1px solid var(--border);
             border-radius: var(--radius-lg); padding: 24px; }
.dash-card h3 { margin: 0 0 16px; font-size: 15px; color: var(--text-muted);
                 text-transform: uppercase; letter-spacing: 0.5px; }
.dash-section { margin-bottom: 32px; }
.section-header { display: flex; align-items: center; justify-content: space-between;
                  margin-bottom: 16px; }
.section-header h2 { margin: 0; font-size: 20px; }

/* Usage bars */
.usage-bar { margin-bottom: 16px; }
.usage-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
.bar { height: 6px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--accent); transition: width 0.3s; }

.db-stats { display: flex; gap: 24px; margin-bottom: 16px; }
.db-stat .num { font-size: 24px; font-weight: 700; color: var(--text); }
.db-stat .lbl { font-size: 12px; color: var(--text-muted); text-transform: uppercase; }
.link-arrow { font-size: 14px; font-weight: 600; }

/* ── Tables ───────────────────────────────────────────────────── */
.data-table { width: 100%; border-collapse: collapse; background: var(--bg-card);
              border: 1px solid var(--border); border-radius: var(--radius-lg);
              overflow: hidden; }
.data-table th { text-align: left; padding: 12px 16px; background: var(--bg-panel);
                 color: var(--text-muted); font-size: 12px; text-transform: uppercase;
                 letter-spacing: 0.5px; border-bottom: 1px solid var(--border); }
.data-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: 14px; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: var(--bg-elevated); }
.empty-state { text-align: center; padding: 24px; color: var(--text-muted); font-style: italic; }

/* ── Badges ───────────────────────────────────────────────────── */
.badge { display: inline-block; padding: 3px 10px; border-radius: 12px;
         font-size: 11px; font-weight: 600; text-transform: uppercase;
         letter-spacing: 0.3px; }
.badge-completed, .sev-low { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-running, .sev-medium { background: rgba(245,158,11,0.15); color: #fbbf24; }
.badge-queued { background: rgba(6,182,212,0.15); color: #22d3ee; }
.badge-failed, .sev-critical { background: rgba(220,38,38,0.2); color: #f87171; }
.sev-high { background: rgba(239,68,68,0.15); color: #f87171; }
.sev-info { background: rgba(139,148,168,0.15); color: var(--text-muted); }

.grade { display: inline-block; padding: 3px 10px; border-radius: 6px;
         font-weight: 700; font-size: 13px; min-width: 32px; text-align: center; }
.grade-a { background: rgba(34,197,94,0.2); color: #4ade80; }
.grade-b { background: rgba(132,204,22,0.2); color: #a3e635; }
.grade-c { background: rgba(245,158,11,0.2); color: #fbbf24; }
.grade-d { background: rgba(239,68,68,0.2); color: #f87171; }
.grade-f { background: rgba(220,38,38,0.3); color: #ef4444; }

.type-pill { display: inline-block; padding: 2px 8px; background: var(--bg-elevated);
              border-radius: 4px; font-family: var(--mono); font-size: 11px;
              color: var(--text-muted); }

/* ── Alerts ───────────────────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: var(--radius); margin: 16px 0;
         border: 1px solid; }
.alert-info { background: var(--accent-bg); border-color: var(--accent); color: var(--text); }
.alert-error { background: rgba(220,38,38,0.1); border-color: var(--danger); color: #fca5a5; }
.alert-success { background: rgba(34,197,94,0.1); border-color: var(--success); color: #86efac; }

.alert-list { list-style: none; padding: 0; margin: 0; }
.alert-item { background: var(--bg-card); border: 1px solid var(--border);
              border-left-width: 4px; padding: 14px 18px; margin-bottom: 10px;
              border-radius: var(--radius); }
.alert-item.severity-critical { border-left-color: var(--critical); }
.alert-item.severity-high { border-left-color: var(--danger); }
.alert-item.severity-medium { border-left-color: var(--warn); }
.alert-item.severity-low { border-left-color: var(--info); }
.alert-severity { display: inline-block; font-size: 11px; font-weight: 700;
                   padding: 2px 8px; border-radius: 4px; margin-right: 8px;
                   background: var(--bg-elevated); color: var(--text-muted); }
.alert-time { float: right; color: var(--text-dim); font-size: 12px; }
.alert-item p { margin: 8px 0 0; color: var(--text-muted); font-size: 14px; }

/* ── Page headers ─────────────────────────────────────────────── */
.page-header { margin-bottom: 32px; }
.page-header h1 { margin: 0 0 8px; font-size: 28px; }

/* ── Filters ──────────────────────────────────────────────────── */
.filters-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 24px; }
.filters-bar input { flex: 1; padding: 11px 14px; background: var(--bg-elevated);
                      border: 1px solid var(--border-light); border-radius: var(--radius);
                      color: var(--text); font-size: 14px; font-family: var(--mono); }
.filters-bar input:focus { outline: none; border-color: var(--accent); }
#lookup-result { font-size: 13px; color: var(--text-muted); margin-left: 12px; }

/* ── Pagination ───────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center;
              gap: 16px; margin: 32px 0; }
.page-info { color: var(--text-muted); font-size: 14px; }

/* ── Report download links ────────────────────────────────────── */
.report-links { display: flex; gap: 6px; flex-wrap: wrap; }
.report-links a { display: inline-block;
                  padding: 4px 10px;
                  background: var(--accent-bg);
                  border: 1px solid var(--accent);
                  border-radius: 4px;
                  color: var(--accent);
                  font-size: 12px;
                  font-weight: 600;
                  text-decoration: none;
                  white-space: nowrap; }
.report-links a:hover { background: var(--accent); color: white; text-decoration: none; }

/* ── Info callout ─────────────────────────────────────────────── */
.info-callout { background: var(--bg-card); border: 1px solid var(--border);
                border-left: 4px solid var(--accent); border-radius: var(--radius-lg);
                padding: 20px 24px; margin: 24px 0; }
.info-callout h3 { margin: 0 0 12px; color: var(--text); font-size: 16px; }
.info-callout ul { margin: 0 0 12px; padding-left: 20px; color: var(--text-muted); }
.info-callout li { margin: 6px 0; font-size: 14px; }
.info-callout strong { color: var(--text); }

/* ── Misc ─────────────────────────────────────────────────────── */
.muted { color: var(--text-muted); }
.small { font-size: 12px; }

/* ── Footer ───────────────────────────────────────────────────── */
.footer { background: var(--bg-panel); border-top: 1px solid var(--border);
          padding: 32px 0; margin-top: 80px; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 0 32px;
                 display: flex; justify-content: space-between; align-items: center;
                 flex-wrap: wrap; gap: 24px; }
.footer p { margin: 4px 0 0; font-size: 13px; }
.footer a { color: var(--text-muted); margin: 0 12px; font-size: 14px; }
.footer a:hover { color: var(--text); }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
    .hero h1 { font-size: 36px; }
    .topbar { padding: 12px 16px; }
    .nav-links { gap: 12px; }
    .nav-links a { font-size: 13px; }
    .container { padding: 24px 16px; }
    .pricing-card.featured { transform: none; }
    .footer-inner { flex-direction: column; align-items: flex-start; }
}
