/* Public-site theme layer. The control itself is shared with the admin app. */
html[data-theme="dark"] {
    color-scheme: dark;
    --site-page: #0f172a;
    --site-surface: #172033;
    --site-surface-raised: #202c42;
    --site-border: #334155;
    --site-text: #e5edf8;
    --site-muted: #a8b5c8;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background: var(--site-page) !important;
    color: var(--site-text) !important;
}

html[data-theme="dark"] body,
html[data-theme="dark"] .main,
html[data-theme="dark"] .products-page,
html[data-theme="dark"] .request-page {
    background: var(--site-page) !important;
    color: var(--site-text) !important;
}

/* Utility bar and navigation. */
html[data-theme="dark"] .utility-bar {
    background: #111a2b;
    border-color: var(--site-border);
}

html[data-theme="dark"] .utility-bar a {
    color: #bfc9ff;
}

html[data-theme="dark"] .utility-bar a:hover {
    color: #fff;
}

html[data-theme="dark"] .main-navbar,
html[data-theme="dark"] .main-navbar.scrolled,
html[data-theme="dark"] .mobile-menu,
html[data-theme="dark"] .dropdown-menu,
html[data-theme="dark"] .user-menu-dropdown {
    background: rgba(23, 32, 51, .97) !important;
    border-color: var(--site-border);
}

html[data-theme="dark"] .nav-link,
html[data-theme="dark"] .dropdown-section-title,
html[data-theme="dark"] .dropdown-item,
html[data-theme="dark"] .user-menu-item,
html[data-theme="dark"] .mobile-menu-toggle span {
    color: var(--site-text);
}

html[data-theme="dark"] .dropdown-item-description {
    color: var(--site-muted);
}

html[data-theme="dark"] .main-navbar .navbar-nav .nav-link {
    color: var(--site-text) !important;
}

html[data-theme="dark"] .main-navbar .navbar-nav .nav-link:hover,
html[data-theme="dark"] .main-navbar .navbar-nav .nav-link.active {
    color: #ff9b82 !important;
}

html[data-theme="dark"] .main-navbar .dropdown-arrow {
    border-top-color: var(--site-text);
}

html[data-theme="dark"] .mobile-nav .nav-link,
html[data-theme="dark"] .mobile-actions,
html[data-theme="dark"] .user-menu-item-strong {
    border-color: var(--site-border);
}

/* Shared content surfaces and Bootstrap components. */
html[data-theme="dark"] :is(
    .hero-gradient,
    .product-hero,
    .product-sections,
    .product-all-features,
    .feature-card,
    .mini-card,
    .stat-card,
    .pricing-card,
    .trust-badge,
    .calculator-section,
    .app-card,
    .comparison-table,
    .card,
    .modal-content,
    .accordion-item,
    .list-group-item,
    .form-control,
    .form-select,
    .input-group-text,
    .table,
    .table-responsive
) {
    background-color: var(--site-surface) !important;
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
}

