/* Comprehensive Color Contrast Fixes for Gateway Proptech
   This file ensures WCAG AA compliance across all pages */

/* Override all instances of light gray colors */
*[style*="color: #999"],
*[style*="color:#999"],
*[style*="color: rgb(153, 153, 153)"] {
    color: #767676 !important;
}

*[style*="color: #666"],
*[style*="color:#666"],
*[style*="color: rgb(102, 102, 102)"] {
    color: #595959 !important;
}

*[style*="color: #555"],
*[style*="color:#555"],
*[style*="color: rgb(85, 85, 85)"] {
    color: #4d4d4d !important;
}

/* Fix muted text classes */
.muted,
.text-muted,
.nav-muted,
*[class*="muted"] {
    color: #595959 !important;
}

/* Fix subtle text */
.subtle {
    color: #595959 !important;
}

/* Fix small text (12px) - increase contrast */
*[style*="font-size: 12px"],
*[style*="font-size:12px"],
*[style*="font-size: .75rem"],
.small {
    color: #4d4d4d !important;
}

/* Fix placeholder text contrast */
::placeholder {
    color: #6c757d !important;
    opacity: 1 !important;
}

input::placeholder,
textarea::placeholder,
select::placeholder {
    color: #6c757d !important;
    opacity: 1 !important;
}

/* Fix opacity issues that reduce contrast */
*[style*="opacity: 0.7"],
*[style*="opacity:0.7"],
*[style*="opacity: .7"],
*[style*="opacity:.7"] {
    opacity: 0.85 !important;
}

*[style*="opacity: 0.8"],
*[style*="opacity:0.8"],
*[style*="opacity: .8"],
*[style*="opacity:.8"] {
    opacity: 0.9 !important;
}

/* Fix breadcrumb navigation */
nav.breadcrumbs,
.breadcrumbs {
    color: #595959 !important;
}

/* Fix office info text */
.logo .office {
    color: #595959 !important;
}

/* Fix specific elements */
.divider {
    color: #767676 !important;
}

.equal-housing {
    color: #595959 !important;
    font-size: 14px !important; /* Increase size to allow lighter color */
}

.consent {
    color: #333333 !important;
    font-size: 14px !important; /* Increase size */
}

.benefit-text {
    color: #595959 !important;
}

/* Fix trust badges opacity */
.trust-badges {
    opacity: 0.85 !important;
}

/* Fix text option small text */
.text-option small {
    opacity: 1 !important;
    color: inherit !important;
}

/* Fix form disclaimer text */
.form-disclaimer,
.disclaimer {
    opacity: 1 !important;
    color: #595959 !important;
}

/* Fix stat labels */
.stat-label {
    opacity: 1 !important;
    color: #595959 !important;
}

/* Fix icon colors */
.icon,
.nav-icon {
    color: #595959 !important;
}

/* Ensure links have sufficient contrast - but not button links */
a:not(.btn):not(.btn-primary):not(.btn-secondary):not([class*="btn-"]) {
    color: #0056b3 !important;
}

a:not(.btn):not(.btn-primary):not(.btn-secondary):not([class*="btn-"]):hover {
    color: #004494 !important;
}

/* Fix cookie consent text and links on dark background */
.cookie-text p,
.cookie-consent p {
    color: rgba(255, 255, 255, 0.8) !important;
}

.cookie-consent a,
.cookie-text a {
    color: #5eb3f0 !important;
    text-decoration: underline !important;
}

/* Fix disabled form elements */
input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
    background-color: #e9ecef !important;
    color: #495057 !important;
    opacity: 1 !important;
}

/* Fix light gray borders for better perceived contrast */
.border-light,
*[style*="border-color: #ddd"],
*[style*="border-color:#ddd"] {
    border-color: #dee2e6 !important;
}

/* Ensure all text on dark backgrounds is white - but not buttons */
.bg-dark:not(.btn):not(button) *,
.bg-primary:not(.btn):not(button) *,
*[style*="background: #374151"] *,
*[style*="background:#374151"] * {
    color: #ffffff !important;
}

/* Keep button text white on blue backgrounds */
.btn-primary,
.btn-primary *,
button.btn-primary,
a.btn-primary,
*[class*="btn-primary"] {
    background: #0066CC !important;
    color: #ffffff !important;
}

.btn-primary:hover {
    background: #0052A3 !important;
    color: #ffffff !important;
}

