:root {
  /* Shared accessible action colour for light surfaces (WCAG AA at body size). */
  --brand1: #2459cc;
  --qhi-surface-page: var(--bg0, #f3f7ff);
  --qhi-surface-raised: var(--panel, #ffffff);
  --qhi-surface-muted: var(--panel2, #f5f8ff);
  --qhi-text-primary: var(--text, #0b1b2b);
  --qhi-text-secondary: var(--muted, #4e6078);
  --qhi-border: var(--line, rgba(11, 27, 43, .12));
  --qhi-action: var(--brand1, #2368f2);
  --qhi-focus: #0b63e5;
  --qhi-success: var(--ok, #087f5b);
  --qhi-danger: #c92a2a;
}

html[data-theme="dark"] {
  --brand1: #9fc4ff;
  --qhi-surface-page: #07101f;
  --qhi-surface-raised: #101b2e;
  --qhi-surface-muted: #0d1728;
  --qhi-text-primary: #f3f7ff;
  --qhi-text-secondary: #b9c5d8;
  --qhi-border: rgba(226, 236, 255, .18);
  --qhi-action: #73a3ff;
  --qhi-focus: #91b7ff;
  --qhi-success: #55e0ae;
  --qhi-danger: #ff8787;
}

html:not([data-theme="dark"]) {
  --mc-blue: #2459cc;
  --mc-green: #087f5b;
  --dom-blue: #2459cc;
  --games-brand: #2459cc;
  --cart-blue: #2459cc;
  --checkout-blue: #2459cc;
  --contact-blue: #2459cc;
  --bill-blue: #2459cc;
  --sec-blue: #2459cc;
  --sup-blue: #2459cc;
  --legal-blue: #2459cc;
  --acct-blue: #2459cc;
}

html[data-theme="dark"] {
  --mc-blue: #9fc4ff;
  --mc-purple: #d2c4ff;
  --mc-green: #72e6b4;
  --dom-blue: #9fc4ff;
  --games-brand: #9fc4ff;
  --cart-blue: #9fc4ff;
  --checkout-blue: #9fc4ff;
  --contact-blue: #9fc4ff;
  --bill-blue: #9fc4ff;
  --sec-blue: #9fc4ff;
  --sup-blue: #9fc4ff;
  --legal-blue: #9fc4ff;
  --acct-blue: #9fc4ff;
}

html { scroll-behavior: smooth; }
body { color: var(--qhi-text-primary); }
body.qhi-shell--platform { min-height: 100vh; }

:where(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid var(--qhi-focus) !important;
  outline-offset: 3px !important;
}

.skip-link {
  position: fixed;
  z-index: 10000;
  top: 8px;
  left: 8px;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }

.qhi-shell-header,
.qhi-shell-footer,
.qhi-shell-header :where(a, button, summary),
.qhi-shell-footer :where(a, button) {
  color: var(--qhi-text-primary);
}

.qhi-shell-header .nav-link.is-active {
  background: color-mix(in srgb, var(--qhi-action) 12%, transparent);
  border-color: color-mix(in srgb, var(--qhi-action) 36%, transparent);
}

.qhi-shell-header--platform {
  border-bottom-color: color-mix(in srgb, var(--qhi-action) 28%, var(--qhi-border));
}

.qhi-shell--platform main,
.qhi-shell--platform [role="main"] { color: var(--qhi-text-primary); }

html[data-theme="dark"] :where(
  .qhi-service-card,
  .qhi-public-card,
  .qhi-plan-card,
  .client-card,
  .service-card,
  .cart-item,
  .checkout-card,
  dialog
) {
  background-color: var(--qhi-surface-raised);
  border-color: var(--qhi-border);
  color: var(--qhi-text-primary);
}

html[data-theme="dark"] :where(input, select, textarea) {
  background: var(--qhi-surface-muted);
  border-color: var(--qhi-border);
  color: var(--qhi-text-primary);
}

html[data-theme="dark"] :where(input, textarea)::placeholder { color: var(--qhi-text-secondary); }

html[data-theme="dark"] :where(.qhi-public-page, .qhi-domain-page, .qhi-prices-page, .qhi-not-found-page, .qhi-vps-page, .wp-page) {
  color: var(--qhi-text-primary);
}

/* Component-level contrast normalization shared by both public sites. */
html:not([data-theme="dark"]) :where(
  .qhi-vps-ram,
  .qhi-vps-price strong,
  .qhi-contact-card a,
  .qhi-contact-icon,
  .qhi-mc-price.is-main-price,
  .qhi-mc-price-current,
  .qhi-mc-price:not(.is-main-price) strong,
  .qhi-mc-benefits-toggle,
  .qhi-mc-support-badge,
  .qhi-panel-kicker,
  .qhi-sup-kicker
) { color: #2459cc !important; }

html:not([data-theme="dark"]) .qhi-mc-badge.is-custom {
  color: #087f5b !important;
}

.qhi-mc-support-option s {
  color: #405874 !important;
}

.qhi-cart-step:not(.is-active) span,
.qhi-checkout-step:not(.is-active) b {
  background: #526783;
  color: #ffffff;
}

html:not([data-theme="dark"]) .qhi-cart-step.is-active span,
html:not([data-theme="dark"]) .qhi-checkout-step.is-active b {
  background: #2459cc;
  color: #ffffff;
}

html:not([data-theme="dark"]) .qhi-games-how-number {
  background: #2459cc;
  color: #ffffff;
}

html:not([data-theme="dark"]) .qhi-games-row span {
  color: #2459cc !important;
}

body.qhi-client-admin-page :where(.qhi-sidebar-subtitle, .qhi-sidebar-info, .qhi-sidebar-info p) {
  color: #405874 !important;
  opacity: 1 !important;
}

html[data-theme="dark"] .qhi-service-card .qhi-service-price,
html[data-theme="dark"] :where(.qhi-vps-ram, .qhi-vps-price strong) {
  color: #9fc4ff;
}

html[data-theme="dark"] .qhi-mc-support-card.is-advanced .qhi-mc-support-badge,
html[data-theme="dark"] .qhi-mc-help-card.is-purple h3 {
  color: #d2c4ff;
}

html[data-theme="dark"] .qhi-dom-card-icon {
  color: #9fc4ff;
}

html[data-theme="dark"] .qhi-dom-stat span,
html[data-theme="dark"] .qhi-sec-card label {
  color: #c6d2e3;
}

html[data-theme="dark"] .qhi-games-how-number {
  background: #315f9f;
  color: #ffffff;
}

html:not([data-theme="dark"]) :where(.qhi-legal-card a, .qhi-legal-footer-note a, .qhi-legal-btn) {
  color: #2459cc !important;
}

html:not([data-theme="dark"]) :where(.qhi-acct-tab.is-active, .qhi-dom-tab.is-active, .qhi-bill-tab.is-active, .qhi-sec-tab.is-active) {
  color: #2459cc !important;
}

html[data-theme="dark"] :where(.qhi-cart-step.is-active span, .qhi-checkout-step.is-active b) {
  background: #315f9f !important;
  color: #ffffff !important;
}

html[data-theme="dark"] body.page-client-security {
  background: linear-gradient(180deg, #071120 0%, #0b1628 58%, #071120 100%) !important;
  color: #eef6ff;
}

html[data-theme="dark"] :where(
  .qhi-sec-hero,
  .qhi-sec-panel,
  .qhi-sec-tabs,
  .qhi-sec-session,
  .qhi-sec-card,
  .qhi-sec-gate-card
) {
  background: #0e1a2d !important;
  border-color: #243650 !important;
  color: #eef6ff;
}

html[data-theme="dark"] :where(.qhi-sec-hero h1, .qhi-sec-card h2, .qhi-sec-card label) {
  color: #eef6ff !important;
}

html[data-theme="dark"] .qhi-sec-card .qhi-kv {
  background: #111f34 !important;
  border-color: #325179 !important;
}

html[data-theme="dark"] :where(.qhi-sec-hero p, .qhi-sec-card p, .qhi-sec-tab) {
  color: #c6d2e3 !important;
}

html[data-theme="dark"] .qhi-sec-tab.is-active {
  color: #9fc4ff !important;
}

html[data-theme="dark"] .qhi-sec-btn {
  background: #111f34;
  border-color: #325179;
  color: #eef6ff;
}

html[data-theme="dark"] .qhi-public-hero::before { background: rgba(7, 16, 31, .82); }

html[data-theme="dark"] :where(
  .qhi-public-hero h1,
  .qhi-public-band h2,
  .qhi-domain-page h1,
  .qhi-prices-page h1,
  .qhi-price-group h2,
  .qhi-price-row strong,
  .qhi-not-found-page h1,
  .qhi-vps-hero h1,
  .qhi-vps-head h2,
  .wp-hero h1,
  .wp-offer-head h2,
  .wp-plan-main h3,
  .wp-trust h3
) { color: var(--qhi-text-primary); }

html[data-theme="dark"] :where(
  .qhi-public-lead,
  .qhi-public-band-head p,
  .qhi-public-operate p,
  .qhi-domain-intro,
  .qhi-prices-intro,
  .qhi-price-row,
  .qhi-not-found-page p,
  .qhi-vps-hero p,
  .qhi-vps-head p,
  .wp-lead,
  .wp-offer-head p,
  .wp-trust p
) { color: var(--qhi-text-secondary); }

html[data-theme="dark"] :where(
  .qhi-public-fact,
  .qhi-domain-search-panel,
  .qhi-domain-table-wrap,
  .qhi-price-group,
  .qhi-vps-fact,
  .qhi-vps-card,
  .qhi-vps-modal,
  .qhi-vps-close,
  .qhi-vps-image-option span,
  .wp-badge,
  .wp-plan
) {
  background: var(--qhi-surface-raised);
  border-color: var(--qhi-border);
  color: var(--qhi-text-primary);
}

html[data-theme="dark"] :where(
  .qhi-service-card h3,
  .qhi-domain-search-panel h2,
  .qhi-domain-table td,
  .qhi-vps-card h3,
  .qhi-vps-price,
  .qhi-vps-features,
  .qhi-vps-plan-summary strong,
  .qhi-vps-field label,
  .qhi-vps-field legend,
  .qhi-vps-image-option strong,
  .qhi-vps-final-summary strong,
  .wp-specs li
) { color: var(--qhi-text-primary); }

html[data-theme="dark"] :where(
  .qhi-service-card p,
  .qhi-domain-result,
  .qhi-vps-vat,
  .qhi-vps-help,
  .qhi-vps-image-option small,
  .wp-price span,
  .wp-note
) { color: var(--qhi-text-secondary); }

html[data-theme="dark"] :where(.qhi-domain-table th, .qhi-vps-card-head, .qhi-vps-plan-summary div, .qhi-vps-final-summary, .wp-plan-buy) {
  background: var(--qhi-surface-muted);
  border-color: var(--qhi-border);
  color: var(--qhi-text-primary);
}

html[data-theme="dark"] .qhi-domain-gate {
  background: #2a2414;
  border-color: #e2ad3f;
  color: #ffe4a8;
}

html[data-theme="dark"] .qhi-vps-note {
  background: #102849;
  border-color: var(--qhi-action);
  color: #d9e8ff;
}

html[data-theme="dark"] :where(.qhi-public-band, .wp-offer-band, .qhi-domain-table th, .qhi-domain-table td, .qhi-vps-card-head, .qhi-vps-modal-head, .wp-plan-buy) {
  border-color: var(--qhi-border);
}

[hidden] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
