/* Public light/dark theme. Light mode intentionally inherits the existing design. */
.site-theme-toggle {
    position: relative;
    display: inline-flex;
    flex: 0 0 40px;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(15, 152, 188, 0.18);
    border-radius: 1rem;
    background: rgba(15, 152, 188, 0.08);
    color: #0f98bc;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.site-theme-toggle:hover {
    border-color: rgba(15, 152, 188, 0.38);
    background: rgba(15, 152, 188, 0.14);
    transform: translateY(-1px);
}

.site-theme-toggle:focus-visible {
    outline: 3px solid rgba(15, 152, 188, 0.22);
    outline-offset: 2px;
}

.site-theme-toggle__sun {
    display: none;
}

[data-theme="dark"] .site-theme-toggle__moon {
    display: none;
}

[data-theme="dark"] .site-theme-toggle__sun {
    display: block;
}

.public-auth-theme-toggle {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 52, 66, 0.12);
}

/* Navy palette for every public route. */
[data-theme="dark"] body.site-page,
[data-theme="dark"] body.site-doctors-route,
[data-theme="dark"] body.public-auth-page {
    --site-brand: #29c6e6;
    --site-brand-soft: rgba(41, 198, 230, 0.12);
    --site-outer-bg: #06111f;
    --site-surface: #0d2033;
    --site-surface-2: #122a40;
    --site-text: #eef8ff;
    --site-text-muted: #9db4c7;
    --site-border: rgba(153, 196, 220, 0.16);
    --imteb-primary: #29c6e6;
    --imteb-primary-soft: rgba(41, 198, 230, 0.12);
    --imteb-page-bg: #06111f;
    --imteb-text: #eef8ff;
    --imteb-muted: #9db4c7;
    --imteb-line: rgba(153, 196, 220, 0.16);
    --imteb-shadow: 0 14px 38px rgba(0, 0, 0, 0.3);
    --public-auth-primary: #29c6e6;
    --public-auth-text: #eef8ff;
    --public-auth-muted: #9db4c7;
    background: radial-gradient(circle at 88% -8%, rgba(21, 126, 164, 0.22), transparent 34%),
                linear-gradient(180deg, #071728 0%, #050d19 100%) !important;
    color: var(--imteb-text) !important;
    color-scheme: dark;
}

[data-theme="dark"] body.site-page .site-main,
[data-theme="dark"] body.public-site-reference .site-page-container,
[data-theme="dark"] body.public-site-reference #kt_app_content_container.site-page-container {
    background: transparent !important;
}

[data-theme="dark"] body.site-page :is(
    .site-header-inner,
    .site-footer-inner,
    .card:not(.bg-primary):not(.bg-success):not(.bg-danger):not(.bg-warning):not(.bg-info),
    .modal-content,
    .dropdown-menu,
    .accordion-item,
    .list-group-item
) {
    border-color: var(--site-border) !important;
    background-color: var(--site-surface) !important;
    color: var(--site-text) !important;
}

[data-theme="dark"] body.site-page :is(.form-control, .form-select, .header-search) {
    border-color: var(--site-border) !important;
    background-color: var(--site-surface-2) !important;
    color: var(--site-text) !important;
}

[data-theme="dark"] body.site-page :is(.dropdown-item, .accordion-button, .list-group-item, .site-header-nav .nav-link) {
    color: var(--site-text) !important;
}

[data-theme="dark"] body.public-site-reference .site-header-inner {
    border: 1px solid var(--imteb-line) !important;
    background: rgba(13, 32, 51, 0.94) !important;
    box-shadow: var(--imteb-shadow) !important;
    backdrop-filter: blur(22px);
}

[data-theme="dark"] body.public-site-reference .site-header-brand img,
[data-theme="dark"] body.public-site-reference .site-footer-brand img,
[data-theme="dark"] .public-auth-logo,
[data-theme="dark"] body.public-site-reference :is(.imteb-doctors-intro, .imteb-service-pill, .imteb-doctor-card__badges, .imteb-doctor-card__centers, .imteb-clinic-specialities, .imteb-clinic-insurance-card) img {
    mix-blend-mode: normal !important;
}

