/**
 * Site-wide color mode for non-portal Elementor / WordPress pages.
 */

html:not(.dark) .show_on_dark {
    display: none !important;
}

html.dark .show_on_light {
    display: none !important;
}

img.lmfco-brand-logo.show_on_light,
img.lmfco-brand-logo.show_on_dark {
    display: block;
    max-width: 100%;
    height: auto;
}

.lmfco-brand-logo-text {
    color: inherit;
    font-size: 1rem;
    font-weight: 600;
}

/* Auth-page floating toggle */
.lmfco-color-mode-toggle-wrap {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 99990;
}

.lmfco-color-mode-toggle {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 2147483000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid var(--fcom-primary-border, #e5e7eb);
    background: var(--fcom-primary-bg, #ffffff);
    color: var(--fcom-primary-text, #0f172a);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

#lmfco-color-mode-toggle {
    position: fixed;
    right: max(16px, env(safe-area-inset-right));
    bottom: max(16px, env(safe-area-inset-bottom));
    z-index: 2147483000;
}

.lmfco-color-mode-toggle:hover {
    background: var(--fcom-active-bg, #eef2f7);
}

html.dark .lmfco-color-mode-toggle {
    border-color: var(--fcom-primary-border, #1a2332);
    background: var(--fcom-secondary-bg, #111423);
    color: var(--fcom-primary-text, #ffffff);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html.dark .lmfco-color-mode-toggle:hover {
    background: var(--fcom-active-bg, #0f1629);
}

.lmfco-color-mode-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lmfco-color-mode-icon svg {
    display: block;
    color: currentColor;
}

/* Page shell */
html.dark,
html.dark body {
    background-color: var(--fcom-primary-bg, #0B0D1B) !important;
    color: var(--fcom-primary-text, #ffffff);
}

html.dark body .site,
html.dark body #page,
html.dark body .elementor {
    background-color: transparent;
    color: inherit;
}

/* Beat Elementor inline section backgrounds */
html.dark .elementor-section,
html.dark .e-con,
html.dark .e-con-inner,
html.dark .elementor-element.elementor-widget-heading,
html.dark .elementor-element.elementor-widget-text-editor {
    background-color: transparent !important;
}

html.dark .elementor-widget-heading .elementor-heading-title,
html.dark .elementor-widget-text-editor,
html.dark .elementor-widget-text-editor p,
html.dark .elementor-widget-icon-list .elementor-icon-list-text,
html.dark .elementor-widget-icon-list .elementor-icon-list-item {
    color: var(--fcom-primary-text, #ffffff) !important;
}

html.dark .elementor-widget-text-editor a,
html.dark .elementor-widget-heading a {
    color: var(--fcom-text-link, #60a5fa) !important;
}

/* Site/brand icons should inherit readable color in dark mode */
html.dark .elementor-icon,
html.dark .elementor-icon i,
html.dark .elementor-icon-box-icon .elementor-icon,
html.dark .elementor-widget-icon .elementor-icon {
    color: var(--fcom-primary-text, #ffffff) !important;
}

html.dark .elementor-icon svg,
html.dark .elementor-icon-box-icon .elementor-icon svg,
html.dark .elementor-widget-icon .elementor-icon svg {
    fill: currentColor !important;
    stroke: currentColor !important;
}

html.dark .elementor-social-icon,
html.dark .elementor-social-icon i,
html.dark .elementor-social-icon svg {
    color: var(--fcom-primary-text, #ffffff) !important;
}

html.dark .elementor-social-icon svg {
    fill: currentColor !important;
    stroke: currentColor !important;
}

/* Login widget */
html.dark .elementor-login label,
html.dark .elementor-login .elementor-field-group label,
html.dark .elementor-login .elementor-lost-password,
html.dark .elementor-login .elementor-register,
html.dark .elementor-login .elementor-login-separator {
    color: var(--fcom-primary-text, #ffffff) !important;
}

html.dark .elementor-login input[type="text"],
html.dark .elementor-login input[type="password"],
html.dark .elementor-login input[type="email"] {
    background: var(--fcom-secondary-content-bg, #191B2E) !important;
    border-color: var(--fcom-primary-border, #1a2332) !important;
    color: var(--fcom-primary-text, #ffffff) !important;
}

html.dark .elementor-login input[type="text"]:focus,
html.dark .elementor-login input[type="password"]:focus,
html.dark .elementor-login input[type="email"]:focus {
    border-color: var(--fcom-primary-button, #1E73BD) !important;
    box-shadow: 0 0 0 3px rgba(30, 115, 189, 0.15) !important;
}

html.dark .elementor-login .elementor-button {
    background-color: var(--fcom-primary-button, #1E73BD) !important;
    color: var(--fcom-primary-button-text, #ffffff) !important;
}

html.dark .elementor-login .elementor-remember-me {
    color: var(--fcom-secondary-text, #99A0AE) !important;
}

/* Testimonials / carousel */
html.dark .elementor-widget-testimonial-carousel .elementor-testimonial__text,
html.dark .elementor-widget-testimonial-carousel .elementor-testimonial__name,
html.dark .elementor-widget-testimonial-carousel .elementor-testimonial__title,
html.dark .elementor-widget-reviews .elementor-testimonial__text,
html.dark .elementor-widget-reviews .elementor-testimonial__name {
    color: var(--fcom-primary-text, #ffffff) !important;
}

html.dark .swiper-pagination-bullet {
    background: var(--fcom-secondary-text, #99A0AE) !important;
    opacity: 0.6;
}

html.dark .swiper-pagination-bullet-active {
    background: var(--fcom-primary-button, #1E73BD) !important;
    opacity: 1;
}

/* Generic form widgets */
html.dark .elementor-field-group label,
html.dark .elementor-field-textual,
html.dark .elementor-select-wrapper select {
    color: var(--fcom-primary-text, #ffffff);
}

html.dark .elementor-field-textual,
html.dark .elementor-select-wrapper select {
    background-color: var(--fcom-secondary-content-bg, #191B2E) !important;
    border-color: var(--fcom-primary-border, #1a2332) !important;
}
