/* =====================================================
   HailyDB Developer Portal — Brand Kit
   Source of truth: ops-shared/work/brand-guide.md
   ===================================================== */

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

:root {
    --bg-primary:       #0a0f1a;
    --bg-surface:       #111827;
    --bg-elevated:      #1f2937;
    --bg-surface-alpha: rgba(17, 24, 39, 0.95);
    --text-primary:     #f9fafb;
    --text-secondary:   #9ca3af;
    --text-muted:       #6b7280;
    --accent-blue:      #38bdf8;
    --accent-blue-hover:#7dd3fc;
    --accent-amber:     #f59e0b;
    --accent-green:     #34d399;
    --accent-red:       #f87171;
    --border:           #374151;
    --border-alpha:     rgba(255, 255, 255, 0.08);
    --tier-free:        var(--text-muted);
    --tier-standard:    var(--accent-blue);
    --tier-pro:         #a78bfa;
    --radius-sm:        6px;
    --radius-md:        10px;
    --radius-lg:        14px;
    --radius-full:      999px;
    --shadow-sm:        0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md:        0 4px 12px rgba(0, 0, 0, 0.25);
    --shadow-lg:        0 8px 24px rgba(0, 0, 0, 0.3);
    --shadow-glow-blue: 0 0 20px rgba(56, 189, 248, 0.15);
    --font-display:     'Space Grotesk', sans-serif;
    --font-body:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:        'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font-body);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, .heading { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; color: var(--text-primary); }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.75rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }

p, .body-text { font-family: var(--font-body); font-size: 1rem; line-height: 1.6; color: var(--text-secondary); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }

code, .mono, .code { font-family: var(--font-mono); font-size: 0.8125rem; }
a { color: var(--accent-blue); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-blue-hover); text-decoration: none; }

.topbar { display: flex; align-items: center; justify-content: space-between; padding: 0 2rem; height: 64px; background: var(--bg-surface-alpha); border-bottom: 1px solid var(--border-alpha); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.topbar-brand { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: var(--text-primary); letter-spacing: -0.02em; }
.topbar-brand span { color: var(--accent-blue); }
.topbar-nav { display: flex; gap: 1.5rem; align-items: center; }
.topbar-nav a { color: var(--text-muted); font-family: var(--font-body); font-size: 0.875rem; font-weight: 500; transition: color 0.15s ease; }
.topbar-nav a:hover { color: var(--text-primary); }

.container { max-width: 1080px; margin: 0 auto; padding: 2.5rem 1.5rem; }

.card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; transition: border-color 0.2s ease, box-shadow 0.2s ease; }
.card:hover { border-color: rgba(255, 255, 255, 0.12); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; padding: 0.75rem 1.5rem; border: none; border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 0.9375rem; font-weight: 500; cursor: pointer; transition: all 0.15s ease; text-align: center; line-height: 1; }
.btn-primary { background: var(--accent-blue); color: var(--bg-primary); }
.btn-primary:hover { background: var(--accent-blue-hover); transform: translateY(-1px); box-shadow: 0 6px 20px rgba(56, 189, 248, 0.25); color: var(--bg-primary); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text-secondary); }
.btn-outline:hover { border-color: var(--accent-blue); color: var(--accent-blue); }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }
.btn-block { display: flex; width: 100%; }

.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; color: var(--text-secondary); font-size: 0.8125rem; font-weight: 500; margin-bottom: 0.375rem; }
.form-input { width: 100%; padding: 0.75rem 1rem; background: var(--bg-primary); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-primary); font-family: var(--font-body); font-size: 0.9375rem; transition: border-color 0.15s ease, box-shadow 0.15s ease; }
.form-input:focus { outline: none; border-color: var(--accent-blue); box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1); }
.form-input::placeholder { color: var(--text-muted); }

