/* Public-site dark mode, aligned with the native app's #0C2342 canvas. */
[data-bs-theme="dark"] {
    color-scheme: dark;
    --am-dark-canvas: #0c2342;
    --am-dark-nav: #091c35;
    --am-dark-surface: #102c4a;
    --am-dark-surface-alt: #132f50;
    --am-dark-surface-elevated: #163657;
    --am-dark-border: #294969;
    --am-dark-border-strong: #3a5d7d;
    --am-dark-text: #f4f8fc;
    --am-dark-text-secondary: #c9d7e5;
    --am-dark-text-muted: #9db1c5;
    --am-dark-accent: #9bcd32;

    --bs-body-color: var(--am-dark-text);
    --bs-body-color-rgb: 244, 248, 252;
    --bs-body-bg: var(--am-dark-canvas);
    --bs-body-bg-rgb: 12, 35, 66;
    --bs-emphasis-color: #ffffff;
    --bs-emphasis-color-rgb: 255, 255, 255;
    --bs-secondary-color: var(--am-dark-text-secondary);
    --bs-secondary-color-rgb: 201, 215, 229;
    --bs-secondary-bg: var(--am-dark-surface-alt);
    --bs-secondary-bg-rgb: 19, 47, 80;
    --bs-tertiary-color: var(--am-dark-text-muted);
    --bs-tertiary-color-rgb: 157, 177, 197;
    --bs-tertiary-bg: var(--am-dark-surface);
    --bs-tertiary-bg-rgb: 16, 44, 74;
    --bs-border-color: var(--am-dark-border);
    --bs-border-color-translucent: rgba(201, 215, 229, 0.2);
    --bs-link-color: #8fc9f4;
    --bs-link-color-rgb: 143, 201, 244;
    --bs-link-hover-color: #b7ddf8;
    --bs-link-hover-color-rgb: 183, 221, 248;
    --bs-light-rgb: 16, 44, 74;
    --bs-dark-rgb: 9, 28, 53;

    --am-color-stone-050: #102c4a;
    --am-color-stone-050-rgb: 16, 44, 74;
    --am-color-stone-100: #0c2342;
    --am-color-stone-100-rgb: 12, 35, 66;
    --am-color-stone-200: #193957;
    --am-color-stone-200-rgb: 25, 57, 87;
    --am-brand-ink: var(--am-dark-text);
    --am-brand-ink-strong: var(--am-dark-text-secondary);
    --am-brand-muted: var(--am-dark-text-muted);
    --am-brand-surface: var(--am-dark-canvas);
    --am-brand-surface-alt: var(--am-dark-surface);
    --am-brand-surface-muted: var(--am-dark-surface-alt);
    --am-brand-support: var(--am-dark-accent);
    --am-brand-support-strong: #b0dc55;
    --am-brand-info: #72b6e8;
    --am-brand-info-strong: #8fc9f4;
    --am-brand-line-soft: rgba(201, 215, 229, 0.14);
    --am-brand-line: rgba(201, 215, 229, 0.24);
    --am-brand-shadow-soft: rgba(0, 8, 20, 0.24);
    --am-brand-shadow: rgba(0, 8, 20, 0.4);
}

[data-bs-theme="dark"] body,
[data-bs-theme="dark"] .landing-body,
[data-bs-theme="dark"] .mobile-app-page {
    background: var(--am-dark-canvas);
    color: var(--am-dark-text);
}

[data-bs-theme="dark"] .navbar.bg-white,
[data-bs-theme="dark"] .bg-white,
[data-bs-theme="dark"] .bg-light,
[data-bs-theme="dark"] .landing-body .navbar {
    background: rgba(16, 44, 74, 0.97) !important;
    border-color: var(--am-dark-border) !important;
}

[data-bs-theme="dark"] .navbar-light {
    --bs-navbar-color: var(--am-dark-text-secondary);
    --bs-navbar-hover-color: #ffffff;
    --bs-navbar-active-color: #ffffff;
    --bs-navbar-brand-color: var(--am-dark-text);
    --bs-navbar-brand-hover-color: #ffffff;
    --bs-navbar-toggler-border-color: var(--am-dark-border);
}

[data-bs-theme="dark"] .navbar-toggler-icon {
    filter: invert(1) grayscale(1) brightness(1.7);
}

[data-bs-theme="dark"] :is(.landing-body .navbar-brand, .landing-body .nav-link, .navbar-brand, h1, h2, h3, h4, h5, h6, .text-dark) {
    color: var(--am-dark-text) !important;
}

[data-bs-theme="dark"] :is(.text-muted, .form-text) {
    color: var(--am-dark-text-muted) !important;
}

[data-bs-theme="dark"] :is(.card, .modal-content, .dropdown-menu, .list-group-item, .accordion-item, .offcanvas, .popover, .toast) {
    background-color: var(--am-dark-surface);
    border-color: var(--am-dark-border);
    color: var(--am-dark-text);
}

[data-bs-theme="dark"] :is(.card-header, .card-footer, .modal-header, .modal-footer, .accordion-button, .dropdown-header) {
    background-color: var(--am-dark-surface-alt);
    border-color: var(--am-dark-border);
    color: var(--am-dark-text);
}

[data-bs-theme="dark"] :is(.form-control, .form-select, .input-group-text) {
    background-color: var(--am-dark-surface-alt);
    border-color: var(--am-dark-border-strong);
    color: var(--am-dark-text);
}

[data-bs-theme="dark"] :is(.form-control, .form-select)::placeholder {
    color: var(--am-dark-text-muted);
    opacity: 1;
}