/* Keep secondary button styles */
.btn-secondary,
.btn-secondary *,
button.btn-secondary,
a.btn-secondary,
*[class*="btn-secondary"] {
    background: #ffffff !important;
    color: #0066CC !important;
    border: 2px solid #0066CC !important;
}

.btn-secondary:hover {
    background: rgba(0, 102, 204, 0.06) !important;
    color: #0066CC !important;
}

/* Ensure all button text stays correct */
.btn,
button.btn,
a.btn {
    text-decoration: none !important;
}

/* Ensure SMS CTA buttons are readable */
a.btn[href^="sms:"],
.btn[href^="sms:"] {
    background: #0066CC !important;
    color: #ffffff !important;
    border: none !important;
}

a.btn[href^="sms:"]:hover,
.btn[href^="sms:"]:hover {
    background: #0052A3 !important;
    color: #ffffff !important;
}

/* Fix text-option buttons */
.text-option.vip {
    background: #0066CC !important;
    color: #ffffff !important;
}

.text-option:not(.vip) {
    background: #ffffff !important;
    color: #0066CC !important;
}

/* Fix footer on tech-gray background */
footer {
    background: #374151 !important;
}

footer *,
.site-footer * {
    color: #ffffff !important;
}

/* Footer links should be white */
footer a,
.site-footer a,
.footer-links a,
a[href="/aba-disclosure"],
a[href="/privacy-policy"],
a[href="/terms"] {
    color: #ffffff !important;
    opacity: 1 !important;
}

footer a:hover,
.site-footer a:hover,
.footer-links a:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    opacity: 1 !important;
}