.badge { display: inline-flex; align-items: center; padding: 0.2rem 0.6rem; border-radius: var(--radius-full); font-family: var(--font-body); font-size: 0.6875rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
.badge-free { background: rgba(107, 114, 128, 0.15); color: var(--text-muted); }
.badge-standard { background: rgba(56, 189, 248, 0.12); color: var(--accent-blue); }
.badge-pro { background: rgba(167, 139, 250, 0.12); color: var(--tier-pro); }

table { width: 100%; border-collapse: collapse; }
table th { background: var(--bg-elevated); color: var(--text-secondary); font-size: 0.75rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; padding: 0.75rem 1rem; text-align: left; border-bottom: 1px solid var(--border); }
table td { padding: 0.75rem 1rem; font-size: 0.875rem; color: var(--text-primary); border-bottom: 1px solid var(--border-alpha); }
table tbody tr:hover { background: rgba(255, 255, 255, 0.02); }
table tbody tr:last-child td { border-bottom: none; }

.flash { padding: 0.75rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1.25rem; font-size: 0.875rem; }
.flash-error { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.2); color: #fca5a5; }
.flash-success { background: rgba(52, 211, 153, 0.1); border: 1px solid rgba(52, 211, 153, 0.2); color: #86efac; }
.flash-warning { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.2); color: #fcd34d; }

.split-flap-row { display: flex; justify-content: center; gap: 2.5rem; flex-wrap: wrap; margin: 2rem 0; }
.split-flap-group { display: flex; flex-direction: column; align-items: center; }
.split-flap { display: inline-flex; gap: 3px; }
.split-flap-digit { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; height: 3.25rem; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 1.75rem; font-weight: 500; color: var(--text-primary); position: relative; overflow: hidden; transition: transform 0.1s ease; }
.split-flap-digit::after { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--border); }
.split-flap-digit.flip { animation: flap 0.15s ease-out; }
@keyframes flap { 0% { transform: scaleY(1); } 50% { transform: scaleY(0.85); } 100% { transform: scaleY(1); } }
.split-flap-comma { display: inline-flex; align-items: flex-end; padding-bottom: 0.25rem; font-family: var(--font-mono); font-size: 1.75rem; color: var(--text-muted); width: 0.75rem; }
.split-flap-plus { display: inline-flex; align-items: center; font-family: var(--font-mono); font-size: 1.25rem; color: var(--accent-blue); margin-left: 2px; }
.split-flap-label { font-size: 0.6875rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 0.5rem; font-weight: 600; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1.25rem; }
.stat-card .label { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 0.25rem; }
.stat-card .value { font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }

.usage-bar-wrap { background: rgba(255,255,255,0.05); border-radius: 4px; height: 8px; overflow: hidden; margin-top: 0.25rem; }
.usage-bar { height: 100%; border-radius: 4px; transition: width 0.3s; }

.key-reveal { background: rgba(52, 211, 153, 0.06); border: 1px solid rgba(52, 211, 153, 0.2); border-radius: var(--radius-lg); padding: 1.25rem; margin-bottom: 2rem; }
.key-reveal h3 { color: var(--accent-green); font-size: 0.875rem; font-weight: 600; margin-bottom: 0.5rem; }
.key-reveal code { display: block; background: rgba(0,0,0,0.3); padding: 0.75rem 1rem; border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.875rem; color: var(--accent-green); word-break: break-all; user-select: all; margin-bottom: 0.5rem; }
.key-reveal .warning { font-size: 0.75rem; color: var(--accent-amber); }

.quickstart { background: rgba(56, 189, 248, 0.04); border: 1px solid rgba(56, 189, 248, 0.12); border-radius: var(--radius-lg); padding: 1.25rem; }
.quickstart h3 { font-size: 0.875rem; font-weight: 600; color: var(--accent-blue); margin-bottom: 0.75rem; }
.quickstart pre { background: var(--bg-primary); border: 1px solid var(--border); padding: 0.75rem 1rem; border-radius: var(--radius-md); overflow-x: auto; font-family: var(--font-mono); font-size: 0.8125rem; color: var(--text-secondary); line-height: 1.7; }

.pricing-hero { text-align: center; margin-bottom: 2rem; }
.pricing-hero h1 { margin-bottom: 0.5rem; }
.pricing-hero p { color: var(--text-secondary); font-size: 1.0625rem; max-width: 520px; margin: 0 auto; }

.pricing-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; margin-bottom: 3rem; }

