/*!
 * ix Theme — Design Tokens
 *
 * Two token groups live here:
 *
 * 1. The tokens the inherited Nexus stylesheets already consume but never
 *    declare (Nexus reads var(--bg-lifted), var(--text), var(--rounding-md)
 *    and ~40 more from a core stylesheet). Declaring them here is what gives
 *    the ~90 inherited templates a dark palette without editing them.
 *
 *    Their meaning is taken from how Nexus actually uses them, not from the
 *    name alone. In particular --bg-inverted is a dark chrome surface that
 *    carries white text (footer background, primary button), NOT "the
 *    opposite of the current theme".
 *
 * 2. The --ix-* tokens, used only by this theme's own components.
 *
 * The theme is dark only. The palette lives on bare :root, so it is right with
 * or without JavaScript, and there is no light variant to switch to. Light
 * values survive in exactly one place — the print block in ix-invoice.css,
 * because paper is white.
 */

:root {
    /* ---- Surfaces ---------------------------------------------------- */
    --bg: #0f1117;              /* page base */
    --bg-lifted: #161a23;       /* main content surface, cards */
    --bg-accented: #1e2330;     /* hover / raised state */
    --bg-muted: #0b0d13;        /* recessed areas */
    --bg-inverted: #1b1f2a;     /* dark chrome carrying light text */

    /* ---- Text -------------------------------------------------------- */
    --text: #e5e8f0;
    --text-lifted: #f4f6fa;     /* headings */
    --text-accented: #ffffff;
    --text-muted: #8b93a7;
    --text-inverted: #ffffff;   /* text sitting on --bg-inverted */

    /* ---- Borders ----------------------------------------------------- */
    --border: #272c3a;
    --border-lifted: #333a4b;
    --border-accented: #454e63;
    --border-muted: #1d2129;

    /* ---- Neutrals ---------------------------------------------------- */
    --grayscale: #5b6377;
    --grayscale-lifted: #3a4252; /* used as a hover surface under white text */
    --grayscale-accented: #7b8499;

    /* ---- Semantic ---------------------------------------------------- */
    --success: #22c55e;
    --success-accented: #16a34a;
    --error: #ef4444;
    --error-lifted: #f87171;
    --warning: #f59e0b;
    --warning-accented: #d97706;
    --info: #38bdf8;
    --info-accented: #0ea5e9;
    --notice: #a78bfa;
    --notice-lifted: #c4b5fd;
    --neutral: #8b93a7;
    --neutral-lifted: #a8b0c2;
    --neutral-accented: #6b7387;
    --secondary: #6b7387;

    /* ---- Fixed palette (accent stripes, chips) ----------------------- */
    --yellow-200: #fde68a;
    --yellow-300: #fcd34d;
    --teal-300: #5eead4;
    --teal-400: #2dd4bf;
    --pink-400: #f472b6;
    --emerald-300: #6ee7b7;

    /* ---- Shape ------------------------------------------------------- */
    --rounding-sm: 6px;
    --rounding-md: 10px;
    --rounding-lg: 16px;
    --letter-spacing: normal;
    --disabled-opacity: 0.5;

    /* ================================================================== */
    /* ix-specific tokens                                                 */
    /* ================================================================== */

    /* Brand accent — indigo */
    --ix-accent: #6366f1;
    --ix-accent-hover: #818cf8;
    --ix-accent-active: #4f46e5;
    --ix-accent-soft: rgba(99, 102, 241, 0.14);
    --ix-accent-border: rgba(99, 102, 241, 0.38);
    --ix-accent-contrast: #ffffff;

    /* Chrome */
    --ix-topbar-bg: #0b0d13;
    /* The topbar is darker than the page, so the hover is a white wash. */
    --ix-topbar-hover: rgba(255, 255, 255, 0.06);
    --ix-topbar-height: 40px;
    /* The page's ground at half strength: the header's glass, blurred in
       ix.css, so what scrolls under it shows through. */
    --ix-nav-bg-glass: rgba(15, 17, 23, 0.5);
    --ix-nav-height: 68px;
    --ix-mega-bg: #161a23;
    --ix-footer-bg: #0b0d13;

    /* One height for every field and for the buttons standing beside one, so a
       row of them lines up wherever it is built. Shorter on a phone, where the
       screen is the scarce thing rather than the pointer. */
    --ix-field-height: 50px;

    /* The scale every other control is drawn to — a button, a field beside
       one, a select. Three sizes and no more: large is the public pages'
       (.ix-btn), medium the client area's, small the quiet controls a list's
       toolbar and foot carry (.ix-btn-sm). A page that needs a height of its
       own is a sign a size is missing here, not a reason to write a number
       into that page. */
    --ix-control-sm: 34px;
    --ix-control-md: 36px;
    --ix-control-lg: 44px;

    /* The icon chips' three sizes, chosen by what a chip stands beside:
       small beside one line of text (a table's row, a heading), medium
       beside a name with a line under it (a list's row, a card), large on
       its own beside a page's title or an empty state. Three and no more,
       for the reason the controls have three. */
    --ix-chip-sm: 32px;
    --ix-chip-md: 38px;
    --ix-chip-lg: 44px;

    /* The section card's own padding (.ix-panel-section), outside its head's
       and its body's 18px. A token because the cards that stand beside those
       without being one — MarketConnect's block and the inner tabs on a
       service's page — have to be framed by the same number. It was 26px,
       which set the content 44px in: more than twice the dashboard's 18px,
       and loose beside it. */
    --ix-section-pad: 14px;

    /* The ground under a client's logo that was drawn for a light page, with
       a transparent background: dark lettering on it would vanish into the
       card otherwise. */
    --ix-logo-ground: #ffffff;

    /* The ground of an e-mail shown in the client area: messages are written
       for a white page, often with dark text and no background of their own. */
    --ix-email-ground: #ffffff;

    /* The ink on a chip whose colour WHMCS sets inline — a ticket status's or
       a department's, chosen in the admin area without knowing this palette.
       White is what WHMCS's own pages put on them. */
    --ix-ink-on-custom: #ffffff;

    /* cPanel's own orange, for its mark on the dashboard's "Manage" menu:
       the colour is half of what makes the mark recognisable at a glance. */
    --ix-brand-cpanel: #ff6c2c;

    /* The support people drawn on the ticket page's department cards. */
    --ix-avatar-skin: #f6dcb8;
    --ix-avatar-skin-shade: #e2bd92;
    --ix-avatar-hair: #3a4050;
    --ix-avatar-hair-light: #5b6275;

    /* Elevation — heavier on dark, where borders alone read flat */
    --ix-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --ix-shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
    --ix-shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.55);

    /* Status chips.
       Nexus paints status labels as a solid --success / --warning / --info fill
       under white text. Those tokens are bright on a dark palette, which lands
       around 2:1 against white. These tinted pairs replace that with a washed
       background and a coloured foreground, which reads on the dark ground. */
    --ix-tint-success-bg: rgba(34, 197, 94, 0.16);
    --ix-tint-success-fg: #4ade80;
    /* A step lighter, for a green link under the pointer — the upsell
       card's — as --ix-accent-hover is for the accent's. */
    --ix-tint-success-fg-hover: #86efac;
    /* The frame of a green card — MarketConnect's sidebar promo — as
       --ix-accent-border is for the accent's. */
    --ix-tint-success-border: rgba(34, 197, 94, 0.38);
    --ix-tint-error-bg: rgba(239, 68, 68, 0.16);
    --ix-tint-error-fg: #f87171;
    --ix-tint-warning-bg: rgba(245, 158, 11, 0.16);
    --ix-tint-warning-fg: #fbbf24;
    --ix-tint-info-bg: rgba(56, 189, 248, 0.16);
    --ix-tint-info-fg: #7dd3fc;
    /* The frames of the incident card under the navbar
       (includes/network-issues-notifications.tpl), in the tint of what is
       going on, as --ix-tint-success-border is for the green card. */
    --ix-tint-error-border: rgba(239, 68, 68, 0.38);
    --ix-tint-warning-border: rgba(245, 158, 11, 0.38);
    --ix-tint-info-border: rgba(56, 189, 248, 0.38);
    --ix-tint-notice-bg: rgba(167, 139, 250, 0.16);
    --ix-tint-notice-fg: #c4b5fd;
    --ix-tint-neutral-bg: rgba(139, 147, 167, 0.16);
    --ix-tint-neutral-fg: #a8b0c2;
    /* Two more pairs with no status meaning, for illustrations that need
       more colours than the statuses give: the reseller art's client marks. */
    --ix-tint-pink-bg: rgba(244, 114, 182, 0.16);
    --ix-tint-pink-fg: #f472b6;
    --ix-tint-teal-bg: rgba(45, 212, 191, 0.16);
    --ix-tint-teal-fg: #5eead4;

    /* Interaction */
    --ix-ring: 0 0 0 3px var(--ix-accent-soft);
    --ix-transition: 160ms cubic-bezier(0.4, 0, 0.2, 1);
    --ix-overlay: rgba(15, 17, 23, 0.88);
    --ix-scrim: rgba(0, 0, 0, 0.6);

    /* Layout */
    --ix-container-max: 1240px;
    --ix-font-sans: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, Helvetica, Arial, sans-serif;

    color-scheme: dark;
}

/* Wherever the full menu shows (992px up) the topbar is hidden and the
   navbar holds what it held (includes/topbar.tpl), so the sticky header is
   that much shorter: every offset written as the topbar's height plus the
   navbar's stays right. */
@media (min-width: 992px) {
    :root {
        --ix-topbar-height: 0px;
    }
}

/* A phone gives the height back to the page: 46px is still a comfortable
   target, and four fields stacked at 50 push the button under the fold. */
@media (max-width: 575px) {
    :root {
        --ix-field-height: 46px;
    }
}
