/* Shared public-site typography. Keep icon fonts independent. */
:root { --it-font-family: 'IBM Plex Sans Arabic', sans-serif; }
html body,
html body :is(#main, #header, #navbar, #footer, #topbar),
html body :is(#main, #header, #navbar, #footer, #topbar) :where(*):not(:where(.fa, .fas, .far, .fab, .fal, .fad, .bi, [class*="fa-"], [class*="bi-"], .material-icons)),
html body :is(input, select, textarea, button) {
    font-family: var(--it-font-family) !important;
}

/* Grid/flex children must be allowed to shrink to their available width. */
html body #main #home-hero .hero-features { flex-wrap: wrap; gap: 12px 24px; }
html body #main #home-hero .hero-features > span { display: inline-flex; align-items: baseline; gap: 8px; max-width: 100%; }
html body #main #home-hero .hero-features > span > i { flex-shrink: 0; margin-inline: 0; }
#main :where(.row > *, [class*="grid"] > *, .hero-media, .hero-content) { min-width: 0; }
#main :where(img, video) { max-width: 100%; }
#main :where(h1, h2, h3, h4, p, a, label) { overflow-wrap: break-word; }

@media (max-width: 991.98px) {
    /* Remove desktop floating overlays from the laptop on touch screens. */
    html body #main #home-hero .laptop-perspective { perspective: none; padding-top: 0; }
    html body #main #home-hero .laptop-wrapper {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
        max-width: 560px;
        margin: 16px auto 0;
        transform: none !important;
        animation: none !important;
    }
    html body #main #home-hero .laptop-bezel { grid-column: 1 / -1; grid-row: 1; transform: none; }
    html body #main #home-hero .laptop-base { grid-column: 1 / -1; grid-row: 2; margin: -8px 0 4px; transform: none !important; }
    html body #main #home-hero .floating-pill {
        position: relative;
        inset: auto;
        width: auto;
        min-width: 0;
        min-height: 48px;
        padding: 10px;
        transform: none !important;
        direction: inherit;
    }
    html body #main #home-hero .floating-pill .text { font-size: 14px; line-height: 1.6; }
    html body #main #home-hero .hero-features { gap: 12px; flex-wrap: wrap; }

    /* Desktop dropdown visibility and widths must not leak into the mobile menu. */
    html body #navbar.navbar-mobile { width: 100% !important; min-height: 0 !important; height: 100dvh !important; }
    html body #navbar.navbar-mobile > ul { overscroll-behavior: contain; padding: 12px !important; }
    html body #navbar.navbar-mobile ul ul.custom-dropdown-menu {
        position: static !important;
        display: none !important;
        min-width: 0 !important;
        max-width: 100% !important;
        width: auto !important;
        margin: 4px 0 8px !important;
        padding: 6px !important;
        opacity: 1 !important;
        visibility: visible !important;
        box-shadow: none !important;
        transform: none !important;
    }
    html body #navbar.navbar-mobile ul ul.custom-dropdown-menu.dropdown-active { display: block !important; }
    html body #navbar.navbar-mobile ul ul.custom-dropdown-menu::before { display: none !important; }
    html body #navbar.navbar-mobile a.nav-link { white-space: normal; min-height: 44px; font-size: 16px !important; line-height: 1.6; }
    html body #header .logo { min-width: 0; }
    html body #header .logo img { max-width: min(54vw, 220px); object-fit: contain; }
}

@media (max-width: 767.98px) {
    html body #main .container { padding-inline: 16px; }
    html body #main #home-hero { padding: 24px 0 36px !important; }
    html body #main #home-hero .hero-title { font-size: clamp(26px, 7.5vw, 34px); line-height: 1.5; }
    html body #main #home-hero .hero-title-typing-line { max-width: 100%; min-height: 3em; }
    html body #main #home-hero .hero-desc { font-size: 16px; line-height: 1.85; min-height: 0; }
    html body #main #home-hero .hero-buttons { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    html body #main #home-hero .hero-buttons a { padding: 12px 10px; min-height: 48px; font-size: 15px; width: 100%; }
    html body #main .hero-badge { max-width: 100%; flex-wrap: wrap; justify-content: center; gap: 6px; padding: 8px 12px; }
    html body #main :is(.section-title, .sectors-header, .target-sectors-header, .home-faq-heading) h2 { font-size: clamp(24px, 6.5vw, 30px) !important; line-height: 1.5; }
    html body #main :is(.feature-desc, .target-sector-card p, .sector-card p, .home-faq-answer, .solution-card p) { font-size: 16px !important; line-height: 1.85 !important; }
    html body #main .target-sector-card { padding: 22px 18px; }
    html body #main .systems-tags { flex-wrap: wrap; }
    html body #main .features-section :is(.right-cards, .left-cards, .features-qr-column) { flex: 0 0 100%; width: 100%; max-width: 100%; }
    html body #main .features-section .feature-card-wrapper { transform: none !important; }
    html body #main .features-section .feature-card-wrapper::before { inset-inline: 0 !important; }
    html body #main .features-section .feature-card { padding: 24px 18px !important; min-height: 0 !important; }
    html body #main .features-section .features-qr-column { position: static !important; height: auto !important; margin-block: 12px 28px; }
    html body #main :is(.advisor-grid, .solutions-form-grid, .schedule-custom) { grid-template-columns: minmax(0, 1fr); }
    html body #main :is(.solutions-field.full, .schedule-box) { grid-column: 1 / -1; }
    html body #main :is(input, select, textarea) { font-size: 16px; max-width: 100%; }
    html body #main :is(.accordion-button, .faq-question) { min-height: 48px; white-space: normal; line-height: 1.65; }
    html body #footer .footer-links a { display: inline-block; padding-block: 8px; }
}

