/*
 * Scenagraph billing. Follows scenagraph.com (canderis-web, packages/brand and sites/scenagraph.com):
 * the app's slate chrome, steel blue for actions, sodium-lamp amber reserved for warnings.
 */
@font-face {
    font-family: "Schibsted Grotesk Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 400 900;
    src: url("fonts/schibsted-grotesk-latin-ext-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: "Schibsted Grotesk Variable";
    font-style: normal;
    font-display: swap;
    font-weight: 400 900;
    src: url("fonts/schibsted-grotesk-latin-wght-normal.woff2") format("woff2-variations");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    color-scheme: dark;
    --font-body: "Schibsted Grotesk Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
    --slate: #23272d;
    --slate-raised: #2b3037;
    --slate-sunken: #1d2125;
    --slate-line: #3a4048;
    --text: #e6e8eb;
    --text-muted: #9da5b0;
    --steel: #5d88b3;
    --steel-hover: #4f78a3;
    --steel-bright: #86aad0;
    --lamp: #e9a23b;
    --danger: #e07a6f;
    --danger-line: #6b3a35;
    --ok: #7fbf8e;
    --gutter: clamp(1rem, 4vw, 3rem);
    --max-width: 76rem;

    --step--1: 0.875rem;
    --step-0: 1rem;
    --step-1: 1.375rem;
    --step-2: 1.75rem;
    --step-3: clamp(2rem, 3.6vw, 2.75rem);
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

html, body {
    margin: 0;
    min-height: 100%;
}

body {
    font-family: var(--font-body);
    font-size: var(--step-0);
    line-height: 1.55;
    background: var(--slate);
    color: var(--text);
    font-kerning: normal;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-weight: 750; letter-spacing: -0.025em; line-height: 1.1; }
p { margin: 0; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }

:focus-visible {
    outline: 2px solid var(--steel-bright);
    outline-offset: 3px;
    border-radius: 2px;
}

.skip-link {
    position: absolute;
    left: var(--gutter);
    top: -3rem;
    padding: 0.5rem 0.75rem;
    background: var(--text);
    color: var(--slate);
    z-index: 10;
}
.skip-link:focus { top: 0.75rem; }

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

/* Header and footer */
.layout-root { min-height: 100vh; display: flex; flex-direction: column; }
.layout-root > .container { width: 100%; }
.layout-main { flex: 1; }

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    padding-block: 1.25rem;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    font-weight: 750;
    font-size: 1.5rem;
    letter-spacing: -0.04em;
    text-decoration: none;
}
.brand__edition {
    padding: 0.1rem 0.4rem 0.15rem;
    border-radius: 3px;
    background: #c9463d;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    line-height: 1.3;
}
.brand__section {
    margin-left: 0.25rem;
    padding-left: 0.75rem;
    border-left: 1px solid var(--slate-line);
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1rem;
    letter-spacing: 0;
}
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; font-size: 1rem; }
.site-nav a { text-decoration: none; color: var(--text-muted); }
.site-nav a:hover, .site-nav a.active { color: var(--text); }

.company-footer {
    margin-top: clamp(3rem, 8vw, 5rem);
    border-top: 1px solid var(--slate-line);
    color: var(--text-muted);
    font-size: var(--step--1);
}
.company-footer__inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem 2rem;
    padding-block: 2rem 2.5rem;
}
.company-footer ul { display: flex; gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.company-footer a { text-decoration: none; }
.company-footer a:hover { color: var(--text); text-decoration: underline; }

/* Page */
.billing-shell { padding-block: clamp(1.5rem, 5vw, 3.5rem) 0; }

.billing-header { margin-bottom: clamp(1.75rem, 4vw, 2.5rem); max-width: 48rem; }
.billing-header h1 { font-size: var(--step-3); letter-spacing: -0.035em; }
.lede { margin-top: 0.75rem; color: var(--text-muted); font-size: 1.125rem; max-width: 40rem; }

.section-title { font-size: var(--step-1); margin-bottom: 0.35rem; }
.section-note { color: var(--text-muted); max-width: 44rem; }

.billing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.billing-card {
    display: grid;
    gap: 0.6rem;
    align-content: start;
    padding: 1.35rem 1.4rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--slate-line);
    border-radius: 6px;
    background: var(--slate-raised);
}
.billing-grid > .billing-card { margin-bottom: 0; }
.billing-card h2 { font-size: 1.125rem; letter-spacing: -0.015em; }
.billing-card h3 { font-size: 1rem; letter-spacing: -0.01em; }
.billing-card p { color: var(--text-muted); }
.billing-card p strong { color: var(--text); font-weight: 600; }

