/* Landing follows the same persisted light/dark preference as the reserved pages. */
html[data-bmf-dark-active="true"] .home-page {
    color-scheme: dark;
    --home-dark-bg: #191a23;
    --home-dark-panel: #23242f;
    --home-dark-panel-raised: #2b2c38;
    --home-dark-border: #44404e;
    --home-dark-ink: #f6eff4;
    --home-dark-copy: #c9bdc8;
    --home-dark-accent: #ea88af;
    --home-dark-accent-hover: #f4a0c5;
    background: var(--home-dark-bg);
    color: var(--home-dark-ink);
}

html[data-bmf-dark-active="true"] .home-page :is(.home-header, .home-footer) {
    background: #22222d;
    color: var(--home-dark-copy);
    border-color: var(--home-dark-border);
}
html[data-bmf-dark-active="true"] .home-page .home-header {
    box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}

/* Use solid text fills: original logo ink is too dark over dark header. */
html[data-bmf-dark-active="true"] :is(.home-header, .home-footer, .bmf-role-header) .home-logo > span:first-child,
html[data-bmf-dark-active="true"] :is(.home-header, .home-footer, .bmf-role-header) .home-logo > span:last-child {
    color: #f9f0f6 !important;
    -webkit-text-fill-color: #f9f0f6 !important;
    background: none !important;
    text-shadow: none;
}
html[data-bmf-dark-active="true"] :is(.home-header, .home-footer, .bmf-role-header) .home-logo > span:nth-child(2) {
    color: #ec88b2 !important;
    -webkit-text-fill-color: #ec88b2 !important;
    background: none !important;
}

html[data-bmf-dark-active="true"] .home-page :is(
    .home-header__nav a,
    .home-footer nav a,
    .home-header__toggle,
    .home-header__login
) {
    color: var(--home-dark-ink);
}
html[data-bmf-dark-active="true"] .home-page :is(.home-header__nav a, .home-footer nav a):hover {
    color: var(--home-dark-accent-hover);
}
html[data-bmf-dark-active="true"] .home-page :is(.home-header__login, .home-header__toggle) {
    background-color: var(--home-dark-panel-raised);
    border-color: var(--home-dark-border);
}
html[data-bmf-dark-active="true"] .home-page .home-header__nav.is-open {
    background: #22222d;
    border-color: var(--home-dark-border);
}

html[data-bmf-dark-active="true"] .home-page :is(
    .home-hero,
    .home-how,
    .home-faq,
    .home-secondary-section
) {
    background-color: var(--home-dark-bg);
    color: var(--home-dark-ink);
}
html[data-bmf-dark-active="true"] .home-page :is(
    .home-band,
    .home-verification,
    .home-discovery,
    .home-results
) {
    background: #20212b;
    color: var(--home-dark-ink);
    border-color: var(--home-dark-border);
}
html[data-bmf-dark-active="true"] .home-page :is(
    h1, h2, h3,
    .home-doctor-card h3,
    .home-doctor-card strong,
    .home-treatment-link strong,
    .home-city-card strong,
    .home-no-results h3
) {
    color: var(--home-dark-ink);
}
html[data-bmf-dark-active="true"] .home-page :is(
    p,
    .home-hero__lead,
    .home-hero__assurances,
    .home-doctor-card__city,
    .home-doctor-card__desc,
    .home-section-intro p,
    .home-partner p,
    .home-how__grid p,
    .home-verification__grid p
) {
    color: var(--home-dark-copy);
}
html[data-bmf-dark-active="true"] .home-page :is(
    .home-section-label,
    .home-verification__number,
    .home-text-link,
    .home-doctor-card__action,
    .home-doctor-card__specialty,
    .home-doctor-card__details strong
) {
    color: var(--home-dark-accent);
}

