/* ============================================
   TokenShield Cloud — Global Stylesheet
   Design: Stripe/Linear-inspired, white base, Inter font
   ============================================ */

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

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #111;
    background: #fff;
    line-height: 1.6;
}

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

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input {
    font-family: inherit;
}

/* ── Utility ── */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.container-narrow {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Navbar ── */
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid #f0f0f0;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-logo {
    width: 28px;
    height: 28px;
    background: #111;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 800;
    font-size: 0.75rem;
    flex-shrink: 0;
}

.nav-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #111;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.nav-link {
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    transition: color 0.15s;
}

.nav-link:hover {
    color: #111;
}

.nav-cta {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    padding: 8px 18px;
    border-radius: 8px;
    transition: background 0.15s;
}

.nav-cta:hover {
    background: #333;
}

/* ── Buttons ── */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    padding: 14px 32px;
    border-radius: 10px;
    transition: background 0.15s;
}

.btn-primary:hover {
    background: #333;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #111;
    background: #fff;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 8px;
    transition: border-color 0.15s;
}

.btn-secondary:hover {
    border-color: #999;
}

.btn-teal {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    background: #0D9488;
    padding: 10px 20px;
    border-radius: 8px;
    transition: background 0.15s;
}

.btn-teal:hover {
    background: #0F766E;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    font-size: 0.8rem;
    font-weight: 500;
    color: #DC2626;
    background: #FEF2F2;
    padding: 6px 14px;
    border-radius: 6px;
    border: 1px solid #FECACA;
    transition: background 0.15s;
}

.btn-danger:hover {
    background: #FEE2E2;
}

.btn-sm {
    font-size: 0.8rem;
    padding: 8px 16px;
    border-radius: 8px;
}

/* ── Hero (LP) ── */
.hero {
    text-align: center;
    padding: 100px 0 80px 0;
}

.hero h1 {
    font-size: 3.8rem;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    color: #111;
    margin-bottom: 20px;
}

.hero .subtitle {
    font-size: 1.15rem;
    font-weight: 400;
    color: #666;
    line-height: 1.7;
    max-width: 520px;
    margin: 0 auto 36px auto;
}

.hero .sub-text {
    font-size: 0.82rem;
    color: #999;
    margin-top: 14px;
}

/* ── Section ── */
.section {
    padding: 80px 0;
}

.section-border {
    border-top: 1px solid #f0f0f0;
}

.section-title {
    font-size: 0.7rem;
    font-weight: 600;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    text-align: center;
    margin-bottom: 48px;
}

.section-heading {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    text-align: center;
    margin-bottom: 16px;
}

/* ── Steps (How it works) ── */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.step-card {
    padding: 32px;
    border: 1px solid #eee;
    border-radius: 12px;
}

.step-number {
    font-size: 0.7rem;
    font-weight: 700;
    color: #0D9488;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 12px;
}

.step-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
}

.step-desc {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.6;
}

/* ── Code Block ── */
.code-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.code-block {
    background: #111;
    color: #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
}

.code-block-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    border-bottom: 1px solid #222;
}

.code-block-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #444;
}

.code-block-title {
    font-size: 0.75rem;
    font-weight: 500;
    color: #888;
    margin-left: 6px;
}

.code-block pre {
    padding: 20px;
    font-size: 0.82rem;
    line-height: 1.7;
    overflow-x: auto;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
}

.code-block .highlight {
    color: #0D9488;
    font-weight: 600;
}

.code-block .comment {
    color: #666;
}

.code-block .string {
    color: #A7F3D0;
}

/* ── Pricing ── */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 36px 28px;
}

.pricing-card.featured {
    border-color: #0D9488;
    position: relative;
}

.pricing-featured-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem;
    font-weight: 600;
    color: #fff;
    background: #0D9488;
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 0.04em;
}

.pricing-plan {
    font-size: 0.8rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 2.2rem;
    font-weight: 800;
    color: #111;
    margin-bottom: 4px;
}

.pricing-price-sub {
    font-size: 0.82rem;
    color: #999;
    margin-bottom: 24px;
}

.pricing-features {
    list-style: none;
}