[data-theme="dark"] body.public-site-reference .site-header-nav .nav-link {
    color: #bdd0df !important;
}

[data-theme="dark"] body.public-site-reference .site-header-nav .nav-link:hover,
[data-theme="dark"] body.public-site-reference .site-header-nav .nav-link.active {
    color: #f4fbff !important;
}

[data-theme="dark"] body.public-site-reference .site-doctors-support,
[data-theme="dark"] .site-theme-toggle {
    border-color: rgba(41, 198, 230, 0.22);
    background: rgba(41, 198, 230, 0.11) !important;
    color: #56d4ed !important;
}

[data-theme="dark"] body.public-site-reference .site-navbar-toggler {
    border-color: var(--imteb-line) !important;
    background: #122a40 !important;
}

[data-theme="dark"] body.public-site-reference .navbar-collapse.show,
[data-theme="dark"] body.public-site-reference .navbar-collapsing {
    background: #0d2033;
}

/* Shared cards and elevated surfaces. */
[data-theme="dark"] body.public-site-reference :is(
    .imteb-filter-card,
    .imteb-filter-modal .modal-content,
    .imteb-results-toolbar,
    .imteb-doctors-intro,
    .imteb-doctors-seo,
    .imteb-doctor-card,
    .imteb-empty-state,
    .imteb-doctor-profile-card,
    .imteb-booking-card,
    .imteb-center-selector,
    .imteb-doctor-faq-card,
    .imteb-doctor-reviews-card,
    .imteb-appointment-modal .modal-content,
    .imteb-review-modal,
    .imteb-clinic-profile-card,
    .imteb-clinic-physicians-card,
    .imteb-clinic-services-card,
    .imteb-clinic-reviews-card,
    .imteb-clinic-contact-card,
    .imteb-clinic-insurance-card,
    .imteb-clinic-faq-card,
    .public-about-feature-grid article
) {
    border-color: var(--imteb-line) !important;
    background: #0d2033 !important;
    color: var(--imteb-text) !important;
    box-shadow: var(--imteb-shadow) !important;
}

[data-theme="dark"] body.public-site-reference :is(
    .imteb-doctor-detail,
    .imteb-clinic-detail,
    .imteb-filter-heading,
    .imteb-filter-field,
    .imteb-radio-group,
    .imteb-mobile-tool,
    .imteb-doctors-intro,
    .imteb-doctors-seo,
    .imteb-doctor-card,
    .imteb-doctor-profile-card,
    .imteb-booking-card,
    .imteb-center-selector,
    .imteb-doctor-faq-card,
    .imteb-doctor-reviews-card,
    .imteb-clinic-detail,
    .imteb-clinic-profile-card,
    .imteb-clinic-physicians-card,
    .imteb-clinic-services-card,
    .imteb-clinic-reviews-card,
    .imteb-clinic-contact-card,
    .imteb-clinic-insurance-card,
    .imteb-clinic-faq-card
) {
    color: var(--imteb-text) !important;
}

[data-theme="dark"] body.public-site-reference :is(
    .imteb-doctor-card__identity h2,
    .imteb-doctor-card__meta,
    .imteb-doctor-profile-card__identity h1,
    .imteb-doctor-profile-card__meta,
    .imteb-booking-card__head a,
    .imteb-service-pill,
    .imteb-doctor-faq-card .accordion-button,
    .imteb-clinic-profile-card__identity h1,
    .imteb-clinic-physician h3 a,
    .imteb-clinic-faq-card .accordion-button,
    .imteb-appointment-doctor h2,
    .imteb-service-accordion .accordion-button,
    .imteb-date-list > button,
    .imteb-date-list > button b,
    .public-home-kicker,
    .public-home-hero > h1,
    .public-home-section-heading h2,
    .public-about-copy h1,
    .public-about-feature-grid h3,
    .public-about-services h2
) {
    color: var(--imteb-text) !important;
}