html[data-theme="dark"] .hero-gradient {
    background-image:
        radial-gradient(900px 500px at 10% 10%, rgba(135, 90, 123, .32), transparent 60%),
        radial-gradient(900px 500px at 90% 20%, rgba(108, 99, 255, .25), transparent 60%),
        linear-gradient(#0f172a, #0f172a) !important;
}

html[data-theme="dark"] .hero-section {
    background: linear-gradient(135deg, #172033 0%, #243047 100%) !important;
}

html[data-theme="dark"] :is(
    .hero-title,
    .hero-subtitle,
    .hero-headline,
    .brand-hero .hero-headline,
    .brand-hero .hero-subtitle,
    .hero-gradient .brand-hero,
    .section-title,
    .product-hero-title,
    .product-hero-desc,
    .product-section-title,
    .product-section-body,
    .features-header h2,
    .features-header p,
    .feature-card h3,
    .plan-name,
    .calculator-title,
    .feature-list li,
    .text-dark
) {
    color: var(--site-text) !important;
}

html[data-theme="dark"] :is(
    .product-hero-eyebrow,
    .plan-period,
    .text-muted,
    .price-note,
    .hero-subtitle
) {
    color: var(--site-muted) !important;
}

html[data-theme="dark"] :is(.product-section, .product-all-features) {
    border-color: var(--site-border) !important;
}

html[data-theme="dark"] :is(.btn-ghost, .btn-outline-light) {
    background: var(--site-surface-raised) !important;
    border-color: var(--site-border) !important;
    color: var(--site-text) !important;
}

html[data-theme="dark"] :is(.form-control, .form-select, .input-group-text) {
    color: var(--site-text) !important;
}

html[data-theme="dark"] :is(.form-control, .form-select)::placeholder {
    color: var(--site-muted);
}

html[data-theme="dark"] :is(.table, .table > :not(caption) > * > *) {
    --bs-table-bg: var(--site-surface);
    --bs-table-color: var(--site-text);
    --bs-table-border-color: var(--site-border);
    color: var(--site-text) !important;
    border-color: var(--site-border) !important;
}

html[data-theme="dark"] :is(.table-striped > tbody > tr:nth-of-type(odd) > *, .table-hover > tbody > tr:hover > *) {
    --bs-table-accent-bg: rgba(255, 255, 255, .06);
    color: var(--site-text) !important;
}

html[data-theme="dark"] .mockup-content {
    background-color: var(--site-surface-raised) !important;
}

/* Homepage statistics and product preview. */
html[data-theme="dark"] .stats-section {
    background:
        radial-gradient(circle at 12% 0%, rgba(135, 90, 123, .28), transparent 38%),
        radial-gradient(circle at 88% 100%, rgba(108, 99, 255, .23), transparent 42%),
        #111a2b !important;
}

html[data-theme="dark"] .stats-section .stat-card {
    background: rgba(32, 44, 66, .82) !important;
    border: 1px solid var(--site-border) !important;
    border-radius: 16px;
    box-shadow: 0 16px 32px rgba(0, 0, 0, .2);
    height: 100%;
    min-height: 164px;
}

html[data-theme="dark"] .stats-section .stat-number {
    color: #b5a4ff !important;
    font-size: clamp(2.5rem, 5vw, 3.25rem);
    line-height: 1.1;
}

html[data-theme="dark"] .stats-section .stat-label {
    color: #d7e0ed !important;
    margin-top: .65rem;
}

html[data-theme="dark"] .demo-mockup {
    background: #172033 !important;
    border: 1px solid var(--site-border);
    box-shadow: 0 24px 64px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] .demo-mockup .mockup-header {
    background: #202c42 !important;
    border: 1px solid #334155;
}

html[data-theme="dark"] .demo-mockup .mockup-content {
    background: #0b1220 !important;
    border: 1px solid #334155;
}

/* High contrast is available independently of the selected colour theme. */
.utility-action {
    appearance: none;
    background: none;
    border: 0;
    color: #5c6ac4;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 500;
    margin-right: 24px;
    padding: 0;
}

.utility-action:hover,
.utility-action:focus-visible {
    color: #4c5ac0;
}

.utility-action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}

html[data-theme="dark"] .utility-action {
    color: #bfc9ff;
}

html[data-contrast="high"] {
    color-scheme: dark;
    --site-page: #000;
    --site-surface: #000;
    --site-surface-raised: #000;
    --site-border: #fff;
    --site-text: #fff;
    --site-muted: #fff;
}

html[data-contrast="high"],
html[data-contrast="high"] body,
html[data-contrast="high"] :is(.main, .products-page, .request-page) {
    background: #000 !important;
    color: #fff !important;
}

html[data-contrast="high"] :is(
    .utility-bar,
    .main-navbar,
    .main-navbar.scrolled,
    .mobile-menu,
    .dropdown-menu,
    .user-menu-dropdown,
    .hero-gradient,
    .product-hero,
    .product-sections,
    .product-all-features,
    .feature-card,
    .mini-card,
    .stat-card,
    .pricing-card,
    .trust-badge,
    .calculator-section,
    .app-card,
    .comparison-table,
    .stats-section,
    .card,
    .modal-content,
    .accordion-item,
    .list-group-item,
    .form-control,
    .form-select,
    .input-group-text,
    .table,
    .table-responsive,
    .btn-ghost,
    .btn-outline-light
) {
    background: #000 !important;
    background-image: none !important;
    border-color: #fff !important;
    color: #fff !important;
}

html[data-contrast="high"] .stats-section .stat-card,
html[data-contrast="high"] .demo-mockup,
html[data-contrast="high"] .demo-mockup .mockup-header,
html[data-contrast="high"] .demo-mockup .mockup-content {
    background: #000 !important;
    border-color: #fff !important;
}

html[data-contrast="high"] :is(.stats-section .stat-number, .stats-section .stat-label) {
    color: #fff !important;
}

html[data-contrast="high"] :is(
    a,
    .utility-action,
    .nav-link,
    .dropdown-item,
    .user-menu-item,
    .product-hero-eyebrow,
    .plan-price,
    .feature-list li i
) {
    color: #ffff00 !important;
}

html[data-contrast="high"] :is(
    .hero-title,
    .hero-subtitle,
    .hero-headline,
    .brand-hero .hero-headline,
    .brand-hero .hero-subtitle,
    .hero-gradient .brand-hero,
    .section-title,
    .product-hero-title,
    .product-hero-desc,
    .product-section-title,
    .product-section-body,
    .features-header h2,
    .features-header p,
    .feature-card h3,
    .plan-name,
    .calculator-title,
    .feature-list li,
    .text-dark,
    .text-muted,
    .price-note,
    .dropdown-section-title,
    .dropdown-item-description,
    .mobile-menu-toggle span
) {
    color: #fff !important;
}

html[data-contrast="high"] :is(button, .btn, input, select, textarea) {
    border: 2px solid #fff !important;
}

html[data-contrast="high"] :is(button, .btn) {
    background: #000 !important;
    color: #ffff00 !important;
}

html[data-contrast="high"] .utility-contrast-toggle[aria-pressed="true"] {
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}
