﻿/* LicenseHub Portal — dark theme (same variables as Admin) */

:root {
    --bg:        #0f1117;
    --bg-card:   #181c25;
    --bg-hover:  #1e2330;
    --bg-input:  #1a1f2b;
    --border:    #2c3347;
    --text:      #e2e8f0;
    --text-dim:  #8892a4;
    --accent:    #6366f1;
    --green:     #22c55e;
    --red:       #ef4444;
    --radius:    6px;
    --mono:      "JetBrains Mono", "Fira Code", monospace;
    --sans:      "Inter", system-ui, sans-serif;
}

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

body { background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; line-height: 1.5; }

.portal-root { display: flex; min-height: 100vh; }

.portal-sidebar {
    width: 220px; background: var(--bg-card);
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    padding: 16px 12px; gap: 4px; flex-shrink: 0;
}

.sidebar-brand { font-weight: 700; font-size: 15px; color: var(--accent); padding: 8px 4px 12px; }
.sidebar-divider { border: none; border-top: 1px solid var(--border); margin: 8px 0; }

.portal-sidebar a { display: block; padding: 7px 10px; border-radius: var(--radius); color: var(--text-dim); text-decoration: none; transition: background .15s; }
.portal-sidebar a:hover, .portal-sidebar a.active { background: var(--bg-hover); color: var(--text); }

.portal-main { flex: 1; padding: 28px 32px; overflow-y: auto; }
.portal-main h1 { font-size: 20px; font-weight: 700; margin-bottom: 20px; }

.empty-layout { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }

/* .login-card and .login-card h1 are now in the "Login page" section below */

.stats-row { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; min-width: 220px; }

.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th, .data-table td { padding: 8px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.data-table th { color: var(--text-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.data-table tr:hover td { background: var(--bg-hover); }

.toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.row-actions { display: flex; align-items: center; gap: 6px; }

.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius); border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-size: 13px; cursor: pointer; transition: background .15s; text-decoration: none; }
.btn:hover { background: var(--bg-hover); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #4f46e5; }
.btn-danger { color: var(--red); border-color: var(--red); }
.btn-danger:hover { background: rgba(239,68,68,.15); }
.btn-small { padding: 4px 10px; font-size: 12px; }

.input, input[type=text], input[type=email], input[type=password], input[type=number], select {
    display: block; width: 100%; padding: 7px 10px;
    background: var(--bg-input); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text); font-size: 13px; outline: none;
}
.input:focus, input:focus { border-color: var(--accent); }
label { display: block; font-size: 12px; color: var(--text-dim); margin-bottom: 4px; margin-top: 12px; }

.badge { display: inline-block; padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600; text-transform: uppercase; }
.badge-active { background: rgba(34,197,94,.15); color: var(--green); }
.badge-idle   { background: rgba(148,163,184,.1); color: var(--text-dim); }

.alert-ok    { background: rgba(34,197,94,.1); border: 1px solid var(--green); color: var(--green); padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; }
.alert-error { background: rgba(239,68,68,.1); border: 1px solid var(--red);   color: var(--red);   padding: 8px 12px; border-radius: var(--radius); margin-bottom: 12px; }

.panel { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 20px; }
.panel > summary { padding: 10px 14px; cursor: pointer; font-weight: 600; font-size: 13px; user-select: none; }
.panel-body { padding: 12px 14px 16px; border-top: 1px solid var(--border); }

/* ── Plans grid ──────────────────────────────────────────────────────────── */
.plans-grid { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 16px; }
.plan-card {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 24px; display: flex; flex-direction: column; gap: 10px;
    min-width: 240px; max-width: 320px; flex: 1;
}
.plan-card:hover { border-color: var(--accent); }
.plan-name  { font-size: 18px; font-weight: 700; }
.plan-desc  { font-size: 13px; color: var(--text-dim); }
.plan-price { font-size: 22px; font-weight: 700; color: var(--accent); }
.plan-period { font-size: 13px; font-weight: 400; color: var(--text-dim); }
.plan-features { margin: 4px 0 12px 0; padding-left: 18px; font-size: 13px; color: var(--text-dim); line-height: 1.8; }

code { font-family: var(--mono); font-size: 12px; }

#blazor-error-ui {
    background: lightyellow; bottom: 0; box-shadow: 0 -1px 2px rgba(0,0,0,.2);
    display: none; left: 0; padding: 0.6rem 1.25rem 0.7rem;
    position: fixed; width: 100%; z-index: 1000;
}