.billing-card-standalone {
    max-width: 44rem;
    margin: clamp(1.5rem, 5vw, 3.5rem) auto 0;
    padding: clamp(1.5rem, 4vw, 2.25rem);
}
.billing-card-standalone h1 { font-size: var(--step-2); letter-spacing: -0.03em; }
.billing-card-standalone > .billing-button { justify-self: start; margin-top: 0.4rem; }

.billing-card-quiet { background: var(--slate-sunken); }

.eyebrow {
    color: var(--steel-bright);
    font-size: var(--step--1);
    font-weight: 600;
}

.metric,
.billing-card .metric {
    color: var(--text);
    font-size: var(--step-2);
    font-weight: 750;
    letter-spacing: -0.03em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.metric small { font-size: 1rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.billing-card .metric-over { color: var(--lamp); }

.facts { display: grid; gap: 0.45rem; margin: 0.25rem 0 0; }
.facts > div { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.9375rem; }
.facts dt { color: var(--text-muted); white-space: nowrap; }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }

/* Offers: plans and add-ons */
.offer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}
.billing-card .offer__price { color: var(--text); font-size: var(--step-1); font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.offer__price small { color: var(--text-muted); font-size: var(--step--1); font-weight: 500; letter-spacing: 0; }
.billing-card .offer__credits { color: var(--text); font-weight: 600; }

/* Add-ons: one wide row per add-on, what it adds on the left and the quantity on the right */
.addon-list { display: grid; gap: 0.75rem; margin-top: 1rem; max-width: 56rem; }
.addon-list > .billing-card { margin-bottom: 0; }
.billing-card.addon {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    column-gap: 1.5rem;
}
.addon__about { display: grid; gap: 0.35rem; }
.addon__form { margin-top: 0; }
.addon .estimate { grid-column: 1 / -1; }
.estimate__summary { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.75rem 1.5rem; }
.estimate__summary > div { display: grid; gap: 0.2rem; }
.billing-card .estimate .estimate__fine { font-size: var(--step--1); }
.billing-card .estimate .estimate__change { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }

/* Actions */
.billing-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.4rem;
}

.billing-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.65rem 1.1rem;
    border: 1px solid transparent;
    border-radius: 5px;
    background: var(--steel);
    color: #fff;
    font: inherit;
    font-weight: 600;
    font-size: 0.9375rem;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 120ms ease, border-color 120ms ease;
}
.billing-button:hover { background: var(--steel-hover); }

.billing-button-secondary {
    background: transparent;
    border-color: var(--slate-line);
    color: var(--text);
}
.billing-button-secondary:hover { background: var(--slate-sunken); border-color: var(--text-muted); }

.billing-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--steel-bright);
    font-weight: 600;
    text-decoration: none;
}
.billing-link:hover { text-decoration: underline; }
.billing-card-standalone > .billing-link { margin-top: 0.75rem; }

