/*!
 * ix Theme — Bootstrap 4 + Nexus compatibility layer
 *
 * Bootstrap 4 predates dark mode and Nexus hardcodes #fff / #f8f8f8 in around
 * fifty places, so neither reacts to the tokens on its own. Everything here is
 * driven by the tokens in ix-tokens.css, which means one rule set serves both
 * palettes — the tokens change, these rules don't.
 *
 * Selectors mirror the ones in the parent's theme.css (including its long
 * `body .primary-content ...` chains) because they have to win on specificity.
 */

/* ====================================================================== */
/* Base                                                                   */
/* ====================================================================== */

html,
body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--ix-font-sans);
}

section#main-body {
    background-color: var(--bg);
}

/* Bootstrap caps .container at 1140px, while the theme's own header, footer
   and breadcrumb use .ix-container at 1240px — so page content sat about 50px
   narrower on each side than the chrome around it. Scoped to the direct child
   from header.tpl, leaving Bootstrap containers inside page content alone.
   The homepage overrides this again: its sections are full-bleed. */
section#main-body > .container {
    max-width: var(--ix-container-max);
}

a {
    color: var(--ix-accent);
}

/* Pointing at a link, or focusing it, never changes its underline: a link
   without one stays without, and text that is underlined — an alert's link,
   a legal page's — stays underlined, as it is at rest. Nexus underlines
   every link under the pointer (a:hover) and Bootstrap its link buttons
   (.btn-link, on hover and on focus); both are answered here. A link's
   colour is what answers the pointer, and the focus ring the keyboard.

   A rule that underlines a link for good holds over this one by weight or by
   coming later, as those do: .alert a (heavier), .ix-status-note a and
   .ix-legal-prose a (in ix.css, loaded after this file). One written lighter
   and earlier would lose its underline under the pointer. */
a:hover,
a:focus,
.btn-link:hover,
.btn-link:focus,
.btn-link.focus {
    text-decoration: none;
}

/* A click leaves no frame: Bootstrap's reboot draws the browser's blue ring
   on button:focus, and Bootstrap and Nexus give buttons a shadow ring on
   :focus — both of which a mouse click sets off. The frame is kept for the
   keyboard, where it is how someone who does not use a pointer sees where
   they are: :focus-visible is the browser telling focus by keyboard from
   focus by click. Text fields count as focus-visible either way, so they
   keep their own focus border while typed in; their shadows are left as
   they are. */
:focus:not(:focus-visible) {
    outline: none;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
.btn:focus:not(:focus-visible),
.ix-btn:focus:not(:focus-visible) {
    box-shadow: none;
}

/* The keyboard's frame, in the theme's accent rather than the browser's blue.
   The theme's own buttons draw their ring instead (.ix-btn:focus-visible,
   in ix.css), so they are left out of this one. */
a:not(.ix-btn):focus-visible,
button:not(.ix-btn):focus-visible,
[role="button"]:not(.ix-btn):focus-visible {
    outline: 2px solid var(--ix-accent);
    outline-offset: 2px;
}

a:hover,
a:focus {
    color: var(--ix-accent-hover);
}

hr {
    border-top-color: var(--border);
}

.text-muted {
    color: var(--text-muted) !important;
}

.text-dark {
    color: var(--text) !important;
}

code,
kbd,
pre,
samp {
    color: var(--notice-lifted);
}

pre {
    background-color: var(--bg-muted);
    border: 1px solid var(--border);
    border-radius: var(--rounding-sm);
    padding: 12px 14px;
    color: var(--text);
}

::selection {
    background-color: var(--ix-accent-soft);
    color: var(--text-lifted);
}

:focus-visible {
    outline: 2px solid var(--ix-accent);
    outline-offset: 2px;
}

/* ====================================================================== */
/* Surfaces: cards, panels, list groups                                   */
/* ====================================================================== */

.card,
.mc-promo-manage,
.mc-promo-login {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    border-radius: var(--rounding-md);
    color: var(--text);
}

.card-header,
.card-footer {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text-lifted);
}