/* ═══════════════════════════════════════════════════════════════════════
   PUBLIC MARKETING SITE
   Used by PublicLayout + public pages (Home, Pricing, HowItWorks, etc.)
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Public layout ───────────────────────────────────────────────────── */
.public-layout { display: flex; flex-direction: column; min-height: 100vh; background: var(--bg); }

/* ── Top navbar ──────────────────────────────────────────────────────── */
.pub-nav {
    position: sticky; top: 0; z-index: 100;
    background: rgba(15,17,23,.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    display: flex; align-items: center; gap: 0;
    padding: 0 32px; height: 56px;
}
.pub-nav-brand {
    font-size: 16px; font-weight: 700; color: var(--text); text-decoration: none;
    margin-right: 40px; white-space: nowrap; display: flex; align-items: center; gap: 4px;
}
.pub-nav-brand em { color: var(--accent); font-style: normal; }
.pub-nav-links { display: flex; align-items: center; gap: 4px; flex: 1; }
.pub-nav-links a {
    padding: 6px 12px; border-radius: var(--radius); color: var(--text-dim);
    text-decoration: none; font-size: 14px; transition: color .15s, background .15s;
}
.pub-nav-links a:hover, .pub-nav-links a.active { color: var(--text); background: var(--bg-hover); }
.pub-nav-actions { display: flex; align-items: center; gap: 8px; }
.pub-nav-actions a { font-size: 13px; }

/* ── Page content wrapper ────────────────────────────────────────────── */
.pub-content { flex: 1; }

/* ── Section ─────────────────────────────────────────────────────────── */
.section { padding: 80px 32px; max-width: 1100px; margin: 0 auto; }
.section-sm { padding: 56px 32px; max-width: 1100px; margin: 0 auto; }
.section-full { padding: 80px 32px; }
.section-center { text-align: center; }

.section-label {
    display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.section-title {
    font-size: 36px; font-weight: 800; color: var(--text);
    line-height: 1.2; margin-bottom: 16px;
}
.section-title span { color: var(--accent); }
.section-subtitle { font-size: 17px; color: var(--text-dim); line-height: 1.6; max-width: 620px; margin: 0 auto; }
.section-center .section-subtitle { margin: 0 auto; }

/* ── Hero ────────────────────────────────────────────────────────────── */
.hero {
    padding: 100px 32px 80px;
    background: radial-gradient(ellipse 80% 50% at 50% -10%, rgba(99,102,241,.18) 0%, transparent 70%);
    text-align: center;
}
.hero .section-title { font-size: 52px; max-width: 800px; margin: 0 auto 20px; }
.hero .section-subtitle { font-size: 19px; }
.hero-actions { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-chips { margin-top: 40px; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.hero-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 20px; padding: 4px 14px; font-size: 12px; color: var(--text-dim);
}

/* ── Buttons (public, larger) ────────────────────────────────────────── */
.btn-lg {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 12px 24px; border-radius: var(--radius); font-size: 15px; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: all .15s; border: 1px solid transparent;
}
.btn-lg.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-lg.primary:hover { background: #4f46e5; }
.btn-lg.ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-lg.ghost:hover { background: var(--bg-hover); }

/* ── Feature grid ────────────────────────────────────────────────────── */
.feature-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: border-color .2s;
}
.feature-card:hover { border-color: var(--accent); }
.feature-icon { font-size: 28px; margin-bottom: 14px; display: block; }
.feature-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.feature-desc { font-size: 14px; color: var(--text-dim); line-height: 1.6; }

/* ── Steps ───────────────────────────────────────────────────────────── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; position: relative; }
.step-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 28px 24px; }
.step-num { font-size: 11px; font-weight: 700; color: var(--accent); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.step-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.step-desc { font-size: 14px; color: var(--text-dim); line-height: 1.6; }

/* ── Pricing ─────────────────────────────────────────────────────────── */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: start; }
.pricing-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px 28px; display: flex; flex-direction: column; gap: 8px;
}
.pricing-card.featured {
    border-color: var(--accent);
    background: linear-gradient(to bottom, rgba(99,102,241,.08), var(--bg-card));
}
.pricing-tier { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-dim); }
.pricing-name { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.pricing-price { font-size: 38px; font-weight: 800; color: var(--accent); line-height: 1; }
.pricing-price sup { font-size: 20px; vertical-align: super; }
.pricing-price sub { font-size: 15px; font-weight: 400; color: var(--text-dim); }
.pricing-desc { font-size: 14px; color: var(--text-dim); line-height: 1.5; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.pricing-features { list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; color: var(--text-dim); flex: 1; margin-bottom: 24px; }
.pricing-features li::before { content: "✓ "; color: var(--green); font-weight: 700; }
.pricing-features li.no::before { content: "✗ "; color: var(--red); }
.pricing-tag {
    display: inline-block; background: var(--accent); color: #fff;
    font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 12px;
    text-transform: uppercase; letter-spacing: .06em; margin-bottom: 8px;
}
.pricing-contact { font-size: 13px; color: var(--text-dim); text-align: center; margin-top: 8px; }

/* ── Comparison table ────────────────────────────────────────────────── */
.comparison-table { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 32px; }
.comparison-table th, .comparison-table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.comparison-table th { background: var(--bg-card); font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-dim); }
.comparison-table th:first-child, .comparison-table td:first-child { color: var(--text); font-weight: 500; }
.comparison-table td:not(:first-child) { text-align: center; }
.comparison-table tr:hover td { background: var(--bg-hover); }
.comparison-table .yes { color: var(--green); font-weight: 700; }
.comparison-table .no  { color: var(--text-dim); }
.comparison-table .col-header { text-align: center !important; }

/* ── FAQ ─────────────────────────────────────────────────────────────── */
.faq { display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); }
.faq-item summary {
    padding: 16px 20px; cursor: pointer; font-weight: 600; font-size: 15px;
    list-style: none; display: flex; align-items: center; justify-content: space-between;
    user-select: none;
}
.faq-item summary::after { content: "+"; font-size: 20px; color: var(--text-dim); flex-shrink: 0; }
.faq-item[open] summary::after { content: "−"; color: var(--accent); }
.faq-item[open] summary { color: var(--accent); }
.faq-body { padding: 0 20px 20px; font-size: 14px; color: var(--text-dim); line-height: 1.7; }
.faq-body p + p { margin-top: 10px; }
.faq-body a { color: var(--accent); text-decoration: none; }
.faq-body code { background: var(--bg-input); padding: 2px 6px; border-radius: 4px; font-family: var(--mono); font-size: 12px; color: var(--text); }

