/* Stream API portal — FJ dark skin, palette lifted from the live site's CSS:
   body #1e222d / navbar #242d38 (pro.css, custom.css) with the FJ teal-blue
   accent family (#067aa1 links/buttons, #49a4cc light variant). No orange —
   FJ doesn't use it. Modernised: soft radii, hairline borders, real
   hover/focus states. Works with Bootstrap 5.3 data-bs-theme="dark". */

:root {
    --bg: #1e222d;            /* page — matches live body */
    --panel: #242d38;         /* cards, sidebar — matches live navbar */
    --panel-head: #2b3645;    /* card headers, table head */
    --inset: #171b24;         /* inputs, code, collapse wells */
    --line: #334050;          /* hairline borders */
    --text: #e8eaed;
    --muted: #98a1ac;
    --faint: #6c7683;
    --accent: #49a4cc;        /* FJ light blue — text/icon accent on dark */
    --accent-strong: #067aa1; /* FJ blue — buttons, borders (live .btn-dark-blue) */
    --accent-hover: #0c91be;
    --green: #3fb950;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    background-color: var(--bg);
    color: var(--text);
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* Top bar */
.navbar {
    background-color: var(--panel) !important;
    border-bottom: 1px solid var(--line);
    padding-top: .6rem;
    padding-bottom: .6rem;
}

.navbar-brand { color: #fff !important; font-size: 1.15rem; letter-spacing: .01em; }
.navbar-brand .brand-sub { color: var(--muted); font-weight: 400; font-size: .9rem; margin-left: 2px; }
.navbar-user { color: var(--muted); font-size: 13.5px; }

.portal-shell { min-height: calc(100vh - 57px); }

/* Side menu */
.side-menu {
    width: 220px;
    flex-shrink: 0;
    background-color: var(--panel);
    border-right: 1px solid var(--line);
    padding: 14px 10px;
}

.side-link {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
    margin-bottom: 2px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    border-radius: 8px;
    transition: background-color .12s ease, color .12s ease;
}

.side-link i { width: 16px; text-align: center; color: var(--faint); transition: color .12s ease; }

.side-link:hover { color: var(--text); background-color: var(--panel-head); text-decoration: none; }
.side-link:hover i { color: var(--muted); }

.side-link.active {
    color: var(--text);
    background-color: rgba(73, 164, 204, 0.12);
}
.side-link.active i { color: var(--accent); }

.portal-main { max-width: 1100px; }

/* Cards / panels */
.card {
    background-color: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--text);
}

.card-header {
    background-color: var(--panel-head);
    border-bottom: 1px solid var(--line);
    border-radius: 10px 10px 0 0 !important;
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.card-header i { color: var(--accent); }

/* Forms */
.form-control, .form-select {
    background-color: var(--inset);
    border-color: var(--line);
    color: var(--text);
    font-size: 14px;
    border-radius: 8px;
    padding: .45rem .7rem;
}

.form-control:focus, .form-select:focus {
    background-color: var(--inset);
    border-color: var(--accent-strong);
    color: var(--text);
    box-shadow: 0 0 0 3px rgba(6, 122, 161, 0.25);
}

.form-control::placeholder { color: var(--faint); }

.form-label { color: var(--muted); font-size: 12.5px; margin-bottom: 4px; }
.form-text { color: var(--faint); font-size: 12.5px; }

.btn { border-radius: 8px; }

.btn-fj {
    background-color: var(--accent-strong);
    border-color: var(--accent-strong);
    color: #fff;
    font-weight: 600;
}

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

.btn-outline-light { --bs-btn-color: var(--muted); --bs-btn-border-color: var(--line); }
.btn-outline-light:hover { background-color: var(--panel-head); border-color: var(--faint); color: var(--text); }

/* Tables */
.table {
    color: var(--text);
    font-size: 14px;
    --bs-table-bg: transparent;
    --bs-table-color: var(--text);
    --bs-table-border-color: var(--line);
    --bs-table-hover-bg: var(--panel-head);
    --bs-table-hover-color: var(--text);
    margin-bottom: 0;
}

.table thead th {
    color: var(--faint);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    background-color: var(--panel-head);
    border-bottom: 1px solid var(--line);
    padding-top: 9px;
    padding-bottom: 9px;
}

.table td { border-color: var(--line); padding-top: 11px; padding-bottom: 11px; }

/* Login */
.login-wrap {
    min-height: calc(100vh - 160px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card {
    width: 400px;
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

/* Plan banner */
.plan-badge {
    background-color: rgba(73, 164, 204, 0.12);
    border: 1px solid rgba(73, 164, 204, 0.5);
    color: var(--accent);
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* One-time key reveal */
.key-reveal {
    background-color: var(--inset);
    border: 1px dashed var(--accent-strong);
    border-radius: 8px;
    padding: 11px 13px;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    word-break: break-all;
    color: var(--green);
}

/* Alerts — keep Bootstrap's dark variants but square them with the panel look */
.alert { border-radius: 10px; }

/* Badges in the restrictions column */
.badge.text-bg-dark {
    background-color: var(--panel-head) !important;
    border: 1px solid var(--line);
    color: var(--muted) !important;
    font-weight: 500;
}

/* Inline edit well under a key row */
.key-edit-well { background-color: var(--inset); }

/* Docs */
.docs pre {
    background-color: var(--inset);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 13px 15px;
    color: #d6dde4;
    font-size: 13.5px;
    overflow-x: auto;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: var(--panel-head);
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 6px;
    font-size: 11px;
    padding: 3px 10px;
    opacity: 0;
    transition: opacity .12s ease;
}

.docs pre:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--faint); }

.docs code { color: var(--accent); font-size: 13.5px; }
.docs pre code { color: #d6dde4; }

.docs h2 { font-size: 1.35rem; color: var(--text); margin-top: 2rem; }
.docs h3 { font-size: 1.05rem; color: var(--accent); margin-top: 1.3rem; }
.docs p, .docs li { color: #c3cad2; }
.docs .table { font-size: 13.5px; }

/* Landing */
.landing { max-width: 880px; margin: 0 auto; }

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

.hero h1 {
    font-size: 2.9rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.15;
    color: var(--text);
}

.hero-accent { color: var(--accent); }

.hero-sub {
    color: var(--muted);
    font-size: 1.12rem;
    max-width: 640px;
    margin: 16px auto 0;
}

.hero-ctas { display: flex; gap: 12px; justify-content: center; margin-top: 26px; flex-wrap: wrap; }
.hero-ctas .btn-lg { font-size: 1rem; padding: .65rem 1.3rem; }

.feature-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 8px;
}
.feature-title i { color: var(--accent); }

/* Key prefix in the keys table */
.key-prefix {
    background-color: var(--inset);
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 2px 7px;
    color: var(--muted);
    font-size: 13px;
}

/* Current-plan row highlight */
.plan-current td { background-color: rgba(73, 164, 204, 0.07); }

/* Scrollbar */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

/* Mobile: the fixed-width sidebar would crush the content column, so it
   becomes a horizontal tab strip under the navbar instead. */
@media (max-width: 767.98px) {
    .portal-shell { flex-direction: column; }

    .side-menu {
        width: 100%;
        display: flex;
        flex-direction: row;
        gap: 6px;
        padding: 8px 12px;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        overflow-x: auto;
    }

    .side-link { margin-bottom: 0; white-space: nowrap; padding: 7px 12px; }

    .portal-main { padding: 1rem !important; }

    .navbar-user { display: none; }   /* email crowds the bar on a phone */

    .hero { padding: 26px 0 16px; }
    .hero h1 { font-size: 1.85rem; }
    .hero-sub { font-size: 1rem; }
    .hero-ctas { flex-direction: column; align-items: stretch; }

    .login-wrap { align-items: flex-start; padding-top: 40px; }
    .login-card { width: 100%; max-width: 420px; }
}