@media (max-width: 359.98px) {
    html body #main #home-hero .hero-buttons { grid-template-columns: minmax(0, 1fr); }
    html body #main #home-hero .laptop-wrapper { grid-template-columns: minmax(0, 1fr); }
}

/* Bold text and the official Infinity Tech heading palette. */
html body #main :is(h1, h2, h3, h4, h5, h6) { font-weight: 700 !important; }
html body #main :is(h1, h2) {
    background-image: linear-gradient(90deg, #2F3A85 0%, #257ACD 52%, #C15F9F 100%) !important;
    -webkit-background-clip: text;
    background-clip: text;
    color: #2F3A85;
    -webkit-text-fill-color: transparent !important;
}
html body #main :is(h1, h2) > span { -webkit-text-fill-color: inherit !important; }
:where(html body #main) :is(h3, h5, h6) { color: #2F3A85; }
:where(html body #main) h4 { color: #257ACD; }
html body #main #sectors .row > div:nth-child(3n+2) h3 { color: #257ACD !important; }
html body #main #sectors .row > div:nth-child(3n) h3 { color: #C15F9F !important; }

/* Feature card headings cycle through the official brand palette. */
html body #main #features .feature-card-wrapper:nth-child(3n+1) { --feature-heading-color: #2F3A85; }
html body #main #features .feature-card-wrapper:nth-child(3n+2) { --feature-heading-color: #257ACD; }
html body #main #features .feature-card-wrapper:nth-child(3n) { --feature-heading-color: #C15F9F; }
html body #main #features .feature-card .feature-title {
    color: var(--feature-heading-color) !important;
    background-image: linear-gradient(90deg, #2F3A85 0%, #257ACD 52%, #C15F9F 100%) !important;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent !important;
}
html body #main #features .feature-card .feature-title :where(*) {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}
html body.dark #main #features .feature-card .feature-title {
    background-image: linear-gradient(90deg, #b9c2ff 0%, #9acbff 52%, #efb6da 100%) !important;
}
html body.dark #main #features .feature-card-wrapper:nth-child(3n+1) { --feature-heading-color: #b9c2ff; }
html body.dark #main #features .feature-card-wrapper:nth-child(3n+2) { --feature-heading-color: #9acbff; }
html body.dark #main #features .feature-card-wrapper:nth-child(3n) { --feature-heading-color: #efb6da; }

/* Light brand tones retain contrast on the existing dark sections. */
html body #main :is(.reports-dark, .pos-final, .restaurant-final, .school-final, .hr-final, .hospital-final, .solutions-hub-hero) :is(h1, h2) {
    background-image: linear-gradient(90deg, #ffffff 0%, #b9d7ff 52%, #efb6da 100%) !important;
}
html body #main :is(.reports-dark, .pos-final, .restaurant-final, .school-final, .hr-final, .hospital-final, .solutions-hub-hero) :is(h3, h4, h5, h6) {
    color: #fff !important;
}
/* Accordion titles contain controls: render their text as a solid color. */
html body #main :is(.accordion-header, .faq-question):is(h1, h2),
html body #main :is(h1, h2) :is(button, .btn),
html body #main :is(h1, h2).btn {
    background-image: none !important;
    color: #2F3A85 !important;
    -webkit-text-fill-color: currentColor !important;
}