/* Forms */
.billing-form { display: flex; flex-wrap: wrap; align-items: end; gap: 0.6rem; margin-top: 0.4rem; }
.billing-form label { display: grid; gap: 0.35rem; color: var(--text-muted); font-size: var(--step--1); font-weight: 600; }
.billing-form input {
    width: 9rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--slate-line);
    border-radius: 5px;
    background: var(--slate-sunken);
    color: var(--text);
    font: inherit;
    font-variant-numeric: tabular-nums;
}
.billing-form input:focus { border-color: var(--steel-bright); outline: none; }

.estimate {
    display: grid;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--slate-line);
    border-radius: 6px;
    background: var(--slate-sunken);
}
.billing-card .estimate p { color: var(--text-muted); font-size: 0.9375rem; }
.billing-card .estimate .estimate__due { color: var(--text); font-size: 1.125rem; font-weight: 700; }

/* Tables */
.billing-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; font-variant-numeric: tabular-nums; }
.billing-table th, .billing-table td {
    padding: 0.65rem 1rem 0.65rem 0;
    border-top: 1px solid var(--slate-line);
    text-align: left;
    vertical-align: middle;
}
.billing-table thead th { border-top: 0; padding-top: 0; color: var(--text-muted); font-size: var(--step--1); font-weight: 600; }
.billing-table-wrap { overflow-x: auto; }

/* Banners */
.billing-banner {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border: 1px solid var(--slate-line);
    border-left-width: 3px;
    border-radius: 5px;
    background: var(--slate-raised);
    color: var(--text);
    font-weight: 500;
}
.billing-banner-info { border-left-color: var(--steel-bright); }
.billing-banner-warning { border-left-color: var(--lamp); }
.billing-banner-error { border-color: var(--danger-line); border-left-color: var(--danger); }
.billing-card .billing-banner { margin-bottom: 0; }

.pill {
    display: inline-flex;
    padding: 0.05rem 0.5rem;
    margin-left: 0.5rem;
    border: 1px solid var(--slate-line);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
}

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 1.5rem;
    right: 1.5rem;
    bottom: 1.5rem;
    padding: 0.9rem 1.1rem;
    border: 1px solid var(--danger-line);
    border-radius: 6px;
    background: var(--slate-sunken);
    color: var(--text);
    z-index: 1000;
}
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 0.75rem; }

@media (min-width: 1100px) {
    .billing-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
    .billing-grid { grid-template-columns: 1fr; }
    .billing-card.addon { grid-template-columns: 1fr; }
    .site-nav { width: 100%; }
    .facts > div { font-size: var(--step--1); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* The billing site's own checkout (#756): labelled frames that hold the payment provider's card fields. */
.checkout-price { font-size: var(--step-1); font-weight: 600; margin: 0; }
.checkout-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.9rem 0.75rem; max-width: 30rem; margin-top: 0.6rem; }
.checkout-field { display: grid; gap: 0.35rem; }
.checkout-field-wide, .checkout-form > .section-note, .checkout-form > .billing-actions { grid-column: 1 / -1; }
.checkout-label { color: var(--text-muted); font-size: var(--step--1); font-weight: 600; }
.checkout-frame { min-height: 2.75rem; border: 1px solid var(--border, currentColor); border-radius: 0.5rem; background: #fff; padding: 0.15rem 0.5rem; }
.checkout-frame:focus-within { outline: 2px solid var(--steel, currentColor); outline-offset: 2px; }
.checkout-frame-price { background: transparent; border-style: dashed; }
.checkout-status-error { color: var(--danger, #c9463d); }
.checkout-form button[disabled] { opacity: 0.55; cursor: not-allowed; }
@media (max-width: 30rem) { .checkout-form { grid-template-columns: 1fr; } }

/* The billing site's own invoice list (#756). */
.invoice-list { width: 100%; max-width: 40rem; border-collapse: collapse; font-size: var(--step--1); }
.invoice-list th, .invoice-list td { text-align: left; padding: 0.45rem 0.75rem 0.45rem 0; border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.12)); }
.invoice-list th { color: var(--text-muted); font-weight: 600; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