[data-theme="dark"] body.public-site-reference :is(
    .imteb-consult-tabs button,
    .imteb-results-count,
    .imteb-sort-links button,
    .imteb-doctor-card__identity > p,
    .imteb-doctor-card__address,
    .imteb-doctor-profile-card__identity p,
    .imteb-doctor-about__text,
    .imteb-booking-card__address,
    .imteb-doctor-faq-card .accordion-body,
    .imteb-review-list article p,
    .imteb-review-list article time,
    .imteb-appointment-doctor p,
    .imteb-service-accordion .accordion-button small,
    .imteb-time-list > p,
    .imteb-empty-appointment,
    .imteb-selected-appointment small,
    .imteb-clinic-profile-card__identity p,
    .imteb-clinic-about__text,
    .imteb-clinic-contact-row p,
    .imteb-clinic-section-heading p,
    .imteb-clinic-physician__identity p,
    .imteb-clinic-services-list p,
    .imteb-clinic-empty,
    .imteb-clinic-empty p,
    .imteb-clinic-empty-text,
    .public-home-section-heading p,
    .public-home-service-grid article > p,
    .public-about-copy p,
    .public-about-services p
) {
    color: var(--imteb-muted) !important;
}

/* Forms, filters, pagination and dropdowns. */
[data-theme="dark"] body.public-site-reference :is(
    .imteb-filter-field input,
    .imteb-filter-field select,
    .imteb-review-modal textarea,
    .form-control,
    .form-select
) {
    border-color: var(--imteb-line) !important;
    background-color: #10263b !important;
    color: var(--imteb-text) !important;
}

[data-theme="dark"] body.public-site-reference :is(input, textarea)::placeholder {
    color: #7891a5 !important;
}

[data-theme="dark"] body.public-site-reference :is(
    .imteb-type-card,
    .imteb-center-selector button,
    .imteb-clinic-physician,
    .imteb-clinic-services-list article,
    .imteb-service-accordion .accordion-item,
    .imteb-review-list article,
    .imteb-pagination .page-link,
    .dropdown-menu
) {
    border-color: var(--imteb-line) !important;
    background: #10263b !important;
    color: var(--imteb-text) !important;
}

[data-theme="dark"] body.public-site-reference :is(
    .imteb-type-card.is-active,
    .imteb-center-selector button.is-selected,
    .imteb-pagination .active > .page-link,
    .imteb-date-list > button.is-selected,
    .imteb-time-list > button.is-selected,
    .imteb-time-list > button:hover
) {
    background: var(--imteb-primary) !important;
    color: #04121f !important;
}

[data-theme="dark"] body.public-site-reference :is(
    .imteb-doctor-card__badges span,
    .imteb-doctor-card__centers a,
    .imteb-service-pill,
    .imteb-clinic-specialities span,
    .imteb-clinic-physician__nearest,
    .imteb-clinic-insurance-card span,
    .imteb-clinic-map-link,
    .imteb-clinic-phones a,
    .imteb-clinic-service-tags span,
    .imteb-rules-box,
    .imteb-service-accordion .accordion-button,
    .imteb-time-list > button,
    .imteb-active-filters button
) {
    background: rgba(41, 198, 230, 0.1) !important;
}

[data-theme="dark"] body.public-site-reference .imteb-date-list > button {
    border-color: rgba(41, 198, 230, 0.12) !important;
    background: #122a40 !important;
    box-shadow: none !important;
}

[data-theme="dark"] body.public-site-reference .imteb-date-list > button b,
[data-theme="dark"] body.public-site-reference .imteb-selected-appointment > div {
    background: #18334a !important;
}

[data-theme="dark"] body.public-site-reference .imteb-date-list > button.is-selected b {
    background: #168dab !important;
    color: #fff !important;
}

