/**
 * developer-portal.css — the developer portal: its sign-in screens
 * (Developerlogin) and its pages (controllers/developer/*), all on
 * template_developer.
 *
 * Loaded through $extra_css by Developerlogin::_render(), developer/Home and
 * developer/Activity.
 *
 * ⚠ ONLY WHAT THE SHARED COMPONENTS DO NOT GIVE (§10). Cards are .card, lists
 *   of statuses are .badge-pill, the grid is Bootstrap's — nothing here
 *   restates any of that.
 *
 * ⚠ EVERY COLOUR IS A TOKEN (style.css §1–3), so light and dark both work. The
 *   fixed colours are the QR code's white tile — a code an authenticator app
 *   reads from a camera has to be dark on light whatever the theme — and white
 *   text on the brand fill of an active tab, as style.css's .btn-brand has.
 */

/* ── the shell ─────────────────────────────────────────────────────────── */

body.devportal-page {
    min-height: 100vh;
    background: var(--bg-mid);
    background-image:
        radial-gradient(1200px 600px at 50% -10%, var(--bg-top), transparent 70%),
        linear-gradient(180deg, var(--bg-mid), var(--bg-bot));
    background-attachment: fixed;
    color: var(--text);
    display: flex;
    flex-direction: column;
}

.devportal-frame {
    width: 100%;
    max-width: 64rem;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.devportal-skip:focus {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    z-index: 10;
    padding: 0.5rem 0.75rem;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

.devportal-masthead {
    flex-shrink: 0;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.devportal-masthead-icon { color: var(--c-purple); }
.devportal-brand { font-weight: 700; }
.devportal-masthead-sub { color: var(--muted); font-size: 0.9rem; }
.devportal-who { color: var(--muted); }

.devportal-shell {
    flex: 1 0 auto;
    padding-top: 2rem;
    padding-bottom: 2.5rem;
}

.devportal-shell:focus { outline: none; }

.devportal-footer {
    flex-shrink: 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.85rem;
}

/* ── the sign-in screens ───────────────────────────────────────────────── */

/* One narrow card, centred — a form, not a page of content. */
.devportal-card {
    max-width: 30rem;
}

/* Links are underlined, not only coloured (WCAG 1.4.1): style.css sets `a`
   to the muted colour app-wide, which on these screens reads as body text. */
.devportal-page main a:not(.btn) {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.devportal-list {
    padding-left: 0;
    list-style: none;
}

.devportal-list li {
    margin-bottom: 0.25rem;
}

/* The QR code an authenticator app scans. White on purpose in both themes:
   a camera reads dark-on-light, and a dark tile behind the code fails. */
.devportal-qr {
    display: inline-block;
    min-width: 196px;
    min-height: 196px;
    padding: 8px;
    border-radius: 8px;
    background: #ffffff;
}

.devportal-qr:empty::after {
    content: "Use the key below if the code does not appear.";
    display: block;
    max-width: 180px;
    padding-top: 70px;
    color: #475569;
    font-size: 0.8rem;
}

/* A key and an account name are read character by character, so they are set
   where 0/O and 1/l differ, and allowed to wrap rather than widen the page. */
.devportal-mono {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    overflow-wrap: anywhere;
}

.devportal-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.25rem;
    letter-spacing: 0.2em;
    text-align: center;
}

/* ── the portal pages ──────────────────────────────────────────────────── */

.devportal-integration-icon {
    width: 1.25rem;
    text-align: center;
    color: var(--c-purple);
}

.devportal-me dt {
    color: var(--muted);
    font-weight: 600;
}

/* ── activity (developer/Activity) ─────────────────────────────────────── */

/* The account's page tabs and the preset periods: Bootstrap pills, with the
   active one in the brand colour rather than Bootstrap's fixed blue. */
.devportal-tabs .nav-link,
.devportal-periods .nav-link {
    color: var(--text);
    border: 1px solid var(--border);
}

.devportal-tabs .nav-link.active,
.devportal-periods .nav-link.active {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.devportal-tabs .nav-link:focus-visible,
.devportal-periods .nav-link:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

/* An outcome's count carries its colour as a rule down the card's edge, beside
   the word and the icon — never the colour alone. */
.devportal-outcome { border-left: 4px solid var(--border); }
.devportal-outcome-answered { border-left-color: var(--c-green); }
.devportal-outcome-refused  { border-left-color: var(--c-amber); }
.devportal-outcome-failed   { border-left-color: var(--c-red); }
.devportal-outcome-answered .stat-card-label i { color: var(--c-green); }
.devportal-outcome-refused  .stat-card-label i { color: var(--c-amber); }
.devportal-outcome-failed   .stat-card-label i { color: var(--c-red); }

.devportal-chart {
    position: relative;
    height: 15rem;
}

.devportal-count {
    min-width: 2.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.devportal-facts dt {
    color: var(--muted);
    font-weight: 600;
}

.devportal-wrap { overflow-wrap: anywhere; }

/* A request or response, as text. It scrolls inside itself rather than
   widening the page, and takes focus so a keyboard can scroll it. */
.devportal-body {
    max-height: 32rem;
    overflow: auto;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--c-slate-bg);
    color: var(--text);
    font-size: 0.8rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.devportal-body:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.devportal-total th,
.devportal-total td {
    border-top: 2px solid var(--border);
}

/* ── keys (developer/Keys) ─────────────────────────────────────────────── */

/* A new key's one showing: marked out so it is not scrolled past. */
.devportal-reveal { border-left: 4px solid var(--c-amber); }

.devportal-code-sm {
    max-width: 12rem;
    font-size: 1rem;
    letter-spacing: 0.15em;
}

.devportal-keys > li + li { margin-top: 0.75rem; }

.devportal-key {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
}

/* A key that opens nothing any more: told apart by its badge's words, and by
   a dashed edge — never by fading, which would lower its contrast. */
.devportal-key-ended { border-style: dashed; }

/* Issue, Replace and Revoke open in place: <details>, so they work with no
   script. The summary is drawn as the button it acts as. */
.devportal-panel > summary { list-style: none; }
.devportal-panel > summary::-webkit-details-marker { display: none; }
.devportal-panel > summary:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
}

.devportal-panel-body {
    max-width: 32rem;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    background: var(--c-slate-bg);
}

/* ── setup guides (developer/Setup) ────────────────────────────────────── */

/* The guides are rendered by Devdocmarkdown into devdocs.css's .devdoc-body;
   that file styles inline code only on its own page, so the portal does here. */
.devportal-guide code {
    color: var(--text);
    background: var(--c-slate-bg);
    padding: 0.1em 0.35em;
    border-radius: 0.25rem;
    font-size: 0.875em;
}

.devportal-guide pre code {
    padding: 0;
    background: none;
    font-size: inherit;
}
