/* ===== PennyHelm Landing & Login Pages ===== */

:root {
    --bg-primary: #0f1117;
    --bg-secondary: #1a1d27;
    --bg-card: #222636;
    --bg-card-hover: #2a2f42;
    --bg-input: #181b25;
    --border: #2e3348;
    --text-primary: #e8eaed;
    --text-secondary: #9aa0b0;
    --text-muted: #6b7185;
    --accent: #4f8cff;
    --accent-hover: #3a75e6;
    --accent-bg: rgba(79, 140, 255, 0.12);
    --green: #34d399;
    --green-bg: rgba(52, 211, 153, 0.12);
    --red: #f87171;
    --red-bg: rgba(248, 113, 113, 0.12);
    --orange: #fb923c;
    --orange-bg: rgba(251, 146, 60, 0.12);
    --yellow: #fbbf24;
    --yellow-bg: rgba(251, 191, 36, 0.12);
    --purple: #a78bfa;
    --purple-bg: rgba(167, 139, 250, 0.12);
    --blue: #60a5fa;
    --blue-bg: rgba(96, 165, 250, 0.12);
    --cyan: #22d3ee;
    --cyan-bg: rgba(34, 211, 238, 0.12);
    --pink: #ec4899;
    --pink-bg: rgba(236, 72, 153, 0.12);
    --modal-overlay: rgba(0, 0, 0, 0.6);
    --radius: 10px;
    --radius-sm: 6px;
}

/* ===== Light Theme ===== */
[data-theme="light"] {
    --bg-primary: #f5f6f8;
    --bg-secondary: #ebedf2;
    --bg-card: #ffffff;
    --bg-card-hover: #f0f1f5;
    --bg-input: #ffffff;
    --border: #d5d9e2;
    --text-primary: #1a1d27;
    --text-secondary: #5a6174;
    --text-muted: #8890a4;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-bg: rgba(37, 99, 235, 0.08);
    --green: #059669;
    --green-bg: rgba(5, 150, 105, 0.08);
    --red: #dc2626;
    --red-bg: rgba(220, 38, 38, 0.08);
    --orange: #d97706;
    --orange-bg: rgba(217, 119, 6, 0.08);
    --yellow: #b45309;
    --yellow-bg: rgba(180, 83, 9, 0.08);
    --purple: #7c3aed;
    --purple-bg: rgba(124, 58, 237, 0.08);
    --blue: #2563eb;
    --blue-bg: rgba(37, 99, 235, 0.08);
    --cyan: #0891b2;
    --cyan-bg: rgba(8, 145, 178, 0.08);
    --pink: #be185d;
    --pink-bg: rgba(190, 24, 93, 0.08);
    --modal-overlay: rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme]) {
        --bg-primary: #f5f6f8;
        --bg-secondary: #ebedf2;
        --bg-card: #ffffff;
        --bg-card-hover: #f0f1f5;
        --bg-input: #ffffff;
        --border: #d5d9e2;
        --text-primary: #1a1d27;
        --text-secondary: #5a6174;
        --text-muted: #8890a4;
        --accent: #2563eb;
        --accent-hover: #1d4ed8;
        --accent-bg: rgba(37, 99, 235, 0.08);
        --green: #059669;
        --green-bg: rgba(5, 150, 105, 0.08);
        --red: #dc2626;
        --red-bg: rgba(220, 38, 38, 0.08);
        --orange: #d97706;
        --orange-bg: rgba(217, 119, 6, 0.08);
        --yellow: #b45309;
        --yellow-bg: rgba(180, 83, 9, 0.08);
        --purple: #7c3aed;
        --purple-bg: rgba(124, 58, 237, 0.08);
        --blue: #2563eb;
        --blue-bg: rgba(37, 99, 235, 0.08);
        --cyan: #0891b2;
        --cyan-bg: rgba(8, 145, 178, 0.08);
        --pink: #be185d;
        --pink-bg: rgba(190, 24, 93, 0.08);
        --modal-overlay: rgba(0, 0, 0, 0.4);
    }
}

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

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== Navigation ===== */
.landing-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 17, 23, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}

.landing-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.landing-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-primary);
}

.logo-mark {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.landing-logo .logo-text {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.landing-nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.landing-nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    transition: color 0.15s;
}

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

.nav-btn {
    background: var(--accent) !important;
    color: #fff !important;
    font-weight: 600 !important;
    border-radius: var(--radius-sm) !important;
    transition: background 0.15s !important;
}

.nav-btn:hover {
    background: var(--accent-hover) !important;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 32px 80px;
    overflow: hidden;
}

.hero-glow {
    position: absolute;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(79, 140, 255, 0.12) 0%, rgba(124, 58, 237, 0.06) 40%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 720px;
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    margin-bottom: 24px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent), #a78bfa, var(--cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 560px;
    margin: 0 auto 40px;
    line-height: 1.7;
}

.hero-ctas {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius);
    transition: all 0.15s ease;
    cursor: pointer;
    border: none;
    font-family: inherit;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 16px;
    min-width: 200px;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(79, 140, 255, 0.25);
}

.btn-ghost {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    background: var(--bg-card);
    border-color: var(--text-muted);
}

.btn-block {
    display: flex;
    width: 100%;
    justify-content: center;
}

.btn-sub {
    font-size: 12px;
    font-weight: 400;
    opacity: 0.75;
    margin-top: 2px;
}

/* ===== Sections ===== */
.section-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 48px;
}