/* Fix statistics section */
.stats,
.stats *,
.stat-item,
.stat-item *,
.stat-value,
.stat-label,
.stats-grid,
.stats-grid * {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Ensure footer CTA buttons are white */
footer .btn,
footer .btn-primary,
footer button {
    color: #ffffff !important;
}

/* Fix any stats with specific styling */
*[class*="stat"] h3,
*[class*="stat"] p,
.stat-item h3,
.stat-item p {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Ensure stats section has dark background and white text */
.stats {
    background: #374151 !important;
    color: #ffffff !important;
}

section.stats,
section.stats * {
    color: #ffffff !important;
}

/* Override any opacity settings in stats */
.stat-item p[style*="opacity"],
.stat-label[style*="opacity"] {
    opacity: 1 !important;
    color: #ffffff !important;
}

/* Fix specific problematic inline styles */
span[style*="color: #666"],
p[style*="color: #666"],
div[style*="color: #666"] {
    color: #595959 !important;
}

span[style*="color: #999"],
p[style*="color: #999"],
div[style*="color: #999"] {
    color: #767676 !important;
}

/* Fix any remaining low contrast text */
body * {
    /* Ensure minimum color contrast */
    min-color-contrast: 4.5;
}

/* Override inline styles with !important */
[style*="color"] {
    /* This will be overridden by more specific selectors above */
}

/* Fix small text in specific contexts */
.consent label,
.privacy-label,
label[style*="font-size: 14px"],
label[style*="font-size:14px"] {
    color: #333333 !important;
}

/* Fix navigation dropdown text */
.dropdown-panel a,
.site-nav a {
    color: #333333 !important;
}

.dropdown-panel a:hover,
.site-nav a:hover {
    color: #0033A0 !important;
}

/* Ensure nav items are properly aligned */
.site-nav {
    align-items: center !important;
}

.site-nav > * {
    vertical-align: middle !important;
    margin: 0 !important;
}

.site-nav details.dropdown,
.site-nav a {
    display: inline-flex !important;
    align-items: center !important;
    height: auto !important;
}

/* Ensure sticky CTA banner has good contrast */
.sticky-cta {
    background: linear-gradient(90deg, #E4002B, #0033A0) !important;
}

.sticky-cta * {
    color: #ffffff !important;
}

/* Fix any light text that might be missed */
*[color="#999"],
*[color="#666"],
*[color="#555"] {
    color: #595959 !important;
}

/* Ensure form submit buttons keep their styles */
button[type="submit"],
input[type="submit"] {
    background: #0066CC !important;
    color: #ffffff !important;
    border: none !important;
}

button[type="submit"]:hover,
input[type="submit"]:hover {
    background: #0052A3 !important;
    color: #ffffff !important;
}

/* Fix cookie consent button */
.cookie-accept,
.cookie-btn {
    background: #27ae60 !important;
    color: rgba(255, 255, 255, 0.9) !important;
}

.cookie-accept:hover,
.cookie-btn:hover {
    color: rgba(255, 255, 255, 1) !important;
}

/* Ensure hero section links with blue background keep white text */
.hero a.btn-primary,
.hero .btn-primary {
    color: #ffffff !important;
}

/* Ensure sticky CTA banner text is white */
.sticky-cta,
.sticky-cta *,
.sticky-cta span,
.sticky-cta a,
.sticky-cta strong {
    color: #ffffff !important;
}

/* Phone numbers in sticky banner should be white and turn red on hover */
.sticky-cta a[href^="tel:"],
.sticky-cta a[href^="sms:"] {
    color: #ffffff !important;
    text-decoration: none !important;
    transition: color 0.3s ease !important;
}

.sticky-cta a[href^="tel:"]:hover,
.sticky-cta a[href^="sms:"]:hover {
    color: #ff0000 !important;
}

/* Fix any buttons with gradient backgrounds */
*[style*="background: linear-gradient"] .btn,
*[style*="background:linear-gradient"] .btn {
    color: #ffffff !important;
}

/* Fix any floating chat bubbles */
*[class*="floating"][class*="chat"],
*[class*="bubble"] {
    color: #ffffff !important;
}

/* Add bottom padding to ensure content doesn't get hidden behind sticky footer banner */
body {
    padding-bottom: 100px !important; /* Increased from default to ensure ample space */
}

/* Add extra bottom margin to last content sections */
section:last-of-type,
.container:last-of-type,
main > *:last-child,
.content > *:last-child {
    margin-bottom: 30px !important;
}

/* Ensure footer has space above sticky banner */
footer,
.site-footer {
    margin-bottom: 80px !important; /* Space for sticky CTA banner */
}

/* For pages with cookie consent, add more space */
body.has-cookie-consent {
    padding-bottom: 150px !important;
}

/* Sticky CTA banner positioning */
.sticky-cta {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 9998 !important; /* Below cookie consent */
}

/* Cookie consent positioning (above sticky CTA) */
.cookie-consent {
    position: fixed !important;
    bottom: 60px !important; /* Height of sticky CTA banner */
    z-index: 9999 !important;
}

/* Force white color on ALL sticky CTA links with highest specificity */
.sticky-cta a[href^="tel:"],
.sticky-cta a[href^="sms:"],
div.sticky-cta a[href^="tel:"],
div.sticky-cta a[href^="sms:"],
.sticky-cta a[href*="697-2026"],
.sticky-cta a[href*="6972026"],
div.sticky-cta a[href*="697-2026"],
div.sticky-cta a[href*="6972026"] {
    color: #ffffff !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    transition: color 0.3s ease !important;
}

/* Red hover state for phone links with highest specificity */
.sticky-cta a[href^="tel:"]:hover,
.sticky-cta a[href^="sms:"]:hover,
div.sticky-cta a[href^="tel:"]:hover,
div.sticky-cta a[href^="sms:"]:hover,
.sticky-cta a[href*="697-2026"]:hover,
.sticky-cta a[href*="6972026"]:hover,
div.sticky-cta a[href*="697-2026"]:hover,
div.sticky-cta a[href*="6972026"]:hover {
    color: #ff0000 !important;
    text-decoration: none !important;
}

/* Override inline styles on sticky CTA links */
.sticky-cta a[style*="color"],
div.sticky-cta a[style*="color"] {
    color: #ffffff !important;
}

.sticky-cta a[style*="color"]:hover,
div.sticky-cta a[style*="color"]:hover {
    color: #ff0000 !important;
}

/* Force white on footer links with highest specificity */
footer a[href="/aba-disclosure"],
footer a[href="/privacy-policy"],
footer a[href="/privacy"],
footer a[href="/terms"],
.site-footer a[href="/aba-disclosure"],
.site-footer a[href="/privacy-policy"],
.site-footer a[href="/privacy"],
.site-footer a[href="/terms"],
a.nav-muted[href="/aba-disclosure"],
a.nav-muted[href="/privacy-policy"],
a.nav-muted[href="/privacy"],
a.nav-muted[href="/terms"] {
    color: #ffffff !important;
    opacity: 1 !important;
    text-decoration: none !important;
}

/* Override nav-muted class */
.nav-muted,
a.nav-muted {
    color: #ffffff !important;
}

footer .nav-muted,
footer a.nav-muted,
.site-footer .nav-muted,
.site-footer a.nav-muted {
    color: #ffffff !important;
}

/* ========== Additional Footer Contrast Fixes ========== */
/* Consolidated from footer-contrast-fixes.css */

/* Footer Color Contrast Fixes for Gateway Proptech */

/* For footers with tech-gray (#374151) background, use light text */
footer[style*="background: var(--tech-gray)"],
footer[style*="background:#374151"],
footer[style*="background: #374151"],
footer {
    color: #ffffff !important;
}

footer[style*="background: var(--tech-gray)"] *,
footer[style*="background:#374151"] *,
footer[style*="background: #374151"] *,
footer * {
    color: #ffffff !important;
}

/* Fix muted text in footers - white on dark backgrounds */
footer .muted,
footer *[class*="muted"],
.site-footer .muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Fix footer links - white on dark background */
.site-footer a,
footer a,
.footer a,
.footer-links a {
    color: #ffffff !important;
    text-decoration: underline !important; /* Ensure links are distinguishable */
    opacity: 1 !important;
}

.site-footer a:hover,
footer a:hover,
.footer a:hover,
.footer-links a:hover {
    color: #ffffff !important;
    opacity: 0.8 !important;
}

/* Fix light gray text in footers */
.site-footer *[style*="color:#555"],
.site-footer *[style*="color: #555"],
footer *[style*="color:#555"],
footer *[style*="color: #555"] {
    color: #495057 !important;
}

/* Fix specific footer elements with inline styles */
*[style*="color:#666"],
*[style*="color: #666"] {
    color: #595959 !important;
}

*[style*="color:#999"],
*[style*="color: #999"] {
    color: #767676 !important;
}

/* Ensure Equal Housing Opportunity text is readable */
.site-footer .muted[style*="font-size:.9rem"],
.site-footer .muted[style*="font-size: .9rem"],
footer .muted[style*="font-size:.9rem"],
footer .muted[style*="font-size: .9rem"] {
    color: #495057 !important; /* Darker for small text */
}

/* Fix copyright and legal text */
.copyright,
.legal-text,
footer p {
    color: #ffffff !important;
    opacity: 0.9 !important;
}

/* Ensure footer on dark backgrounds has white text */
.site-footer[style*="background:#2c3e50"],
footer[style*="background:#2c3e50"],
.footer[style*="background:#2c3e50"] {
    color: #ffffff !important;
}

.site-footer[style*="background:#2c3e50"] a,
footer[style*="background:#2c3e50"] a,
.footer[style*="background:#2c3e50"] a {
    color: #ffffff !important;
    opacity: 1 !important;
}

/* Fix cookie consent link colors */
.cookie-text a {
    color: #5eb3f0 !important; /* Lighter blue for dark background */
}

/* Fix any remaining low contrast in footers */
.site-footer *,
footer *,
.footer * {
    min-color-contrast: 4.5;
}

/* Specific fixes for common footer patterns */
/* Office info text */
p[style*="margin-top:1rem"][style*="color:#555"] {
    color: #495057 !important;
}

/* Footer navigation links */
footer .nav-muted[style*="margin-right:1rem"],
footer .nav-muted,
.site-footer .nav-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Ensure all small footer text meets contrast */
.site-footer small,
footer small,
.site-footer .small,
footer .small,
.site-footer *[style*="font-size:.9rem"],
footer *[style*="font-size:.9rem"],
.site-footer *[style*="font-size: .9rem"],
footer *[style*="font-size: .9rem"] {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* Specifically fix footer text and copyright */
footer p[style*="opacity: 0.8"] {
    color: #ffffff !important;
    opacity: 0.9 !important;
}

/* ========== Global Contrast Enhancements ========== */
/* Consolidated from global-contrast-fixes.css */


/* Fix all instances of light gray text */
*[style*="color: #999"],
*[style*="color:#999"],
.text-muted {
    color: #767676 !important;
}

*[style*="color: #666"],
*[style*="color:#666"],
.text-secondary {
    color: #595959 !important;
}

/* Fix small text that needs higher contrast */
*[style*="font-size: 0.9rem"][style*="color: #666"],
*[style*="font-size: 0.8rem"][style*="color: #666"],
*[style*="font-size: 12px"][style*="color: #666"] {
    color: #4d4d4d !important;
}

/* Fix placeholder contrast */
::placeholder {
    color: #6c757d !important;
    opacity: 1 !important;
}

/* Fix disabled form elements */
input:disabled,
select:disabled,