[data-theme="dark"] body.public-site-reference :is(
    .imteb-doctor-card__badges span,
    .imteb-doctor-card__centers a,
    .imteb-service-pill,
    .imteb-clinic-specialities span
) {
    color: #dff8ff !important;
}

[data-theme="dark"] body.public-site-reference :is(hr, .accordion-item, .imteb-clinic-contact-row, .imteb-date-list) {
    border-color: var(--imteb-line) !important;
}

[data-theme="dark"] body.public-site-reference :is(.imteb-doctor-about__fade, .imteb-clinic-about__fade) {
    background: linear-gradient(to top, #0d2033, transparent) !important;
}

[data-theme="dark"] body.public-site-reference :is(.imteb-doctor-about > button, .imteb-clinic-about > button, .imteb-appointment-close, .imteb-review-modal__close) {
    background: #173149 !important;
    color: #c7dae8 !important;
}

[data-theme="dark"] body.public-site-reference .imteb-review-summary {
    background: rgba(255, 193, 7, 0.1) !important;
}

[data-theme="dark"] body.public-site-reference .imteb-clinic-socials a,
[data-theme="dark"] body.public-site-reference .imteb-clinic-physician__nearest.is-empty,
[data-theme="dark"] body.public-site-reference .imteb-time-list > button.is-disabled {
    background: #14293d !important;
}

/* Home and about pages. */
[data-theme="dark"] body.public-home-page .public-home-shell::before {
    opacity: 0.1;
    filter: saturate(0.75) hue-rotate(155deg);
}

[data-theme="dark"] body.public-home-page .public-home-tab-content {
    border-color: rgba(137, 202, 226, 0.17) !important;
    background: rgba(13, 32, 51, 0.72) !important;
    box-shadow: var(--imteb-shadow);
}

[data-theme="dark"] body.public-home-page .public-home-tabs .nav-link {
    background: #122a40 !important;
    color: #a9c1d2 !important;
}

[data-theme="dark"] body.public-home-page .public-home-tabs .nav-link.active {
    background: #183b55 !important;
    color: #f4fbff !important;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.25);
}

[data-theme="dark"] body.public-home-page .public-home-search {
    border-color: var(--imteb-line) !important;
    background: #10263b !important;
    color: #91a9bb !important;
}

[data-theme="dark"] body.public-home-page .public-home-specialties a {
    color: var(--imteb-text) !important;
}

[data-theme="dark"] body.public-home-page .public-home-service-grid article {
    border: 1px solid var(--imteb-line);
    background: linear-gradient(145deg, #102b41, #0d2033) !important;
    box-shadow: var(--imteb-shadow);
}

[data-theme="dark"] body.public-about-page .public-about-hero {
    border: 1px solid var(--imteb-line);
    background: linear-gradient(135deg, #0d2033 12%, #10344a 100%) !important;
}

[data-theme="dark"] body.public-about-page .public-about-visual,
[data-theme="dark"] body.public-about-page .public-about-services-art {
    background: rgba(22, 61, 84, 0.5) !important;
}

[data-theme="dark"] body.public-about-page .public-about-services {
    border: 1px solid var(--imteb-line);
    background: linear-gradient(135deg, #12384f, #0d2033) !important;
}

[data-theme="dark"] body.public-about-page .public-about-person {
    border-color: #17354c;
    background: #17354c;
}

[data-theme="dark"] body.public-about-page :is(.public-about-logo, .public-about-feature-icon img, .public-about-services-art img) {
    mix-blend-mode: normal !important;
}

/* Footer. */
[data-theme="dark"] body.site-doctors-route .site-footer {
    background: linear-gradient(0deg, #06111f 0%, #0a2132 100%) !important;
}

[data-theme="dark"] body.site-doctors-route .site-footer-inner {
    border: 1px solid var(--imteb-line) !important;
    background: rgba(13, 32, 51, 0.86) !important;
    box-shadow: var(--imteb-shadow) !important;
}

[data-theme="dark"] body.site-doctors-route :is(.site-footer-brand-title, .site-footer-nav a) {
    color: var(--imteb-text) !important;
}

[data-theme="dark"] body.site-doctors-route :is(.site-footer-brand-sub, .site-footer-bottom, .site-footer-bottom span) {
    color: var(--imteb-muted) !important;
}

[data-theme="dark"] body.site-doctors-route .site-footer-divider {
    border-color: var(--imteb-line) !important;
}

/* Searchable Select2 controls in public forms and modals. */
[data-theme="dark"] .public-searchable-select.select2-container .select2-selection--single,
[data-theme="dark"] .public-searchable-select-dropdown.select2-dropdown,
[data-theme="dark"] .public-searchable-select-dropdown .select2-search__field {
    border-color: rgba(153, 196, 220, 0.18) !important;
    background: #10263b !important;
    color: #eef8ff !important;
}

[data-theme="dark"] .public-searchable-select .select2-selection__rendered,
[data-theme="dark"] .public-searchable-select-dropdown .select2-results__option {
    color: #eef8ff !important;
}

[data-theme="dark"] .public-searchable-select .select2-selection__placeholder,
[data-theme="dark"] .public-searchable-select-dropdown .select2-results__message {
    color: #819caf !important;
}

[data-theme="dark"] .public-searchable-select-dropdown.select2-dropdown {
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.38);
}

[data-theme="dark"] .public-searchable-select-dropdown .select2-results__option--highlighted.select2-results__option--selectable {
    background: rgba(41, 198, 230, 0.12) !important;
    color: #5ed9f1 !important;
}

[data-theme="dark"] .public-searchable-select-dropdown .select2-results__option--selected {
    background: #29c6e6 !important;
    color: #04121f !important;
}

/* Standalone login/register page and the shared login modal. */
[data-theme="dark"] .public-auth-modal {
    --public-auth-primary: #29c6e6;
    --public-auth-text: #eef8ff;
    --public-auth-muted: #9db4c7;
}

[data-theme="dark"] body.public-auth-page .public-auth-page-shell {
    background: transparent !important;
}

[data-theme="dark"] :is(.public-auth-modal-content, .public-auth-card) {
    border: 1px solid rgba(153, 196, 220, 0.16);
    background: #0d2033 !important;
    color: #eef8ff !important;
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.42);
}

[data-theme="dark"] :is(.public-auth-form h2, .public-auth-form > label, .public-auth-fields-grid label, .public-auth-description strong) {
    color: #eef8ff !important;
}

[data-theme="dark"] :is(.public-auth-description, .public-auth-form > label small, .public-auth-rules) {
    color: #9db4c7 !important;
}

[data-theme="dark"] .public-auth-input {
    border-color: rgba(153, 196, 220, 0.18);
    background: #10263b;
    color: #eef8ff;
}

[data-theme="dark"] .public-auth-input::placeholder {
    color: #7891a5;
}

[data-theme="dark"] .public-auth-close {
    background: #173149;
    color: #c7dae8;
}

[data-theme="dark"] .public-auth-password-wrap button {
    color: #9db4c7;
}

[data-theme="dark"] .public-auth-code input,
[data-theme="dark"] [data-public-otp-group] input {
    border-color: rgba(153, 196, 220, 0.18) !important;
    background: #10263b !important;
    color: #eef8ff !important;
}

[data-theme="dark"] .public-auth-primary {
    color: #04121f;
}

[data-theme="dark"] .public-auth-theme-toggle {
    background: rgba(13, 32, 51, 0.94) !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.32);
}

@media (max-width: 991.98px) {
    .site-theme-toggle {
        flex-basis: 38px;
        width: 38px;
        height: 38px;
    }
}

@media (max-width: 575.98px) {
    .public-auth-theme-toggle {
        top: 0.75rem;
        left: 0.75rem;
    }
}