.panel,
.panel-heading,
.panel-body,
.panel-footer {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

.list-group-item {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

.list-group-item-action:hover,
.list-group-item-action:focus {
    background-color: var(--bg-accented);
    color: var(--text-lifted);
}

.tiles .tile {
    background-color: var(--bg-accented);
    border-color: var(--border);
    color: var(--text);
}

.tiles .tile:hover {
    background-color: var(--bg-inverted);
}

.img-thumbnail {
    background-color: var(--bg-lifted);
    border-color: var(--border);
}

.bg-white,
.bg-light {
    background-color: var(--bg-lifted) !important;
}

.jumbotron {
    background-color: var(--bg-lifted);
}

/* ====================================================================== */
/* Forms                                                                  */
/* ====================================================================== */

.form-control,
.custom-select,
.custom-file-label,
body .dataTables_wrapper .dataTables_filter label .form-control {
    background-color: var(--bg-muted);
    border-color: var(--border-lifted);
    color: var(--text);
    border-radius: var(--rounding-sm);
}

.form-control:focus,
.custom-select:focus {
    background-color: var(--bg-muted);
    border-color: var(--ix-accent);
    color: var(--text);
    box-shadow: var(--ix-ring);
}

.form-control::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.form-control:disabled,
.form-control[readonly] {
    background-color: var(--bg-accented);
    color: var(--text-muted);
}

.custom-select option,
select.form-control option {
    background-color: var(--bg-lifted);
    color: var(--text);
}

.input-group-text {
    background-color: var(--bg-accented);
    border-color: var(--border-lifted);
    color: var(--text-muted);
}

.input-group .btn-reveal-pw,
.input-group .btn-reveal-pw:hover,
.input-group .btn-reveal-pw:active {
    background-color: var(--bg-accented);
    border-color: var(--border-lifted);
    color: var(--text-muted);
}

label,
.col-form-label {
    color: var(--text);
}

.form-text,
small.text-muted {
    color: var(--text-muted);
}

.custom-control-label::before {
    background-color: var(--bg-muted);
    border-color: var(--border-accented);
}

.custom-control-input:checked ~ .custom-control-label::before {
    background-color: var(--ix-accent);
    border-color: var(--ix-accent);
}

.custom-switch .custom-control-input:checked ~ .custom-control-label::after {
    background-color: var(--ix-accent-contrast);
}

.was-validated .form-control:invalid,
.form-control.is-invalid {
    border-color: var(--error);
}

.invalid-feedback {
    color: var(--error-lifted);
}

body #order-standard_cart .sub-heading span {
    background-color: var(--bg);
    color: var(--text-lifted);
}

/* ====================================================================== */
/* Buttons                                                                */
/* ====================================================================== */

.btn {
    border-radius: var(--rounding-md);
}

/* Nexus points .btn-primary at --bg-inverted, which is a neutral chrome tone.
   The brand accent belongs here instead. */
.btn-primary,
.btn-primary:not(:disabled):not(.disabled) {
    background-color: var(--ix-accent);
    border-color: var(--ix-accent);
    color: var(--ix-accent-contrast);
}

/* .active with the pseudo-class: a button that stays pressed — the markdown
   editor's Preview while the preview is shown — carries the class, which
   Bootstrap paints in its own blue with its own blue ring. */
.btn-primary:hover,
.btn-primary:focus,
.btn-primary:active,
.btn-primary.active,
.btn-primary:not(:disabled):not(.disabled):active,
.btn-primary:not(:disabled):not(.disabled).active {
    background-color: var(--ix-accent-hover);
    border-color: var(--ix-accent-hover);
    color: var(--ix-accent-contrast);
}

.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active:focus,
.btn-primary:not(:disabled):not(.disabled).active:focus {
    box-shadow: var(--ix-ring);
}

.btn-default,
.btn-secondary,
.btn.btn-success.open-modal.twofa-config-link.enable {
    background-color: var(--bg-accented);
    border-color: var(--border-lifted);
    color: var(--text);
}

.btn-default:hover,
.btn-secondary:hover,
.btn.btn-success.open-modal.twofa-config-link.enable:hover {
    background-color: var(--border-lifted);
    border-color: var(--border-accented);
    color: var(--text-lifted);
}

.btn-outline-primary,
body #main-body .btn-outline-primary {
    color: var(--ix-accent);
    border-color: var(--ix-accent-border);
    background-color: transparent;
}