.pricing-features li {
    font-size: 0.85rem;
    color: #555;
    padding: 8px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pricing-features li::before {
    content: '';
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #f0fdfa;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%230D9488' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
}

/* ── Social Proof ── */
.proof-box {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.proof-quote {
    font-size: 1.1rem;
    font-weight: 500;
    color: #333;
    font-style: italic;
    margin-bottom: 24px;
    line-height: 1.7;
}

.proof-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
}

.proof-stat-value {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0D9488;
}

.proof-stat-label {
    font-size: 0.78rem;
    color: #999;
    margin-top: 2px;
}

/* ── Footer ── */
.footer {
    border-top: 1px solid #f0f0f0;
    padding: 32px 0;
    text-align: center;
}

.footer-text {
    font-size: 0.8rem;
    color: #bbb;
}

.footer-text a {
    color: #888;
    margin: 0 8px;
    transition: color 0.15s;
}

.footer-text a:hover {
    color: #111;
}

/* ── Auth Pages ── */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.auth-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #111;
    text-align: center;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 0.88rem;
    color: #888;
    text-align: center;
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #555;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px 14px;
    font-size: 0.9rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.15s;
    background: #fff;
    color: #111;
}

.form-input:focus {
    border-color: #0D9488;
}

.form-submit {
    width: 100%;
    padding: 14px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: #111;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s;
    margin-top: 8px;
}

.form-submit:hover {
    background: #333;
}

.form-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.85rem;
    color: #888;
}

.form-footer a {
    color: #0D9488;
    font-weight: 500;
}

.form-error {
    background: #FEF2F2;
    color: #DC2626;
    font-size: 0.82rem;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
}

.form-success {
    background: #f0fdfa;
    color: #0D9488;
    font-size: 0.82rem;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: none;
}

/* ── API Key Display ── */
.api-key-display {
    background: #111;
    color: #e0e0e0;
    border-radius: 8px;
    padding: 16px 20px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    margin: 16px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    word-break: break-all;
}

.api-key-display .copy-btn {
    color: #888;
    flex-shrink: 0;
    cursor: pointer;
    padding: 4px;
    transition: color 0.15s;
}

.api-key-display .copy-btn:hover {
    color: #fff;
}

/* ── Dashboard ── */
.dash-wrapper {
    min-height: 100vh;
    background: #fff;
}

.dash-hero {
    text-align: center;
    padding: 48px 0 24px 0;
}

.dash-hero-eyebrow {
    font-size: 0.7rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.dash-hero-amount {
    font-size: 4.5rem;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.04em;
    line-height: 1;
    margin: 10px 0;
}

.dash-hero-delta {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0D9488;
    background: #f0fdfa;
    padding: 4px 14px;
    border-radius: 20px;
}

/* Routing bar */
.routing-bar {
    display: flex;
    gap: 2px;
    border-radius: 8px;
    overflow: hidden;
    height: 28px;
    margin: 40px 0 10px 0;
}

.rb-seg {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    min-width: 40px;
    transition: width 0.3s;
}

.rb-cache { background: #0D9488; color: #fff; }
.rb-routed { background: #1E293B; color: #fff; }
.rb-orig { background: #E5E7EB; color: #666; }

.routing-legend {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 8px;
}

.rl-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.75rem;
    color: #888;
}

.rl-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* KPI grid */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin: 40px 0;
}

.kpi-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 22px;
}

.kpi-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.kpi-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-top: 8px;
}

.kpi-val {
    font-size: 1.6rem;
    font-weight: 700;
    color: #111;
}

.kpi-change {
    font-size: 0.72rem;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
}

.change-up { color: #0D9488; background: #f0fdfa; }
.change-down { color: #DC2626; background: #FEF2F2; }
.change-neutral { color: #888; background: #f5f5f5; }

/* Chart card */
.chart-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 28px;
    margin-bottom: 24px;
}

.chart-card canvas {
    width: 100% !important;
    max-height: 280px;
}

/* Two-column layout */
.two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 12px;
}

/* Compare card */
.compare-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 28px;
}

.compare-row {
    margin: 16px 0;
}

.compare-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.compare-name {
    font-size: 0.82rem;
    color: #888;
}

.compare-val {
    font-size: 0.85rem;
    font-weight: 600;
    color: #111;
}

.compare-bar {
    height: 8px;
    border-radius: 4px;
    background: #f0f0f0;
    overflow: hidden;
}

.compare-fill {
    height: 100%;
    border-radius: 4px;
}