/* Readable navigation using the same font as the rest of the site. */
@media (min-width: 1251px) {
    html body #header #navbar > ul > li > a.nav-link {
        font-size: 17px !important;
        line-height: 1.5 !important;
    }
}
@media (min-width: 992px) and (max-width: 1250px) {
    html body #header #navbar > ul > li > a.nav-link {
        font-size: 15px !important;
        line-height: 1.5 !important;
        padding-inline: 6px !important;
    }
}
html body #header #navbar ul.custom-dropdown-menu a.nav-link {
    font-size: 16px !important;
    line-height: 1.6 !important;
    white-space: normal;
}
@media (max-width: 991.98px) {
    html body #header #navbar.navbar-mobile a.nav-link {
        font-size: 17px !important;
        line-height: 1.6 !important;
        min-height: 48px;
    }
}

/* Keep the systems and features sections close without reserving a blank QR row. */
html body #main .home-page #systems.infinity-systems { padding-bottom: 30px; }
html body #main .home-page #features.features-section { padding-top: 30px; }
html body #main .home-page #features > .container > .section-title {
    margin-bottom: 28px;
    padding-bottom: 0;
}

/* Extend the desktop navigation across the page, with balanced outer gutters. */
@media (min-width: 992px) {
    html body #header .logo { margin-inline: 0 !important; }
    html body #header #navbar { flex: 1 1 auto; min-width: 0; }
    html body #header #navbar > ul { width: 100%; }
}
@media (min-width: 1200px) {
    html body #header #navbar > ul { justify-content: space-between; }
}

/* Compact footer with the Infinity Tech palette and stronger type. */
html body #footer.infinity-footer .footer-section-title {
    color: #257ACD;
    font-weight: 900 !important;
}
html body #footer.infinity-footer :is(.footer-quick-links a, .footer-quick-links a span, .footer-contact-item a, .footer-contact-item span, .footer-address-card a, .copyright) {
    color: #2F3A85 !important;
    font-weight: 800 !important;
}
html body #footer.infinity-footer :is(.footer-contact-item small, .footer-social-label) {
    color: #257ACD;
    font-weight: 800 !important;
}
html body #footer.infinity-footer .footer-section-title::after {
    background: linear-gradient(90deg, #2F3A85, #257ACD, #C15F9F);
}
html body #footer.infinity-footer .footer-quick-links a i { color: #C15F9F; }
html body #header #navbar > ul > li > a.header-home-link {
    color: #2F3A85 !important;
    font-weight: 900 !important;
}

/* Compact header: navigation and utility buttons share one desktop row. */
html body #header > .container { min-height: 70px !important; gap: 14px !important; }
html body #header .logo img { max-height: 50px !important; }
html body #header #navbar > ul { justify-content: flex-start; gap: 2px !important; }
html body #header #navbar > ul > li > a.nav-link {
    padding-inline: 9px !important;
    font-weight: 900 !important;
}
html body #header #navbar .custom-dropdown-menu a.nav-link { font-weight: 800 !important; }
html body #header .header-actions { display: flex; align-items: center; gap: 7px; flex: 0 0 auto; }
html body #header .header-actions :is(.header-quote-link, .header-admin-link, .header-search-btn, .dropdown-toggle, .checkbox-label) {
    min-height: 40px;
    border: 1px solid #dfe4f2 !important;
    border-radius: 11px;
    background: #f5f7fc !important;
    color: #2F3A85 !important;
    font-weight: 800 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
}
html body #header .header-actions .header-quote-link {
    padding: 9px 14px;
    background: linear-gradient(120deg, #2F3A85, #257ACD) !important;
    color: #fff !important;
    font-size: 15px;
    text-decoration: none;
}
html body #header .header-actions .dropdown-toggle { padding: 7px 9px; font-size: 13px; }
html body #header .header-actions .dropdown-toggle img { width: 20px; height: 15px; object-fit: contain; }
html body #header .header-actions .dropdown-menu { min-width: 130px; border-radius: 12px; padding: 6px; }
html body #header .header-actions .dropdown-item { color: #2F3A85; font-weight: 800 !important; }
html body #header .header-actions .header-search-btn { width: 40px; padding: 0 !important; cursor: pointer; }
html body #header .header-actions .header-search-btn > span { display: none; }
html body #header .header-actions .appearance-toggle { margin: 0; position: relative; }
html body #header .header-actions .checkbox-label { width: 40px; padding: 0; margin: 0; cursor: pointer; }
html body #header .header-actions .checkbox-label :is(.ball, .fa-moon) { display: none; }
html body #header .header-actions .checkbox-label .fa-sun { color: #257ACD; }
html body.dark #header .header-actions .checkbox-label .fa-sun { display: none; }
html body.dark #header .header-actions .checkbox-label .fa-moon { display: inline-block; color: #2F3A85; }
html body #header .header-actions .checkbox-label .title {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
html body #header .header-actions .checkbox { position: absolute; width: 1px; height: 1px; opacity: 0; }
html body #header .header-actions :is(a, button):focus-visible,
html body #header .header-actions .checkbox:focus-visible + .checkbox-label { outline: 2px solid #257ACD; outline-offset: 3px; }
@media (min-width: 992px) {
    html body #header #navbar > ul > li > a.nav-link { font-size: 16px !important; }
}
@media (max-width: 1199.98px) {
    html body #header > .container { flex-wrap: wrap; gap: 8px !important; padding-block: 8px; }
    html body #header .logo { order: 0; }
    html body #header #navbar { order: 1 !important; margin-inline-start: auto; }
    html body #header .header-actions { order: 2; width: 100%; justify-content: center; }
}