/* ===== Features ===== */
.features {
    padding: 100px 0;
    border-top: 1px solid var(--border);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    transition: all 0.2s ease;
}

.feature-card:hover {
    border-color: var(--text-muted);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.feature-icon.blue { background: rgba(79, 140, 255, 0.12); color: var(--accent); }
.feature-icon.green { background: var(--green-bg); color: var(--green); }
.feature-icon.purple { background: var(--purple-bg); color: var(--purple); }
.feature-icon.cyan { background: var(--cyan-bg); color: var(--cyan); }
.feature-icon.red { background: var(--red-bg); color: var(--red); }
.feature-icon.orange { background: var(--orange-bg); color: var(--orange); }

.feature-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

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

/* ===== Pricing / Path Cards ===== */
.pricing {
    padding: 100px 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.path-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.path-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 36px 32px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.path-card.featured {
    border-color: var(--accent);
    box-shadow: 0 0 40px rgba(79, 140, 255, 0.1);
}

.path-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 16px;
    border-radius: 20px;
    white-space: nowrap;
}

.path-header {
    text-align: center;
    margin-bottom: 24px;
}

.path-header h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.path-price {
    font-size: 2.5rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.path-price span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.path-trial {
    font-size: 0.85rem;
    color: var(--green);
    font-weight: 600;
    margin-top: 8px;
}

/* Billing toggle */
.billing-toggle {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 32px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
}

.toggle-btn {
    flex: 1;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.toggle-btn.active {
    background: var(--accent);
    color: #fff;
}

.toggle-btn:hover:not(.active) {
    color: var(--text-primary);
}

.toggle-save {
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(16, 185, 129, 0.15);
    color: var(--green);
    padding: 2px 6px;
    border-radius: 4px;
}

.toggle-btn.active .toggle-save {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Promo badge */
.promo-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, rgba(79, 140, 255, 0.15), rgba(124, 58, 237, 0.15));
    color: var(--accent);
    border: 1px solid rgba(79, 140, 255, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 8px;
}

/* Price detail / subtext */
.path-price-detail {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.path-price-after {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: 4px;
    opacity: 0.7;
}

.path-features {
    list-style: none;
    flex: 1;
    margin-bottom: 24px;
}

.path-features li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.path-features li svg {
    color: var(--green);
    flex-shrink: 0;
}

/* ===== Self-Host Section ===== */
.selfhost {
    padding: 100px 0;
}

.steps {
    display: flex;
    gap: 24px;
    justify-content: center;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.step {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    min-width: 250px;
    max-width: 340px;
}

.step-number {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--accent), #7c3aed);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #fff;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.step-content code {
    display: block;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
    color: var(--accent);
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    word-break: break-all;
}

.steps-note {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.steps-note strong {
    color: var(--accent);
}

/* ===== Footer ===== */
.landing-footer {
    border-top: 1px solid var(--border);
    padding: 32px 0;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 15px;
}

.footer-brand .logo-mark {
    width: 28px;
    height: 28px;
    font-size: 11px;
    border-radius: 7px;
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.15s;
}

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

.footer-copy {
    color: var(--text-muted);
    font-size: 13px;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 100px 32px 60px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 420px;
}

.login-card h1 {
    font-size: 1.6rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 6px;
}

.login-card > p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

.auth-tabs {
    display: flex;
    background: var(--bg-input);
    border-radius: var(--radius-sm);
    padding: 3px;
    margin-bottom: 24px;
}

.auth-tab {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.15s;
    font-family: inherit;
}

.auth-tab.active {
    background: var(--bg-card);
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.15s;
    outline: none;
}

.form-input:focus {
    border-color: var(--accent);
}

.auth-error {
    color: var(--red);
    font-size: 13px;
    margin-bottom: 12px;
    min-height: 18px;
}

.btn-auth {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

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

.btn-auth:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    gap: 16px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

.auth-divider span {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.btn-google {
    width: 100%;
    padding: 12px;
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.15s;
    font-family: inherit;
}

.btn-google:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}

.auth-footer-text {
    text-align: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 24px;
}

/* ===== Spinner ===== */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ===== Mobile Responsive ===== */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: block;
    }

    .landing-nav-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        flex-direction: column;
        padding: 12px 16px;
    }

    .landing-nav-links.open {
        display: flex;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

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

    .hero-ctas {
        flex-direction: column;
        align-items: center;
    }

    .btn-lg {
        min-width: 260px;
    }

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

    .path-cards {
        grid-template-columns: 1fr;
    }

    .steps {
        flex-direction: column;
        align-items: center;
    }

    .step {
        max-width: 100%;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }

    .login-card {
        padding: 28px 24px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 100px 20px 60px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .section-title {
        font-size: 1.6rem;
    }
}

/* ===== Mobile Password Modal ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.95) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-content h2 {
    font-size: 1.4rem;
    margin-bottom: 12px;
}

.modal-content > p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}

.credentials-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.credential-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    flex-wrap: wrap;
}

.credential-row:not(:last-child) {
    border-bottom: 1px solid var(--border);
}

.credential-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 70px;
    text-align: left;
}

.credential-value {
    flex: 1;
    font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;
    font-size: 14px;
    color: var(--accent);
    word-break: break-all;
    text-align: left;
}

.btn-copy {
    padding: 4px 10px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-copy:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.modal-note {
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 20px;
}

.btn-modal-close {
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.btn-modal-close:hover {
    background: var(--accent-hover);
}