.btn-outline-primary:hover,
body #main-body .btn-outline-primary:hover {
    background-color: var(--ix-accent);
    border-color: var(--ix-accent);
    color: var(--ix-accent-contrast);
}

.btn-outline-light:hover {
    background-color: var(--bg-accented);
    color: var(--text-lifted);
}

.btn-link {
    color: var(--ix-accent);
}

.btn-link:hover {
    color: var(--ix-accent-hover);
}

.close {
    color: var(--text);
    text-shadow: none;
    opacity: 0.7;
}

.close:hover {
    color: var(--text-lifted);
    opacity: 1;
}

/* ====================================================================== */
/* Dropdowns                                                              */
/* ====================================================================== */

.dropdown-menu {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    border-radius: var(--rounding-md);
    box-shadow: var(--ix-shadow-md);
    color: var(--text);
}

.dropdown-item {
    color: var(--text);
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--bg-accented);
    color: var(--text-lifted);
}

.dropdown-divider {
    border-top-color: var(--border);
}

.dropdown-header {
    color: var(--text-muted);
}

/* ====================================================================== */
/* Tables                                                                 */
/* ====================================================================== */

.table {
    color: var(--text);
}

.table td,
.table th,
.table-list > tbody > tr > td {
    background-color: transparent;
    border-color: var(--border);
}

.table thead th,
table.table-list thead th {
    background-color: var(--bg-accented);
    border-color: var(--border);
    color: var(--text-lifted);
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: var(--bg-lifted);
}

.table-hover tbody tr:hover,
.table-list > tbody > tr:hover > td {
    background-color: var(--bg-accented);
    color: var(--text-lifted);
}

.dataTables_wrapper table.table-list thead th.sorting_asc,
.dataTables_wrapper table.table-list thead th.sorting_desc {
    background-color: var(--bg-inverted);
}

.dataTables_wrapper .dataTables_info,
.dataTables_wrapper .dataTables_length,
.dataTables_wrapper .dataTables_filter {
    color: var(--text-muted);
}

/* ====================================================================== */
/* Navigation: tabs, pills, pagination, breadcrumb                        */
/* ====================================================================== */

.nav-tabs {
    border-bottom-color: var(--border);
}

.nav-tabs .nav-link {
    color: var(--text-muted);
    border-radius: var(--rounding-sm) var(--rounding-sm) 0 0;
}

.nav-tabs .nav-link:hover {
    border-color: var(--border) var(--border) var(--border);
    color: var(--text);
}

.nav-tabs .nav-link.active,
.responsive-tabs-sm .nav-item a.active {
    background-color: var(--bg-lifted);
    border-color: var(--border) var(--border) var(--bg-lifted);
    color: var(--text-lifted);
}

.nav-pills .nav-link.active {
    background-color: var(--ix-accent);
    color: var(--ix-accent-contrast);
}