@media (min-width: 1200px) {
    html body #header > .container { justify-content: space-between; }
    html body #header #navbar { flex: 1 1 auto; }
    html body #header #navbar > ul { justify-content: center; }
}

/* Use the same Bootstrap container as the page; no separate header width. */
html body #header { top: 0 !important; padding: 0 !important; }
html body #header.fixed-top { position: sticky !important; }
html body #main.fixed-top-margin { margin-top: 0 !important; }
html body #header > .container,
html body #header.header-scrolled > .container { min-height: 76px !important; }
html body #header .header-actions :is(.header-search-btn, .dropdown-toggle) { margin: 0; }
@media (max-width: 767.98px) {
    html body #header > .container { padding-inline: 16px; }
}

/* Compact authenticated dashboard shortcut. */
html body #header .header-actions .header-admin-link {
    width: 40px;
    flex: 0 0 40px;
    text-decoration: none;
}

/* Dark header must override the older, unconditional white header layers. */
html body.dark #header,
html body.dark #header.header-scrolled {
    background: #090e1b !important;
    border-color: #243047 !important;
    box-shadow: 0 3px 16px rgba(0, 0, 0, .35) !important;
    color-scheme: dark;
}
html body.dark #header #navbar :is(a, a:focus, .mobile-nav-toggle),
html body.dark #header .header-actions :is(.header-admin-link, .header-search-btn, .dropdown-toggle, .checkbox-label),
html body.dark #header .header-actions .checkbox-label .fa-moon {
    color: #e6ecff !important;
}
html body.dark #header .header-actions :is(.header-admin-link, .header-search-btn, .dropdown-toggle, .checkbox-label) {
    background: #151e31 !important;
    border-color: #2b3854 !important;
}
html body.dark #header #navbar :is(.custom-dropdown-menu, .dropdown ul),
html body.dark #header #navbar.navbar-mobile > ul,
html body.dark #header .header-actions .dropdown-menu {
    background: #101827 !important;
    border-color: #2b3854 !important;
}
html body.dark #header #navbar .custom-dropdown-menu li,
html body.dark #header #navbar .custom-dropdown-menu a {
    background: transparent !important;
    border-color: #2b3854 !important;
}
html body.dark #header .header-actions .dropdown-item {
    color: #e6ecff !important;
}
html body.dark #header #navbar a:hover,
html body.dark #header #navbar a.active,
html body.dark #header .header-actions .dropdown-item:hover,
html body.dark #header .header-actions .dropdown-item:focus {
    background: #202d4c !important;
    color: #fff !important;
}
html body.dark #header #navbar .custom-dropdown-menu a i {
    color: #8dc6ff !important;
    background: #202d4c !important;
}

/* Search uses Infinity Tech colors, independent of the legacy CMS palette. */
html body #header-search-box {
    background: linear-gradient(135deg, #2F3A85 0%, #257ACD 100%) !important;
    color: #fff !important;
}
html body.dark #header-search-box {
    background: linear-gradient(135deg, #090e1b 0%, #18234f 100%) !important;
}
html body #header-search-box input[type="search"] {
    color: #fff !important;
    caret-color: #fff;
    background: transparent !important;
    border-color: rgba(255, 255, 255, .65) !important;
}
html body #header-search-box input[type="search"]::placeholder { color: #e8edff !important; opacity: 1; }
html body #header-search-box :is(.btn-theme, .close) {
    background: #2F3A85 !important;
    border: 1px solid #C15F9F !important;
    color: #fff !important;
}
html body #header-search-box :is(.btn-theme, .close):hover {
    background: #257ACD !important;
}
html body #header-search-box :is(input, button):focus-visible {
    outline: 3px solid #C15F9F;
    outline-offset: 4px;
}