/* Search, discovery and profile cards. */
html[data-bmf-dark-active="true"] .home-page :is(
    .home-hero__search,
    .home-hero__search-field,
    .home-hero__result,
    .home-hero__visual,
    .home-discovery__panel,
    .home-cities-grid .home-city-card,
    .home-how__grid article,
    .home-doctor-card,
    .home-no-results,
    .home-doctor-card__details,
    .home-faq__items > *,
    .home-faq__items details
) {
    background-color: var(--home-dark-panel);
    border-color: var(--home-dark-border);
    color: var(--home-dark-ink);
    box-shadow: none;
}
html[data-bmf-dark-active="true"] .home-page .home-hero__visual {
    background-image: linear-gradient(145deg, #3d3041, #292a37);
}
html[data-bmf-dark-active="true"] .home-page .home-hero__visual span {
    color: #e4d2df;
}
html[data-bmf-dark-active="true"] .home-page :is(
    .home-hero__search-field,
    .home-treatments-list,
    .home-treatment-link,
    .home-cities-grid .home-city-card,
    .home-doctor-card,
    .home-faq__items > *
) {
    border-color: var(--home-dark-border);
}
html[data-bmf-dark-active="true"] .home-page :is(
    .home-treatment-link,
    .home-city-card,
    .home-outline-button,
    .home-doctor-card__action
) {
    color: var(--home-dark-ink);
}
html[data-bmf-dark-active="true"] .home-page :is(
    .home-treatment-link:hover,
    .home-city-card:hover,
    .home-outline-button:hover
) {
    background-color: var(--home-dark-panel-raised);
}
html[data-bmf-dark-active="true"] .home-page :is(
    .home-treatment-link span,
    .home-city-card span,
    .home-doctor-card__specialty,
    .home-hero__search-field > span,
    .home-faq__items summary
) {
    color: #e9a5c2;
}
html[data-bmf-dark-active="true"] .home-page :is(
    .home-hero__search input,
    .home-hero__search select
) {
    color: var(--home-dark-ink);
    background-color: var(--home-dark-panel);
    border-color: var(--home-dark-border);
}
html[data-bmf-dark-active="true"] .home-page .home-hero__search :is(input,select):focus-visible {
    outline: 2px solid var(--home-dark-accent);
    outline-offset: 2px;
}
html[data-bmf-dark-active="true"] .home-page .home-hero__search input::placeholder {
    color: #b3a4b5;
}
html[data-bmf-dark-active="true"] .home-page .home-hero__search select option {
    background-color: var(--home-dark-panel);
    color: var(--home-dark-ink);
}

/* Primary CTAs remain pink; secondary ones remain readable. */
html[data-bmf-dark-active="true"] .home-page :is(
    .home-hero__search-button,
    .home-partner__button
) {
    background-color: #bb557f;
    color: #ffffff;
    border-color: #bb557f;
}
html[data-bmf-dark-active="true"] .home-page :is(
    .home-hero__search-button:hover,
    .home-partner__button:hover
) {
    background-color: #d16d96;
    border-color: #d16d96;
}
html[data-bmf-dark-active="true"] .home-page .home-outline-button {
    background: var(--home-dark-panel-raised);
    border-color: var(--home-dark-border);
}
html[data-bmf-dark-active="true"] .home-page .home-step-icon {
    background: #4a3242;
    border-color: #86536c;
    color: #f2afcc;
}
html[data-bmf-dark-active="true"] .home-page .home-doctor-card__avatar {
    background: #51394e;
    color: #f4c8dc;
}

/* Promotional block and FAQs. */
html[data-bmf-dark-active="true"] .home-page .home-partner {
    background: linear-gradient(120deg, #362937, #252631);
    border-color: #62435b;
    color: var(--home-dark-ink);
}
html[data-bmf-dark-active="true"] .home-page .home-faq__items :is(
    .bmf-accordion,
    .bmf-accordion__item,
    .bmf-accordion-item,
    details,
    button,
    summary
) {
    background-color: var(--home-dark-panel);
    color: var(--home-dark-ink);
    border-color: var(--home-dark-border);
}
html[data-bmf-dark-active="true"] .home-page .home-faq__items :is(
    .bmf-accordion__content,
    .bmf-accordion-content,
    p
) {
    color: var(--home-dark-copy);
}

/* Authentication dialog can be mounted outside .home-page by the modal component. */
html[data-bmf-dark-active="true"] :is(
    .bmf-modal,
    .bmf-modal-content,
    .bmf-modal__panel,
    .bmf-modal__dialog,
    .bmf-dialog
) {
    background-color: #23242f;
    border-color: #44404e;
    color: #f6eff4;
}
html[data-bmf-dark-active="true"] :is(.bmf-modal, .bmf-modal__panel, .bmf-modal__dialog) :is(h2, h3, label) {
    color: #f6eff4;
}
html[data-bmf-dark-active="true"] .home-login-form :is(input, select, textarea) {
    background-color: #1c1d27;
    border-color: #44404e;
    color: #f6eff4;
}
html[data-bmf-dark-active="true"] .home-login-form input::placeholder {
    color: #aa9cae;
}
html[data-bmf-dark-active="true"] .bmf-auth-bottom {
    color: #c9bdc8;
}
html[data-bmf-dark-active="true"] .bmf-auth-bottom a {
    color: #ec9fc1;
}
