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

:root {
    --bg: #0f0f0f;
    --bg-card: #1a1a1a;
    --bg-input: #252525;
    --border: #333;
    --text: #e5e5e5;
    --text-muted: #888;
    --primary: #6366f1;
    --primary-hover: #818cf8;
    --danger: #ef4444;
    --success: #22c55e;
    --warning: #f59e0b;
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Layout */
.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Nav */
.nav {
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
}

.nav-inner {
    max-width: 960px;
    margin: 0 auto;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-logout button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
}

.nav-logout button:hover {
    color: var(--danger);
}

/* Auth card */
.auth-card {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.auth-card h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* Flash messages */
.flash-messages {
    margin-bottom: 1.5rem;
}

.flash {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.flash-error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.flash-info {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
}

.flash-success {
    background: rgba(34, 197, 94, 0.15);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #86efac;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
textarea,
select {
    padding: 0.6rem 0.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    font-family: inherit;
}

.form-group input,
.form-group textarea,
.form-group select,
.auth-card input,
.auth-card textarea {
    width: 100%;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.25);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: background 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-muted);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

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

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-warning:hover {
    background: #d97706;
}

.btn-small {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-full {
    width: 100%;
    margin-top: 0.5rem;
}

/* Typography */
h1 { font-size: 1.75rem; margin-bottom: 1rem; }
h2 { font-size: 1.35rem; margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }

.text-muted { color: var(--text-muted); }
.text-small { font-size: 0.85rem; }

/* Cards / Sections */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

a.card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.15s;
}

a.card:hover {
    border-color: var(--text-muted);
}

details summary {
    list-style: none;
}

details summary::-webkit-details-marker {
    display: none;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 0.6rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Status badges */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-pending {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.badge-accepted {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-revoked {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

/* Utility */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

/* Code / Secrets */
.code-block {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', monospace;
    font-size: 0.82rem;
    line-height: 1.6;
    overflow-x: auto;
    white-space: pre;
    word-break: normal;
    margin: 0;
}

pre.code-block {
    margin: 0;
}

pre.code-block code {
    font-family: inherit;
    font-size: inherit;
}

/* Syntax highlighting */
.code-block .kw  { color: #c792ea; }  /* keywords: const, if, return, import, async, await, def */
.code-block .str { color: #c3e88d; }  /* strings */
.code-block .fn  { color: #82aaff; }  /* function names */
.code-block .num { color: #f78c6c; }  /* numbers */
.code-block .var { color: #ffcb6b; }  /* special variables */
.code-block .dec { color: #c792ea; }  /* decorators */
.code-block .cmt { color: #546e7a; font-style: italic; } /* comments */

/* Copy button for code blocks */
.copy-btn {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-muted);
    padding: 0.2rem 0.6rem;
    font-size: 0.75rem;
    cursor: pointer;
    font-family: inherit;
}

.copy-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

/* ── Public pages ── */

/* Hero */
.hero {
    text-align: center;
    padding: 4rem 0 3rem;
}

.hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary) 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.btn-large {
    padding: 0.85rem 2.25rem;
    font-size: 1.05rem;
}

/* Hero diagram */
.hero-visual {
    margin-top: 3rem;
}

.hero-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.diagram-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.diagram-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.diagram-label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.diagram-arrow {
    width: 40px;
    height: 2px;
    background: var(--border);
    position: relative;
}

.diagram-arrow::after {
    content: '';
    position: absolute;
    right: 0;
    top: -4px;
    border: 5px solid transparent;
    border-left-color: var(--border);
}

/* Features */
.features {
    padding: 3rem 0;
}

.features h2 {
    text-align: center;
    margin-bottom: 2rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.25rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}

.feature-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* CTA section */
.cta-section {
    text-align: center;
    padding: 3rem 0;
}

.cta-section h2 {
    margin-bottom: 0.5rem;
}

.cta-section p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

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

.pricing-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 2rem;
}

.pricing-featured {
    border-color: var(--primary);
    position: relative;
}

.pricing-featured::before {
    content: 'Recommended';
    position: absolute;
    top: -0.75rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pricing-price {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.75rem 0;
}

.pricing-period {
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-muted);
}

.pricing-features {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.pricing-features li {
    padding: 0.4rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.pricing-features li:last-child {
    border-bottom: none;
}

/* FAQ */
.faq-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.75rem;
}

.faq-item h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.faq-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Legal pages */
.legal-page {
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.7;
}

.legal-page h1 {
    margin-bottom: 0.5rem;
}

.legal-updated {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2rem;
}

.legal-page h2 {
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    font-size: 1.15rem;
}

.legal-page h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.legal-page p,
.legal-page li {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.legal-page ul {
    padding-left: 1.5rem;
    margin: 0.5rem 0 1rem;
}

.legal-page li {
    margin-bottom: 0.35rem;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    margin-top: 3rem;
    padding: 2rem 0;
}

.footer-inner {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.footer-brand {
    margin-bottom: 1rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
}

.footer-links a:hover {
    color: var(--text);
}

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

    .hero-subtitle {
        font-size: 1rem;
    }

    .diagram-arrow {
        display: none;
    }

    .hero-diagram {
        flex-direction: column;
    }
}
