/* ── SubGrade Shared Styles ───────────────────────────────
   Common CSS used across all landing pages.
   Include via: <link rel="stylesheet" href="/shared-styles.css">
   Page-specific styles go in each page's <style> block.
   ──────────────────────────────────────────────────────── */

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

:root {
    --bg: #0a0e17;
    --surface: #111827;
    --elevated: #1e2740;
    --border: #1f2937;
    --text: #f0f0f0;
    --text-dim: #9ca3af;
    --accent: #3bf0a0;
    --warm: #f0a03b;
    --orange: #f07a3b;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    padding-top: 56px;
}

h1, h2, h3, h4, h5, h6 { font-weight: 700; }

/* ── Nav ──────────────────────────────────────────────── */

.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
}
.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-logo img { width: 28px; height: 28px; }
.nav-logo .accent { color: var(--accent); }
.nav-links { display: flex; gap: 28px; }
.nav-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.15s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--accent); }

.nav-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.8rem;
    color: var(--text-dim);
    position: relative;
}
.nav-auth-btn {
    padding: 6px 14px;
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-dim);
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
}
.nav-auth-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-auth-btn-accent { background: var(--accent); color: var(--bg); border-color: var(--accent); font-weight: 600; }
.nav-auth-btn-accent:hover { opacity: 0.85; }
.nav-user-trigger {
    cursor: pointer;
    padding: 4px 0;
    font-size: 0.82rem;
    color: var(--text);
    font-weight: 500;
}
.nav-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    min-width: 220px;
    padding: 8px 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    z-index: 2000;
}
.nav-dropdown.open { display: block; }
.nav-dd-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    font-size: 0.82rem;
    color: var(--text-dim);
    cursor: default;
}
.nav-dd-item span:last-child { color: var(--text); font-weight: 500; }
.nav-dd-sep { border-top: 1px solid var(--border); margin: 4px 0; }
.nav-dd-action {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 0.82rem;
    color: var(--text-dim);
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.1s;
}
.nav-dd-action:hover { color: var(--accent); }
.nav-dd-action.danger:hover { color: #ef4444; }

.nav-hamburger {
    display: none;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 0;
    line-height: 1;
}

/* ── Section labels ──────────────────────────────────── */

.section-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 10px;
}
.section-heading {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

/* ── Value cards ─────────────────────────────────────── */

.value-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 24px;
}
.value-card .icon { font-size: 1.5rem; margin-bottom: 10px; }
.value-card h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 6px; }
.value-card p { font-size: 0.85rem; color: var(--text-dim); line-height: 1.5; }

/* ── Pricing ─────────────────────────────────────────── */

.pricing-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 48px 24px 112px;
    text-align: center;
}
.pricing-grid {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-top: 24px;
}
.pricing-card {
    flex: 1;
    max-width: 360px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 24px;
    text-align: left;
    position: relative;
}
.pricing-card.featured {
    background: var(--elevated);
    border-color: var(--accent);
    box-shadow: 0 0 24px rgba(59, 240, 160, 0.08);
}
.pricing-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: var(--bg);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 14px;
    border-radius: 20px;
}
.pricing-name { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.pricing-price { font-size: 2.2rem; font-weight: 700; margin-bottom: 2px; }
.pricing-price span { font-size: 0.9rem; font-weight: 400; color: var(--text-dim); }
.pricing-desc { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 20px; }
.pricing-features { list-style: none; margin-bottom: 24px; }
.pricing-features li {
    font-size: 0.85rem;
    color: var(--text-dim);
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.pricing-features li::before {
    content: '\2713';
    color: var(--accent);
    margin-right: 8px;
    font-weight: 700;
}
.pricing-features li:last-child { border-bottom: none; }
.pricing-cta {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.15s;
    text-decoration: none;
    border: none;
}
.pricing-cta:hover { opacity: 0.85; }
.pricing-cta-primary { background: var(--accent); color: var(--bg); }
.pricing-cta-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text);
}
.pricing-cta-outline:hover { border-color: var(--accent); }
.pricing-note {
    font-size: 0.8rem;
    color: var(--text-dim);
    text-align: center;
    margin-top: 8px;
}