[data-bs-theme="dark"] .table {
    --bs-table-color: var(--am-dark-text);
    --bs-table-bg: transparent;
    --bs-table-border-color: var(--am-dark-border);
    --bs-table-striped-color: var(--am-dark-text);
    --bs-table-striped-bg: rgba(255, 255, 255, 0.035);
    --bs-table-hover-color: #ffffff;
    --bs-table-hover-bg: rgba(143, 201, 244, 0.1);
}

[data-bs-theme="dark"] .footer,
[data-bs-theme="dark"] .landing-body .footer {
    background: var(--am-dark-nav) !important;
    border-color: var(--am-dark-border) !important;
    color: var(--am-dark-text-muted) !important;
}

[data-bs-theme="dark"] :is(
    .card-field,
    .field-section-card,
    .field-mini-panel,
    .card-modern .card-header,
    .card-modern .card-footer,
    .guest-language-dropdown__toggle,
    .guest-language-dropdown__menu,
    .landing-anchor-nav,
    .converter-faq .accordion-item,
    .landing-proof-band,
    .landing-editorial-card--feature,
    .unit-converter-page .converter-hero-panel,
    .mobile-download-card,
    .mobile-app-screenshot-card,
    .mobile-app-setup-card
) {
    background: var(--am-dark-surface) !important;
    border-color: var(--am-dark-border) !important;
    color: var(--am-dark-text) !important;
}

[data-bs-theme="dark"] .landing-page {
    --landing-forest: #091c35;
    --landing-forest-soft: #102c4a;
    --landing-moss: #5f8f31;
    --landing-moss-strong: #79ad39;
    --landing-sage: #72b6e8;
    --landing-cream: var(--am-dark-canvas);
    --landing-card: var(--am-dark-surface);
    --landing-ink: var(--am-dark-text);
    --landing-muted: var(--am-dark-text-secondary);
    --landing-line: var(--am-dark-border);
    --landing-line-soft: rgba(201, 215, 229, 0.14);
    --landing-gold: var(--am-dark-accent);
    --landing-gold-strong: #b0dc55;
}

[data-bs-theme="dark"] :is(.landing-hero, .landing-page--visual .landing-hero--image) {
    background: linear-gradient(135deg, #0c2342 0%, #102c4a 58%, #15395d 100%) !important;
    border-color: var(--am-dark-border) !important;
    color: var(--am-dark-text) !important;
}

[data-bs-theme="dark"] .landing-section--muted {
    background: var(--am-dark-surface-alt) !important;
}

[data-bs-theme="dark"] :is(
    .landing-path-card,
    .landing-product-shot,
    .landing-timeline-step,
    .landing-proof-shot,
    .landing-role-card
) {
    background: var(--am-dark-surface) !important;
    border-color: var(--am-dark-border) !important;
    color: var(--am-dark-text) !important;
}

[data-bs-theme="dark"] :is(
    .landing-path-card h3,
    .landing-timeline-step h3,
    .landing-proof-shot strong,
    .landing-role-card h3
) {
    color: var(--am-dark-text) !important;
}

[data-bs-theme="dark"] :is(
    .landing-path-card p,
    .landing-timeline-step p,
    .landing-proof-band p,
    .landing-proof-shot p,
    .landing-role-card p
) {
    color: var(--am-dark-text-secondary) !important;
}

[data-bs-theme="dark"] :is(
    .landing-section-label,
    .landing-proof-band__label,
    .landing-side-card__label,
    .landing-preview-card__eyebrow
) {
    color: var(--am-dark-accent) !important;
}

[data-bs-theme="dark"] .landing-anchor-nav a {
    color: var(--am-dark-text-secondary) !important;
}

[data-bs-theme="dark"] .landing-anchor-nav a:hover,
[data-bs-theme="dark"] .landing-anchor-nav a:focus {
    color: #ffffff !important;
}

[data-bs-theme="dark"] .landing-inline-link {
    color: var(--am-dark-accent) !important;
}

[data-bs-theme="dark"] :is(
    .landing-product-shot strong,
    .landing-product-shot p
) {
    color: var(--am-dark-text) !important;
}

[data-bs-theme="dark"] .landing-product-shot p {
    color: var(--am-dark-text-secondary) !important;
}

[data-bs-theme="dark"] .landing-proof-band .btn-outline-dark {
    color: var(--am-dark-text) !important;
    border-color: var(--am-dark-text-secondary) !important;
}

[data-bs-theme="dark"] .landing-tool-card .btn-light {
    color: #111827 !important;
}

[data-bs-theme="dark"] :is(
    .landing-title,
    .landing-section-heading h2,
    .landing-proof-band h3,
    .landing-screenshot-hero__caption,
    .landing-preview-metric strong,
    .unit-converter-page .converter-hero-title,
    .unit-converter-page .converter-content-card h3,
    .mobile-download-card h3,
    .mobile-app-setup-card h3,
    .guest-language-dropdown__toggle,
    .guest-language-dropdown__item,
    .card-field dd,
    .field-mini-panel__title
) {
    color: var(--am-dark-text) !important;
}

[data-bs-theme="dark"] :is(
    .landing-lead,
    .landing-body-copy,
    .landing-section-heading p,
    .landing-home-faq__item p,
    .landing-screenshot-hero__caption p,
    .unit-converter-page .converter-family-band p,
    .mobile-download-card p,
    .mobile-app-setup-card p,
    .guest-language-dropdown__name,
    .card-field dt,
    .card-field .card-subtitle
) {
    color: var(--am-dark-text-secondary) !important;
}

[data-bs-theme="dark"] .landing-hero-link {
    color: var(--am-dark-accent) !important;
}

/* QR modules intentionally remain white for reliable scanner contrast. */
[data-bs-theme="dark"] .mobile-app-qr img {
    background: #ffffff;
}