.page-link {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

.page-link:hover {
    background-color: var(--bg-accented);
    border-color: var(--border-lifted);
    color: var(--text-lifted);
}

.page-item.active .page-link,
.pagination > .active > a,
.pagination > .active > span {
    background-color: var(--ix-accent);
    border-color: var(--ix-accent);
    color: var(--ix-accent-contrast);
}

.page-item.disabled .page-link {
    background-color: var(--bg-muted);
    border-color: var(--border);
    color: var(--text-muted);
}

.breadcrumb {
    background-color: transparent;
    color: var(--text-muted);
}

.breadcrumb-item + .breadcrumb-item::before {
    color: var(--text-muted);
}

.breadcrumb-item.active {
    color: var(--text);
}

/* ====================================================================== */
/* Modals, popovers, tooltips                                             */
/* ====================================================================== */

.modal-content {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    border-radius: var(--rounding-lg);
    color: var(--text);
}

.modal-header,
.modal-footer {
    border-color: var(--border);
}

/* A dialog reads like the theme's cards: a title in the heading colour, room
   around what it asks, and its two answers at the end of the foot. WHMCS
   writes several of these itself — choosing the service an addon goes on,
   the recommendations after an item is added — so this is set on Bootstrap's
   own classes rather than in a template. */
.modal-header {
    padding: 18px 22px;
}

.modal-header h4,
.modal-header .modal-title {
    margin: 0;
    color: var(--text-lifted);
    font-size: 1.125rem;
    font-weight: 700;
}

.modal-header .close {
    color: var(--text-muted);
    text-shadow: none;
    opacity: 1;
    transition: color var(--ix-transition);
}

.modal-header .close:hover,
.modal-header .close:focus {
    color: var(--text-lifted);
    opacity: 1;
}

.modal-body {
    padding: 20px 22px;
    color: var(--text);
}

.modal-body > p:last-child {
    margin-bottom: 0;
}

.modal-body label {
    color: var(--text);
    font-size: 0.875rem;
    font-weight: 600;
}

.modal-footer {
    gap: 10px;
    padding: 16px 22px;
}

/* Bootstrap spaces these with margins on every child, which leaves a gap
   where the gap already is. */
.modal-footer > * {
    margin: 0;
}

.modal-backdrop.show {
    opacity: 0.7;
}

.popover {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    box-shadow: var(--ix-shadow-md);
    color: var(--text);
}

.popover .arrow::after {
    border-top-color: var(--bg-lifted);
    border-bottom-color: var(--bg-lifted);
}

.popover-header {
    background-color: var(--bg-accented);
    border-bottom-color: var(--border);
    color: var(--text-lifted);
}

.popover-body {
    color: var(--text);
}

.popover-user-notifications ul li a:hover {
    background-color: var(--bg-accented);
}

.tooltip-inner {
    background-color: var(--bg-inverted);
    color: var(--text-inverted);
    border-radius: var(--rounding-sm);
}

.tooltip .arrow::before {
    border-top-color: var(--bg-inverted);
    border-bottom-color: var(--bg-inverted);
}

/* ====================================================================== */
/* Alerts and badges                                                      */
/* ====================================================================== */

.alert {
    border-radius: var(--rounding-md);
    border-width: 1px;
}

/* Reuses the status-chip tints, so an alert and a status label of the same
   severity agree — but quieter than the chips, since an alert
   is a paragraph across a column where a chip is a word. Each part is a share
   of the severity's own colour: the surface a little over half its tint, the
   border a third of its ink, and the words that ink stepped towards the page's
   muted text. The four severities are retuned together by these three numbers.
   (color-mix needs a 2023 browser, as does the :has() this file already uses.) */
.alert-success {
    background-color: color-mix(in srgb, var(--ix-tint-success-bg) 55%, transparent);
    border-color: color-mix(in srgb, var(--ix-tint-success-fg) 35%, transparent);
    color: color-mix(in srgb, var(--ix-tint-success-fg) 65%, var(--text-muted));
}

.alert-danger {
    background-color: color-mix(in srgb, var(--ix-tint-error-bg) 55%, transparent);
    border-color: color-mix(in srgb, var(--ix-tint-error-fg) 35%, transparent);
    color: color-mix(in srgb, var(--ix-tint-error-fg) 65%, var(--text-muted));
}

.alert-warning {
    background-color: color-mix(in srgb, var(--ix-tint-warning-bg) 55%, transparent);
    border-color: color-mix(in srgb, var(--ix-tint-warning-fg) 35%, transparent);
    color: color-mix(in srgb, var(--ix-tint-warning-fg) 65%, var(--text-muted));
}

.alert-info {
    background-color: color-mix(in srgb, var(--ix-tint-info-bg) 55%, transparent);
    border-color: color-mix(in srgb, var(--ix-tint-info-fg) 35%, transparent);
    color: color-mix(in srgb, var(--ix-tint-info-fg) 65%, var(--text-muted));
}

.alert-light,
.alert-secondary {
    background-color: var(--bg-accented);
    border-color: var(--border);
    color: var(--text);
}

.alert:has(form) {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

/* A link inside an alert is part of its sentence, so it takes the alert's
   own colour and an underline — but a button is not a sentence: one placed
   in an alert, as the unpaid-invoice notice does, keeps the shape its own
   class gives it. */
.alert a:not(.ix-btn):not(.btn),
.alert .alert-link {
    color: inherit;
    text-decoration: underline;
}

/* Its colour, though, is the alert's business. The casing already carries
   the severity — red for an invoice past its date — and a button in the
   theme's accent puts a second colour system inside that casing, which
   reads as a second object rather than as the answer to what the alert
   says. So the button is drawn in the alert's own ink: currentColor, which
   every severity sets for itself above, so this one rule dresses the button
   in an error, a warning, a success and an info alert alike, and any
   severity added later. */
.alert .ix-btn {
    background-color: transparent;
    border-color: currentColor;
    color: inherit;
}

/* Filled with a little of that same ink on the pointer, rather than with a
   colour of its own. */
.alert .ix-btn:hover,
.alert .ix-btn:focus {
    background-color: color-mix(in srgb, currentColor 14%, transparent);
    border-color: currentColor;
    color: inherit;
}

.badge-light {
    background-color: var(--bg-accented);
    color: var(--text);
}

.badge-dark {
    background-color: var(--bg-inverted);
    color: var(--text-inverted);
}

.progress {
    background-color: var(--bg-accented);
}

/* ====================================================================== */
/* Status labels                                                          */
/* ====================================================================== */

/* Nexus's .label sets color:#fff over a solid --success / --warning / --info
   fill. Those tokens are bright on a dark palette, so white text lands near
   2:1. Tinted chips fix the contrast. */
.label,
.label.status {
    display: inline-block;
    padding: 3px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    background-color: var(--ix-tint-neutral-bg);
    color: var(--ix-tint-neutral-fg);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.5;
    white-space: nowrap;
}

.label-success,
.status-active,
.status-open,
.status-completed,
.status-paid,
.status-delivered,
.status-accepted {
    background-color: var(--ix-tint-success-bg);
    color: var(--ix-tint-success-fg);
}

.label-danger,
.status-unpaid,
.status-fraud,
.status-terminated,
.status-dead,
.status-lost,
.status-collections,
.status-suspended {
    background-color: var(--ix-tint-error-bg);
    color: var(--ix-tint-error-fg);
}

.label-warning,
.status-pending,
.status-pending-registration,
.status-pending-transfer,
.status-inprogress,
.status-grace,
.status-redemption,
.status-customer-reply {
    background-color: var(--ix-tint-warning-bg);
    color: var(--ix-tint-warning-fg);
}

.label-info,
.status-onhold,
.status-payment-pending {
    background-color: var(--ix-tint-info-bg);
    color: var(--ix-tint-info-fg);
}

.status-answered {
    background-color: var(--ix-tint-notice-bg);
    color: var(--ix-tint-notice-fg);
}

.label-default,
.status-closed,
.status-cancelled,
.status-expired,
.status-refunded,
.status-transferred-away {
    background-color: var(--ix-tint-neutral-bg);
    color: var(--ix-tint-neutral-fg);
}

/* Status pills set by an admin-chosen colour stay as WHMCS renders them —
   the inline background wins, so only the text needs to follow it. */
.label.status-custom {
    color: var(--ix-accent-contrast);
}

/* ====================================================================== */
/* DataTables lists                                                       */
/* ====================================================================== */

.table-container {
    background-color: var(--bg-lifted);
    border: 1px solid var(--border);
    border-radius: var(--rounding-md);
    overflow: hidden;
}

table.table-list {
    margin-bottom: 0;
}

table.table-list tbody tr {
    cursor: pointer;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    color: var(--text) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current,
.dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
    background: var(--ix-accent) !important;
    border-color: var(--ix-accent) !important;
    color: var(--ix-accent-contrast) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--bg-accented) !important;
    border-color: var(--border-lifted) !important;
    color: var(--text-lifted) !important;
}

#tableLoading {
    padding: 28px 0;
    color: var(--text-muted);
}