.plan-card { background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; display: flex; flex-direction: column; position: relative; transition: border-color 0.2s, transform 0.2s; }
.plan-card:hover { border-color: rgba(255,255,255,0.15); transform: translateY(-2px); }
.plan-card.featured { border-color: var(--accent-blue); box-shadow: var(--shadow-glow-blue); }
.plan-card.featured::before { content: "Most Popular"; position: absolute; top: -0.75rem; left: 50%; transform: translateX(-50%); background: var(--accent-blue); color: var(--bg-primary); font-family: var(--font-display); font-size: 0.6875rem; font-weight: 600; padding: 0.2rem 0.75rem; border-radius: var(--radius-full); text-transform: uppercase; letter-spacing: 0.04em; }

.plan-name { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; margin-bottom: 0.25rem; }
.plan-price { font-family: var(--font-display); font-size: 2.5rem; font-weight: 700; margin-bottom: 0.25rem; }
.plan-price .currency { font-size: 1.25rem; vertical-align: super; color: var(--text-muted); }
.plan-price .period { font-size: 0.875rem; color: var(--text-muted); font-weight: 400; }
.plan-desc { color: var(--text-muted); font-size: 0.8125rem; margin-bottom: 1.5rem; min-height: 2.5rem; }

.plan-features { list-style: none; margin-bottom: 2rem; flex: 1; }
.plan-features li { padding: 0.375rem 0; font-size: 0.875rem; color: var(--text-primary); display: flex; align-items: center; gap: 0.5rem; }
.plan-features li::before { content: "\2713"; color: var(--accent-green); font-weight: 700; flex-shrink: 0; }
.plan-cta { margin-top: auto; }

.enterprise-banner { text-align: center; padding: 2rem; background: var(--bg-surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.enterprise-banner h3 { font-family: var(--font-display); font-size: 1.125rem; font-weight: 600; margin-bottom: 0.5rem; }
.enterprise-banner p { color: var(--text-muted); font-size: 0.875rem; margin-bottom: 1rem; }

.dash-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.dash-header h1 { font-size: 1.5rem; }
.dash-header .plan-info { display: flex; align-items: center; gap: 0.75rem; }
section { margin-bottom: 2rem; }
section h2 { font-size: 1.125rem; padding-bottom: 0.5rem; margin-bottom: 1rem; border-bottom: 1px solid var(--border); }
.actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.auth-wrapper { max-width: 420px; margin: 2rem auto; }
.auth-wrapper h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.auth-wrapper .subtitle { color: var(--text-secondary); font-size: 0.875rem; margin-bottom: 2rem; }
.auth-footer { text-align: center; color: var(--text-muted); font-size: 0.8125rem; margin-top: 1.5rem; }
.row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

@media (max-width: 768px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.375rem; }
    .topbar { padding: 0 1rem; height: 56px; }
    .topbar-nav { gap: 1rem; }
    .topbar-nav a { font-size: 0.8125rem; }
    .container { padding: 1.5rem 1rem; }
    .card { padding: 1.25rem; }
    .pricing-grid { grid-template-columns: 1fr; }
    .split-flap-digit { width: 1.75rem; height: 2.5rem; font-size: 1.25rem; }
    .split-flap-row { gap: 1.5rem; }
    .row-2 { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
    .topbar-brand { font-size: 1.125rem; }
    .btn { padding: 0.625rem 1.25rem; font-size: 0.875rem; }
    .stat-grid { grid-template-columns: 1fr; }
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--text-muted); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-secondary); }
::selection { background: rgba(56, 189, 248, 0.25); color: var(--text-primary); }