/* ── Signup form ─────────────────────────────────────── */

.signup-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 0;
}
.signup-key-display { text-align: center; }
.signup-key-display p { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 8px; }
.signup-key-display code {
    display: block;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-family: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.8rem;
    word-break: break-all;
    color: var(--accent);
    margin-bottom: 8px;
}
.signup-key-display .copy-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.15s;
}
.signup-key-display .copy-btn:hover { opacity: 0.85; }
.signup-key-display .redirect-msg { font-size: 0.8rem; color: var(--text-dim); margin-top: 10px; }
.signup-input {
    flex: 1;
    padding: 10px 14px;
    font-size: 0.9rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    outline: none;
}
.signup-input:focus { border-color: var(--accent); }
.signup-input::placeholder { color: #4b5563; }
.signup-result {
    margin-top: 12px;
    padding: 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    display: none;
}
.signup-result.success {
    display: block;
    background: rgba(59, 240, 160, 0.1);
    border: 1px solid var(--accent);
    color: var(--accent);
}
.signup-result.error {
    display: block;
    background: rgba(240, 122, 59, 0.1);
    border: 1px solid var(--orange);
    color: var(--orange);
}

/* ── Auth gate modal (Pro checkout) ──────────────────── */

.auth-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
}
.auth-overlay.visible { display: flex; }
.auth-modal {
    width: 90%;
    max-width: 420px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 32px 28px;
    text-align: center;
    position: relative;
}
.auth-modal-close {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 1.4rem;
    cursor: pointer;
}
.auth-modal-close:hover { color: var(--text); }
.auth-modal h3 { font-size: 1.1rem; margin-bottom: 6px; }
.auth-modal p { font-size: 0.85rem; color: var(--text-dim); margin-bottom: 16px; }
.auth-modal .signup-form { margin-bottom: 0; }
.auth-modal .signup-result { text-align: left; }
.auth-modal .auth-alt {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-dim);
}
.auth-modal .auth-alt a { color: var(--accent); cursor: pointer; text-decoration: none; }
.auth-modal .auth-alt a:hover { text-decoration: underline; }
.auth-key-input { display: none; margin-top: 10px; }
.auth-key-input.visible { display: flex; }

/* ── Footer ──────────────────────────────────────────── */

footer {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    border-top: 1px solid var(--border);
}
.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 64px 0 48px;
}
.footer-brand h3 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.footer-brand h3 img { width: 24px; height: 24px; }
.footer-brand .accent { color: var(--accent); }
.footer-brand p { font-size: 0.85rem; color: var(--text-dim); }
.footer-links { display: flex; gap: 24px; }
.footer-links a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.85rem;
}
.footer-links a:hover { color: var(--text); }
.terms-note {
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 8px;
    text-align: center;
}
.terms-note a { color: #6b7280; text-decoration: underline; }
.terms-note a:hover { color: var(--text-dim); }
.footer-bottom {
    display: flex;
    justify-content: space-between;
    padding: 32px 0 48px;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: #6b7280;
}

/* ── Mobile (shared responsive) ──────────────────────── */

@media (max-width: 768px) {
    html, body { overflow-x: hidden; }
    .top-nav {
        flex-wrap: wrap;
        height: auto;
        min-height: 56px;
        padding: 10px 16px;
    }
    .nav-hamburger { display: block; }
    .top-nav .nav-links {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 8px;
        padding: 12px 0 4px;
        order: 3;
        border-top: 1px solid var(--border);
        margin-top: 10px;
    }
    .top-nav.nav-open .nav-links { display: flex; }
    .top-nav .nav-auth {
        display: none;
        width: 100%;
        order: 4;
        padding: 8px 0 0;
    }
    .top-nav.nav-open .nav-auth { display: flex; }
    .pricing-grid { flex-direction: column; align-items: center; }
    .pricing-card { max-width: 100%; }
    .signup-form { flex-direction: column; }
    .footer-content { flex-direction: column; gap: 16px; }
    .footer-links { flex-wrap: wrap; gap: 16px; }
    .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}