.ticket-number {
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}

.ticket-subject.unread {
    font-weight: 700;
    color: var(--text-lifted);
}

/* ====================================================================== */
/* Nexus components that hardcode light surfaces                          */
/* ====================================================================== */

.verification-banner {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

/* .select-account a:hover was here too, for the account switcher Nexus
   draws; that page is the theme's own now (user-switch-account.tpl). */
.continue-container,
.invite-box {
    background-color: var(--bg-accented);
    color: var(--text);
}

.action-icon-btns a {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

.home-domain-search .input-group-wrapper {
    background-color: var(--bg-lifted);
}

div.credit-card {
    background-color: var(--bg-accented);
    color: var(--text);
}

div.product-details-tab-container {
    background-color: var(--bg-lifted);
    color: var(--text);
}

/* The markdown editor WHMCS builds around a .markdown-editor textarea. Its
   white surfaces are set with !important in the parent's stylesheet
   (.md-editor > textarea.markdown-editor and .md-editor > .md-preview carry
   background-color: #fff !important), so the theme's have to be marked the
   same way to reach them — the one place in this file where that is not a
   matter of specificity but of the parent's own weight. */
.md-editor,
div.md-editor.active {
    background-color: var(--bg-lifted);
    border-color: var(--border-lifted);
}

.md-editor > .btn-toolbar {
    background-color: var(--bg-accented) !important;
    border-bottom: 0;
}

.md-editor > textarea.markdown-editor,
.md-editor > .md-preview,
.md-editor .md-preview {
    background-color: var(--bg-muted) !important;
    border-top-color: var(--border) !important;
    border-bottom-color: var(--border) !important;
    color: var(--text);
}

/* The line under the box that counts what has been typed and says when the
   draft was saved. */
.md-editor .md-footer,
.markdown-editor-status {
    background-color: var(--bg-accented);
    color: var(--text-muted);
}

/* The editor's own full-screen mode, which the arrows at the toolbar's end
   open: the plugin lays a fixed white sheet over the page and paints the
   text area and the preview white on top of it, all with !important, so
   every one of them is answered here — otherwise the screen flashes white
   the moment the button is pressed. */
.md-editor.md-fullscreen-mode {
    background: var(--bg) !important;
}

.md-editor.md-fullscreen-mode .md-input,
.md-editor.md-fullscreen-mode .md-preview,
.md-editor.md-fullscreen-mode .md-input:focus,
.md-editor.md-fullscreen-mode .md-input:hover {
    background: var(--bg) !important;
    color: var(--text) !important;
}

.md-editor.md-fullscreen-mode .md-header {
    background: none !important;
}

/* Full screen strips the toolbar's buttons to plain glyphs, so they are
   given the quiet colour — except the one carrying the accent behind its
   label, which keeps the contrast colour that goes on the accent. */
.md-editor.md-fullscreen-mode .btn:not(.btn-primary) {
    color: var(--text-muted);
}

.md-editor.md-fullscreen-mode .btn:not(.btn-primary).active,
.md-editor.md-fullscreen-mode .btn:not(.btn-primary):active,
.md-editor.md-fullscreen-mode .btn:not(.btn-primary):focus,
.md-editor.md-fullscreen-mode .btn:not(.btn-primary):hover {
    color: var(--text-lifted);
}

.md-editor.md-fullscreen-mode .btn-primary,
.md-editor.md-fullscreen-mode .btn-primary:hover,
.md-editor.md-fullscreen-mode .btn-primary:focus {
    color: var(--ix-accent-contrast);
}

.md-editor.md-fullscreen-mode .md-fullscreen-controls a {
    color: var(--text-muted);
}

.md-editor.md-fullscreen-mode .md-fullscreen-controls a:hover {
    color: var(--text-lifted);
}

/* Full screen on a phone. The plugin fixes the toolbar at the top at 100%
   width with no left edge, so it starts at the sheet's 30px padding and runs
   that far off the right — the last button cut in half — while the exit
   control, placed over the same corner, sits on top of it; and it sizes the
   text for a desk. Below 768px the sheet is a column instead: the toolbar in
   its place at the top, wrapping as it must and clear of the exit control,
   and the text area (or the preview) taking the rest of the height. */
@media (max-width: 767.98px) {
    .md-editor.md-fullscreen-mode {
        display: flex;
        flex-direction: column;
        padding: 12px 16px;
    }

    .md-editor.md-fullscreen-mode .md-header {
        position: static;
        display: flex;
        flex: none;
        flex-wrap: wrap;
        align-items: center;
        gap: 4px;
        width: auto;
        padding: 0 44px 8px 0;
        border-bottom: 1px solid var(--border);
        text-align: left;
    }

    .md-editor.md-fullscreen-mode .md-input,
    .md-editor.md-fullscreen-mode .md-preview {
        flex: 1 1 auto;
        min-height: 0;
        height: auto !important;
        padding: 12px 0 !important;
        font-size: 1rem !important;
    }

    .md-editor.md-fullscreen-mode .md-fullscreen-controls {
        top: 10px;
        right: 8px;
    }

    .md-editor.md-fullscreen-mode .md-fullscreen-controls a {
        margin: 0;
    }
}

/* The page behind it is held still by .md-nooverflow on the body; it keeps
   the body's own background, which the sheet above is now matched to. */

/* Bootstrap draws the "browse" half of a file field in ::after, in its own
   light grey. */
.custom-file-label::after {
    background-color: var(--bg-accented);
    border-left: 1px solid var(--border-lifted);
    color: var(--text);
}

.md-preview table,
.markdown-content table {
    background-color: var(--bg-lifted);
    color: var(--text);
}

.md-preview table thead > tr > th,
.markdown-content table thead > tr > th {
    background-color: var(--bg-accented);
    color: var(--text-lifted);
}

.md-preview blockquote,
.markdown-content blockquote {
    border-left-color: var(--border-accented);
    color: var(--text-muted);
}

.store-order-container .store-domain-tabs li a {
    background-color: var(--bg-accented);
    color: var(--text);
}

.store-order-container .store-domain-tabs li.active a {
    background-color: var(--bg-lifted);
    color: var(--text-lifted);
}

.promo-banner {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

.upgrade .product-to-be-upgraded,
.upgrade .products .product {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

.featured-tld {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

.featured-tld .price {
    background-color: var(--bg-accented);
}

.domain-pricing .tld-row.highlighted {
    background-color: var(--ix-accent-soft);
}

.domain-pricing .tld-pricing-header div:nth-child(odd) {
    background-color: var(--bg-accented);
}

/* On-screen invoice (viewinvoice.tpl). Invoice-only rules, including the
   light palette for printing, live in ix-invoice.css. */
.invoice-container {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

.invoice-container td.total-row {
    background-color: var(--bg-accented);
}

/* ====================================================================== */
/* Order form (standard_cart)                                             */
/* ====================================================================== */

body #order-standard_cart .cart-body .products .product,
body #order-standard_cart .cart-body .products .product header,
body #order-standard_cart .domain-selection-options,
body #order-standard_cart .panel .panel-heading,
body #order-standard_cart .panel .panel-footer,
body #order-standard_cart .domain-promo-box,
body #order-standard_cart .domain-pricing .tld-pricing-header .tld-column,
body #order-standard_cart .domain-pricing .tld-pricing-header div,
body #order-standard_cart .secondary-cart-body .view-cart-tabs .nav-tabs a[aria-expanded="true"],
body .secondary-cart-body #domainRenewals {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

body #order-standard_cart .cart-body .view-cart-empty,
body #order-standard_cart .domain-selection-options .option-selected,
body #order-standard_cart .domain-pricing .tld-filters .badge {
    background-color: var(--bg-accented);
    color: var(--text);
}

/* The rest of the cart. These used to live in a child order form template,
   but that template carried nothing but CSS and broke the cart: standard_cart's
   common.tpl resolves all.min.css and scripts.min.js against the *active*
   order form, not the parent, so both 404'd and the checkout JS never ran.
   Styling the cart from the system theme avoids the whole problem. */

#order-standard_cart .products .product,
#order-standard_cart .view-cart-items .item,
#order-standard_cart .view-cart-promotion-code,
#order-standard_cart .account-select-container div.account.active,
.spotlight-tld,
.domain-checker-container .input-group-box {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

#order-standard_cart .transfer-not-eligible,
#order-standard_cart .view-cart-tabs .nav-tabs a[aria-selected="true"],
#order-standard_cart .account-select-container div.account,
#order-standard_cart .mc-promo .body,
#order-standard_cart .default-captcha,
.suggested-domains .domain-lookup-suggestions-message,
.suggested-domains .domain-lookup-suggestions-loader,
.domain-promo-box {
    background-color: var(--bg-accented);
    border-color: var(--border);
    color: var(--text);
}

/* The stock domain checker sits on a fixed yellow band, which fights a dark
   page. A neutral raised surface keeps the accent on the search field. */
.domain-checker-container {
    background-color: var(--bg-muted);
    border-bottom: 1px solid var(--border);
}

#order-standard_cart .field,
#order-standard_cart .form-control {
    background-color: var(--bg-muted);
    border-color: var(--border-lifted);
    color: var(--text);
    border-radius: var(--rounding-sm);
}

#order-standard_cart .field::placeholder,
#order-standard_cart .form-control::placeholder {
    color: var(--text-muted);
}

#order-standard_cart .field:focus,
#order-standard_cart .form-control:focus {
    border-color: var(--ix-accent);
    box-shadow: var(--ix-ring);
}

#order-standard_cart .field[disabled],
#order-standard_cart .field[readonly],
#order-standard_cart .form-control[disabled],
#order-standard_cart .form-control[readonly] {
    background-color: var(--bg-accented);
    color: var(--text-muted);
}

#order-standard_cart .domain-checker-advanced input[type="checkbox"] {
    accent-color: var(--ix-accent);
}

#order-standard_cart,
#order-standard_cart .products .product .product-desc,
#order-standard_cart .view-cart-items .item {
    color: var(--text);
}

#order-standard_cart h1,
#order-standard_cart h2,
#order-standard_cart h3,
#order-standard_cart .products .product header {
    color: var(--text-lifted);
}

#order-standard_cart .btn-primary,
#order-standard_cart .btn-order-now {
    background-color: var(--ix-accent);
    border-color: var(--ix-accent);
    color: var(--ix-accent-contrast);
}

#order-standard_cart .btn-primary:hover,
#order-standard_cart .btn-order-now:hover {
    background-color: var(--ix-accent-hover);
    border-color: var(--ix-accent-hover);
}

#order-standard_cart .cart-sidebar .list-group-item {
    background-color: var(--bg-lifted);
    border-color: var(--border);
    color: var(--text);
}

#order-standard_cart .cart-sidebar .list-group-item.active {
    background-color: var(--ix-accent-soft);
    border-color: var(--ix-accent-border);
    color: var(--text-lifted);
}

/* The sidebar is no longer built from cards — includes/sidebar.tpl renders it
   flat and ix.css owns it end to end. */

/* ====================================================================== */
/* Overlays                                                               */
/* ====================================================================== */

#fullpage-overlay {
    background-color: var(--ix-overlay);
    color: var(--text-lifted);
}