.fill-orig { background: #e0e0e0; }
.fill-actual { background: #111; }
.fill-saved { background: #0D9488; }

.compare-divider {
    border: none;
    border-top: 1px dashed #eee;
    margin: 20px 0;
}

.compare-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.compare-total-label {
    font-size: 0.85rem;
    color: #888;
}

.compare-total-val {
    font-size: 1.3rem;
    font-weight: 700;
    color: #0D9488;
}

/* Model card */
.model-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 28px;
}

.model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid #f8f8f8;
}

.model-item:last-child {
    border-bottom: none;
}

.model-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: #333;
}

.model-pct {
    font-size: 0.75rem;
    color: #aaa;
    margin-left: 4px;
}

.model-right {
    text-align: right;
}

.model-count {
    font-size: 0.9rem;
    font-weight: 600;
    color: #111;
}

.model-cost {
    font-size: 0.75rem;
    color: #999;
}

/* Billing card */
.billing-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 28px;
    margin-top: 40px;
}

.billing-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f8f8f8;
}

.billing-row:last-child {
    border-bottom: none;
}

.billing-label {
    font-size: 0.88rem;
    color: #666;
}

.billing-value {
    font-size: 0.88rem;
    font-weight: 600;
    color: #111;
}

.billing-value.teal {
    color: #0D9488;
}

.billing-status {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
}

.status-calculated { background: #f0fdfa; color: #0D9488; }
.status-invoiced { background: #FEF3C7; color: #D97706; }
.status-paid { background: #DCFCE7; color: #16A34A; }
.status-pending { background: #f5f5f5; color: #888; }

/* Section label */
.section-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: #bbb;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 48px 0 16px 0;
}

/* ── Settings Page ── */
.settings-section {
    margin-bottom: 48px;
}

.settings-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 8px;
}

.settings-section p {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 20px;
}

.settings-table {
    width: 100%;
    border-collapse: collapse;
}

.settings-table th {
    text-align: left;
    font-size: 0.72rem;
    font-weight: 600;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.settings-table td {
    font-size: 0.88rem;
    color: #333;
    padding: 14px 0;
    border-bottom: 1px solid #f8f8f8;
}

.key-mono {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    color: #555;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.dot-active { background: #0D9488; }
.dot-inactive { background: #ccc; }

.plan-card {
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.plan-info-name {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
}

.plan-info-desc {
    font-size: 0.82rem;
    color: #888;
    margin-top: 4px;
}

/* ── Docs Page ── */
.docs-wrapper {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 80px 24px;
}

.docs-hero {
    text-align: center;
    padding: 48px 0;
}

.docs-hero h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 8px;
}

.docs-hero p {
    font-size: 0.95rem;
    color: #888;
}

.docs-section {
    margin-bottom: 48px;
}

.docs-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.docs-section h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    margin: 24px 0 8px 0;
}

.docs-section p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.7;
    margin-bottom: 12px;
}

.docs-code {
    background: #111;
    color: #e0e0e0;
    border-radius: 10px;
    padding: 20px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.82rem;
    line-height: 1.7;
    overflow-x: auto;
    margin: 12px 0;
}

.docs-code .comment { color: #666; }
.docs-code .string { color: #A7F3D0; }
.docs-code .highlight { color: #0D9488; font-weight: 600; }

.docs-endpoint {
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px 20px;
    margin: 8px 0;
}

.docs-method {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 8px;
}

.method-get { background: #DCFCE7; color: #16A34A; }
.method-post { background: #DBEAFE; color: #2563EB; }
.method-delete { background: #FEE2E2; color: #DC2626; }

.docs-path {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 0.85rem;
    color: #333;
}

.docs-desc {
    font-size: 0.82rem;
    color: #888;
    margin-top: 4px;
}

/* ── Badges ── */
.badge {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.badge-active { background: #f0fdfa; color: #0D9488; }
.badge-period { background: #f5f5f5; color: #666; }

/* ── Inline modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.3);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    max-width: 440px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
}

.modal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 16px;
}

/* ── Loading ── */
.loading-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #eee;
    border-top-color: #0D9488;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 6px;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.4rem;
    }

    .steps-grid {
        grid-template-columns: 1fr;
    }

    .code-compare {
        grid-template-columns: 1fr;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .two-col {
        grid-template-columns: 1fr;
    }

    .nav-right {
        gap: 12px;
    }

    .nav-link.hide-mobile {
        display: none;
    }

    .dash-hero-amount {
        font-size: 3rem;
    }

    .proof-stats {
        flex-direction: column;
        gap: 20px;
    }

    .plan-card {
        flex-direction: column;
        gap: 16px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.8rem;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .hero {
        padding: 60px 0 40px 0;
    }
}