/* ── Code block ──────────────────────────────────────────────────────── */
.code-block {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 20px 24px; font-family: var(--mono); font-size: 13px; line-height: 1.8;
    overflow-x: auto; white-space: pre; color: var(--text);
}
.code-block .comment { color: var(--text-dim); }
.code-block .key { color: #7dd3fc; }
.code-block .val { color: #86efac; }
.code-block .cmd { color: var(--accent); }

/* ── Install steps ───────────────────────────────────────────────────── */
.install-steps { display: flex; flex-direction: column; gap: 32px; }
.install-step { display: flex; gap: 24px; }
.install-step-num {
    flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
    background: var(--accent); color: #fff; font-weight: 800; font-size: 16px;
    display: flex; align-items: center; justify-content: center;
}
.install-step-body { flex: 1; }
.install-step-title { font-size: 16px; font-weight: 700; margin-bottom: 8px; }
.install-step-desc { font-size: 14px; color: var(--text-dim); line-height: 1.6; margin-bottom: 12px; }

/* ── CTA banner ──────────────────────────────────────────────────────── */
.cta-banner {
    background: linear-gradient(135deg, rgba(99,102,241,.15) 0%, rgba(99,102,241,.05) 100%);
    border: 1px solid rgba(99,102,241,.3); border-radius: 12px;
    padding: 56px 40px; text-align: center;
    display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.cta-banner h2 { font-size: 30px; font-weight: 800; }
.cta-banner p { font-size: 16px; color: var(--text-dim); max-width: 520px; line-height: 1.6; }

/* ── Divider ─────────────────────────────────────────────────────────── */
.pub-divider { border: none; border-top: 1px solid var(--border); }

/* ── Footer ──────────────────────────────────────────────────────────── */
.pub-footer {
    border-top: 1px solid var(--border); padding: 32px;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.pub-footer-brand { font-size: 14px; font-weight: 700; color: var(--text-dim); }
.pub-footer-brand em { color: var(--accent); font-style: normal; }
.pub-footer-links { display: flex; gap: 20px; }
.pub-footer-links a { font-size: 13px; color: var(--text-dim); text-decoration: none; }
.pub-footer-links a:hover { color: var(--text); }
.pub-footer-copy { font-size: 12px; color: var(--text-dim); }

/* ── Highlighted note ────────────────────────────────────────────────── */
.note {
    display: flex; gap: 12px; padding: 14px 18px; border-radius: var(--radius);
    background: rgba(99,102,241,.08); border: 1px solid rgba(99,102,241,.25);
    font-size: 14px; color: var(--text-dim); line-height: 1.6;
}
.note-icon { flex-shrink: 0; font-size: 18px; }

/* ── Login page (within public layout) ──────────────────────────────── */
.login-section {
    display: flex; justify-content: center; align-items: flex-start;
    padding: 72px 24px 96px;
}
.login-card {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: 10px; padding: 44px 40px;
    width: 100%; max-width: 440px;
    display: flex; flex-direction: column; gap: 0;
}
.login-card-header { margin-bottom: 28px; }
.login-card-header h1 { font-size: 22px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.login-card-sub { font-size: 14px; color: var(--text-dim); margin: 0; line-height: 1.5; }
.login-alert { margin-bottom: 20px; }
.form-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 18px; }
.form-field label { font-size: 13px; font-weight: 500; color: var(--text-dim); margin: 0; }
.form-field .input,
.form-field input { padding: 10px 12px; font-size: 14px; }
.login-submit {
    width: 100%; justify-content: center;
    padding: 12px 20px; font-size: 15px; font-weight: 600;
    margin-top: 4px; margin-bottom: 0;
}
.login-switch {
    text-align: center; font-size: 13px; color: var(--text-dim);
    margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border);
}
.login-switch-btn {
    background: none; border: none; padding: 0; margin-left: 4px;
    color: var(--accent); font-size: 13px; font-weight: 600;
    cursor: pointer; text-decoration: underline;
    text-underline-offset: 3px;
}
.login-switch-btn:hover { color: #818cf8; }

/* ── Portal sub-nav (management section) ─────────────────────────────── */
.portal-subnav {
    background: var(--bg-card); border-bottom: 1px solid var(--border);
    display: flex; gap: 0; padding: 0 32px;
}
.portal-subnav a {
    display: inline-block; padding: 14px 18px;
    font-size: 13px; font-weight: 600; color: var(--text-dim);
    text-decoration: none; border-bottom: 2px solid transparent;
    margin-bottom: -1px; transition: color .15s, border-color .15s;
}
.portal-subnav a:hover { color: var(--text); }
.portal-subnav a.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Portal section (management content area) ────────────────────────── */
.portal-section { max-width: 1100px; margin: 0 auto; padding: 40px 32px; }
.portal-section h1 { font-size: 22px; font-weight: 700; margin-bottom: 24px; color: var(--text); }
.portal-section h2 { font-size: 17px; font-weight: 700; margin: 28px 0 16px; color: var(--text); }

/* ── Responsive ──────────────────────────────────────────────────────── */

/* Hamburger button — hidden on desktop, shown on mobile */
.pub-nav-hamburger {
    display: none;
    align-items: center; justify-content: center;
    background: none; border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text);
    width: 36px; height: 36px; cursor: pointer;
    font-size: 18px; flex-shrink: 0; margin-left: 8px;
}
.pub-nav-hamburger:hover { background: var(--bg-hover); }

@media (max-width: 900px) {
    .feature-grid, .steps, .pricing-grid { grid-template-columns: 1fr; }
    .hero .section-title { font-size: 36px; }
    .section, .section-sm { padding: 56px 20px; }
    .pub-nav { padding: 0 20px; }
    .pub-nav-links a { padding: 6px 8px; }
    .cta-banner { padding: 40px 24px; }
    .comparison-table { font-size: 12px; }
    .comparison-table th, .comparison-table td { padding: 8px 10px; }
    .plans-grid { flex-direction: column; }
    .plan-card { min-width: 0; max-width: 100%; }
}

@media (max-width: 768px) {
    /* ── Mobile nav ── */
    .pub-nav {
        flex-wrap: wrap;
        height: auto;
        padding: 0 16px;
    }
    .pub-nav-brand { padding: 14px 0; flex: 1; }
    .pub-nav-hamburger { display: flex; }

    .pub-nav-links {
        display: none;
        flex-direction: column;
        width: 100%;
        border-top: 1px solid var(--border);
        padding: 8px 0;
        order: 3;
    }
    .pub-nav.nav-open .pub-nav-links { display: flex; }
    .pub-nav-links a { padding: 10px 8px; font-size: 15px; width: 100%; }

    .pub-nav-actions {
        display: none;
        flex-direction: column;
        width: 100%;
        padding: 8px 0 16px;
        gap: 8px;
        order: 4;
        border-top: 1px solid var(--border);
    }
    .pub-nav.nav-open .pub-nav-actions { display: flex; }
    .pub-nav-actions a,
    .pub-nav-actions button { width: 100%; justify-content: center; text-align: center; box-sizing: border-box; }

    /* ── Portal sub-nav scrollable ── */
    .portal-subnav { overflow-x: auto; padding: 0 16px; }
    .portal-subnav a { white-space: nowrap; }

    /* ── Portal section ── */
    .portal-section { padding: 24px 16px; }

    /* ── Data table horizontal scroll ── */
    .data-table-wrap { overflow-x: auto; }

    /* ── Hero ── */
    .hero { padding: 60px 20px 48px; }
    .hero .section-title { font-size: 30px; }
    .hero .section-subtitle { font-size: 16px; }

    /* ── Login ── */
    .login-section { padding: 40px 16px 60px; }
    .login-card { padding: 28px 20px; }

    /* ── Footer ── */
    .pub-footer { padding: 24px 20px; flex-direction: column; align-items: flex-start; }
    .pub-footer-links { flex-wrap: wrap; gap: 12px; }

    /* ── CTA ── */
    .cta-banner { padding: 32px 20px; }
    .cta-banner h2 { font-size: 22px; }
}

@media (max-width: 480px) {
    .hero .section-title { font-size: 26px; }
    .hero .section-subtitle { font-size: 15px; }
    .section, .section-sm { padding: 40px 16px; }
    .section-title { font-size: 26px; }
    .stats-row { flex-direction: column; }
    .stat-card { min-width: 0; }
    .btn-lg { padding: 10px 18px; font-size: 14px; }
    .pricing-price { font-size: 30px; }
    .portal-section { padding: 16px 12px; }
}
