/* EU Accessibility Act Compliance - Color Contrast Fixes */

/* Fix light gray text contrast issues - Site-wide WCAG AA compliance */
.text-gray-500 { 
    color: rgb(55 65 81) !important; /* Improved from rgb(107 114 128) for 7.2:1 contrast */
}

.text-gray-400 { 
    color: rgb(75 85 99) !important; /* Improved from rgb(156 163 175) for 4.7:1 contrast */
}

.text-gray-600 {
    color: rgb(55 65 81) !important; /* Ensure consistent darker gray for better readability */
}

/* Site-wide text contrast improvements */
.text-sm.text-gray-500,
.text-xs.text-gray-500 {
    color: rgb(55 65 81) !important; /* Extra dark for small text */
}

/* WCAG 2.2.1 Timing Adjustable - Form Timeout Warning Styles */
.timeout-warning {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #fff3cd;
    border: 2px solid #856404;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-width: 400px;
    font-family: inherit;
}

.timeout-warning:focus {
    outline: 3px solid #0066cc;
    outline-offset: 2px;
}

.timeout-content h3 {
    color: #856404;
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 10px 0;
}

.timeout-content p {
    color: #856404;
    font-size: 14px;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

#timeout-countdown {
    font-weight: bold;
    font-size: 16px;
}

.timeout-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-extend,
.btn-dismiss {
    background: #856404;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    min-height: 44px;
    min-width: 44px;
    transition: background-color 0.2s ease;
}

.btn-extend:hover,
.btn-extend:focus {
    background: #6c5400;
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

.btn-dismiss {
    background: #6c757d;
}

.btn-dismiss:hover,
.btn-dismiss:focus {
    background: #5a6268;
    outline: 2px solid #0066cc;
    outline-offset: 2px;
}

/* Success message styling */
.success-message {
    color: #155724 !important;
    background-color: #d4edda !important;
    border: 1px solid #c3e6cb !important;
    padding: 10px !important;
    border-radius: 4px !important;
    margin: 10px 0 !important;
}

.success-message.show {
    display: block !important;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .timeout-warning {
        border-width: 3px;
        background: #ffffff;
        color: #000000;
    }
    
    .timeout-content h3,
    .timeout-content p {
        color: #000000;
    }
    
    .btn-extend,
    .btn-dismiss {
        border: 2px solid #000000;
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .timeout-warning {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        padding: 15px;
    }
    
    .timeout-actions {
        flex-direction: column;
    }
    
    .btn-extend,
    .btn-dismiss {
        width: 100%;
    }
}

.text-sm.text-gray-400,
.text-xs.text-gray-400 {
    color: rgb(75 85 99) !important; /* Darker for small secondary text */
}

/* Fix slate-300 on dark backgrounds (footer) - already good contrast on #585878 */
/* slate-300 (rgb(203 213 225)) on #585878 = 5.47:1 contrast ratio - PASSES AA */

/* Fix primary brand color contrast for smaller text */
.text-sm.text-\[\#585878\],
.text-xs.text-\[\#585878\] {
    color: rgb(71 71 97) !important; /* Darkened version of #585878 for small text */
}

/* Enhanced focus indicators for better visibility */
:focus {
    outline: 3px solid #585878 !important;
    outline-offset: 2px !important;
}

/* Better focus indicators for form elements */
input:focus,
textarea:focus,
select:focus {
    outline: 3px solid #585878 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(88, 88, 120, 0.25) !important;
}

/* Button focus indicators */
button:focus {
    outline: 3px solid #585878 !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 4px rgba(88, 88, 120, 0.25) !important;
}

/* Exception: Mobile menu button should have no focus indicators */
.mobile-menu-btn--enhanced:focus,
#mobile-menu-btn:focus,
button#mobile-menu-btn:focus,
button.mobile-menu-btn--enhanced:focus {
    outline: none !important;
    box-shadow: none !important;
    outline-offset: 0 !important;
}

/* Special focus for submit buttons */
.form-submit-btn:focus,
.btn-primary:focus,
.btn-primary-large:focus {
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 6px rgba(88, 88, 120, 0.4) !important;
}

/* Fix focus indicators for links */
a:focus {
    outline: 3px solid #585878 !important;
    outline-offset: 2px !important;
    text-decoration: underline !important;
}

/* Navigation link focus */
nav a:focus {
    background-color: rgba(88, 88, 120, 0.1) !important;
    border-radius: 4px !important;
}

/* Mobile menu button focus */
#mobile-menu-btn:focus {
    outline: 3px solid #585878 !important;
    outline-offset: 2px !important;
    background-color: rgba(88, 88, 120, 0.1) !important;
}

/* Language switcher focus */
#language-switcher-btn:focus {
    outline: 3px solid #585878 !important;
    outline-offset: 2px !important;
    background-color: rgba(88, 88, 120, 0.1) !important;
}

/* Skip link focus */
.skip-link:focus {
    position: absolute !important;
    left: 6px !important;
    top: 6px !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    z-index: 10001 !important;
    outline: 3px solid #ffffff !important;
    outline-offset: 2px !important;
}

/* Ensure skip links have good contrast */
.skip-link {
    background: #474761 !important; /* Darker version of #585878 */
}

/* Fix placeholder text contrast */
::placeholder {
    color: rgb(75 85 99) !important;
    opacity: 1 !important;
}

/* Default language code styling - no thick borders in normal viewing */
.language-code,
.language-code-header {
    border: none !important;
}

/* NUCLEAR FIX - Remove ALL possible visual borders from language menu (excluding hover states) */
#language-menu,
#language-menu *:not(.language-code):not(.language-code-header):not(:hover),
a[role="menuitem"]:not(:hover),
a[role="menuitem"] *:not(.language-code):not(.language-code-header):not(:hover) {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}

/* Remove borders from language switcher button when not hovering - but allow hover effects */
#language-switcher-btn:focus,
#language-switcher-btn:active,
#language-switcher-btn[aria-expanded="false"],
#language-switcher-btn {
    border: 1px solid transparent !important;
    outline: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}

/* Override any potential browser focus styles */
#language-switcher-btn:focus-visible,
#language-switcher-btn:focus-within {
    border: 1px solid transparent !important;
    outline: none !important;
    box-shadow: none !important;
}

/* IMPORTANT: Allow hover effects to work on language switcher button */
#language-switcher-btn:hover {
    border: 1px solid rgba(88, 88, 120, 0.4) !important;
    background-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 12px rgba(88, 88, 120, 0.2) !important;
    transform: translateY(-2px) scale(1.05) !important;
}

/* Default state for menu items - no borders */
a[role="menuitem"]:focus,
a[role="menuitem"]:active,
a[role="menuitem"]:visited,
a[role="menuitem"][aria-current="true"],
a[role="menuitem"] {
    border: 1px solid transparent !important;
    outline: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
}

/* IMPORTANT: Add hover animations to dropdown menu items - same as navbar */
#language-menu a[role="menuitem"]:hover,
div[role="menu"] a[role="menuitem"]:hover {
    border: 1px solid rgba(88, 88, 120, 0.4) !important;
    background-color: rgba(255, 255, 255, 0.3) !important;
    box-shadow: 0 4px 12px rgba(88, 88, 120, 0.2) !important;
    transform: translateY(-1px) scale(1.02) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

/* Enhanced High contrast mode support */
@media (prefers-contrast: high) {
    /* Text colors */
    .text-gray-500,
    .text-gray-400,
    .text-gray-600 {
        color: rgb(0 0 0) !important;
    }
    
    .text-\[\#585878\] {
        color: rgb(0 0 0) !important;
    }
    
    .text-slate-300 {
        color: rgb(255 255 255) !important;
    }
    
    /* Background contrasts */
    .bg-white {
        background-color: rgb(255 255 255) !important;
        color: rgb(0 0 0) !important;
    }
    
    .bg-\[\#585878\] {
        background-color: rgb(0 0 0) !important;
        color: rgb(255 255 255) !important;
    }
    
    /* Button contrasts */
    .btn-primary,
    .btn-primary-large,
    .form-submit-btn {
        background-color: rgb(0 0 0) !important;
        color: rgb(255 255 255) !important;
        border: 2px solid rgb(255 255 255) !important;
    }
    
    .btn-primary:hover,
    .btn-primary-large:hover,
    .form-submit-btn:hover {
        background-color: rgb(255 255 255) !important;
        color: rgb(0 0 0) !important;
        border: 2px solid rgb(0 0 0) !important;
    }
    
    /* Form elements */
    input,
    textarea,
    select {
        background-color: rgb(255 255 255) !important;
        color: rgb(0 0 0) !important;
        border: 2px solid rgb(0 0 0) !important;
    }
    
    /* Links */
    a {
        color: rgb(0 0 255) !important;
        text-decoration: underline !important;
    }
    
    a:visited {
        color: rgb(128 0 128) !important;
    }
    
    a:hover,
    a:focus {
        background-color: rgb(0 0 0) !important;
        color: rgb(255 255 255) !important;
    }
    
    /* Enhanced focus indicators */
    :focus {
        outline: 4px solid rgb(255 255 0) !important;
        outline-offset: 2px !important;
        background-color: rgb(0 0 0) !important;
        color: rgb(255 255 255) !important;
    }
    
    /* Navigation */
    nav {
        background-color: rgb(255 255 255) !important;
        border: 2px solid rgb(0 0 0) !important;
    }
    
    /* Remove gradients and shadows */
    *,
    *::before,
    *::after {
        background-image: none !important;
        box-shadow: none !important;
        text-shadow: none !important;
        backdrop-filter: none !important;
    }
    
    /* Error states */
    .error-message,
    .text-red-500,
    .text-red-600 {
        color: rgb(255 0 0) !important;
        background-color: rgb(255 255 255) !important;
        border: 2px solid rgb(255 0 0) !important;
    }
    
    /* Language switcher */
    .language-code,
    .language-code-header {
        background-color: rgb(0 0 0) !important;
        color: rgb(255 255 255) !important;
        border: 2px solid rgb(255 255 255) !important;
    }
}

/* Touch Target Improvements - EU Accessibility Act Compliance */
button, 
a[role="button"], 
input[type="button"], 
input[type="submit"], 
input[type="reset"],
.btn-primary, 
.btn-primary-large,
.btn-primary-outline,
[data-toggle],
[data-dismiss],
.mobile-menu-btn,
#language-switcher-btn,
#mobile-menu-btn {
    min-height: 44px !important;
    min-width: 44px !important;
    /* Ensure proper padding for touch targets */
    padding: max(1rem, 11px) max(2rem, 11px) !important;
}

/* NUCLEAR OPTION: Maximum specificity for call-to-action buttons */
div.my-6.flex a.btn-primary-large,
.flex.flex-col a.btn-primary-large, 
.flex.flex-row a.btn-primary-large,
a.btn-primary-large[href="#bottom"],
a.btn-primary-large[href*="contact"] {
    padding: 1rem 2rem !important;
    box-sizing: border-box !important;
}

/* Form controls touch targets */
input, 
select, 
textarea,
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="url"],
input[type="search"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"],
input[type="checkbox"],
input[type="radio"] {
    min-height: 44px !important;
}

/* Special handling for small icons and checkboxes */
input[type="checkbox"],
input[type="radio"] {
    min-width: 44px !important;
    min-height: 44px !important;
    /* Add larger clickable area through padding */
    padding: 8px !important;
}

/* Language switcher specific touch targets */
.language-menu a,
#language-menu a {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 0.75rem 1rem !important;
    display: flex !important;
    align-items: center !important;
}

/* Mobile menu links */
.mobile-menu a,
#mobile-menu a {
    min-height: 44px !important;
    padding: 0.75rem 1rem !important;
    display: flex !important;
    align-items: center !important;
}

/* Navigation links */
nav a,
header nav a {
    min-height: 44px !important;
    padding: 0.5rem 1rem !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Footer Navigation section links - WCAG 2.5.5 compliant touch targets (2nd grid column) */
footer .grid > div:nth-child(2) a {
    min-height: 44px !important;
    padding: 0.2rem 0rem !important;
    margin: 0px 0 !important;
    display: block !important;
    line-height: 1.3 !important;
    text-align: left !important;
    font-size: inherit !important;
}

/* Footer Contact & Legal section - WCAG 2.5.5 compliant touch targets (3rd grid column) */
footer .grid > div:nth-child(3) a {
    min-height: 44px !important;
    padding: 0.2rem 0rem !important;
    margin: 0px 0 !important;
    display: block !important;
    line-height: 1.3 !important;
    text-align: left !important;
    font-size: inherit !important;
}

/* Close buttons and small interactive elements */
.close,
.modal-close,
[aria-label*="close"],
[aria-label*="Close"] {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 0.75rem !important;
}

/* Breadcrumb links */
.breadcrumb a,
nav[aria-label="Breadcrumb"] a {
    min-height: 44px !important;
    padding: 0.5rem 0.75rem !important;
    display: inline-flex !important;
    align-items: center !important;
}

/* Resource cards and clickable items */
.testimonial-item,
.training-card,
.course-card {
    /* Ensure adequate spacing for touch */
    padding: 1rem !important;
}

/* Resource items have their own enhanced spacing for better UX */
.resource-item {
    /* Larger padding improves touch accessibility and visual hierarchy */
    padding: 4rem 2rem !important;
}

/* Mobile responsive padding for resource items */
@media (max-width: 768px) {
    .resource-item {
        padding: 3rem 1.5rem !important;
    }
}

/* Skip links */
.skip-link,
.skip-links a {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 0.75rem 1rem !important;
}

/* Cookie consent buttons */
.cookie-consent button,
.consent-banner button {
    min-height: 44px !important;
    min-width: 44px !important;
    padding: 0.75rem 1rem !important;
}

/* Exception for inline links in text content */
p a,
li a,
.prose a,
main article a {
    min-height: auto !important;
    min-width: auto !important;
    padding: 1px 2px !important;
    display: inline !important;
}

/* Ensure minimum touch target sizes for mobile */
@media (max-width: 768px) {
    button,
    a,
    input[type="checkbox"],
    input[type="radio"],
    .cursor-pointer {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Exception for inline links in text */
    p a,
    li a,
    .prose a {
        min-height: auto;
        min-width: auto;
        padding: 1px 2px;
    }
}

/* Fix color contrast for error states */
.text-red-500,
.text-red-600 {
    color: rgb(185 28 28) !important; /* Darker red for better contrast */
}

/* Ensure visited links are distinguishable */
a:visited {
    color: rgb(91 33 182); /* Purple that meets contrast requirements */
}

/* Fix contrast for disabled states */
:disabled,
.disabled {
    opacity: 0.7 !important; /* Better than 0.5 for readability */
    cursor: not-allowed !important;
}

/* External link indicator for screen readers */
.external-link-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Ensure code blocks have sufficient contrast */
code,
pre {
    background-color: rgb(241 245 249);
    color: rgb(30 41 59);
}

/* Fix button contrast on hover states */
.hover\:bg-\[\#525369\]:hover {
    background-color: rgb(66 67 84) !important; /* Darker for better contrast */
}

/* Ensure loading indicators are visible */
.animate-spin,
.loading {
    border-color: #585878 !important;
}

/* Form accessibility enhancements */
.error-message {
    color: rgb(185 28 28);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.error-message.show {
    display: block;
}

.form-help {
    color: rgb(75 85 99);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.form-group.has-error input,
.form-group.has-error textarea {
    border-color: rgb(185 28 28) !important;
    box-shadow: 0 0 0 1px rgb(185 28 28) !important;
}

.form-group.has-error .form-label {
    color: rgb(185 28 28);
}

/* Required field indicator */
.required {
    color: rgb(185 28 28);
    font-weight: bold;
}

/* Loading state for submit button */
.form-submit-btn[aria-busy="true"] {
    opacity: 0.7;
    cursor: not-allowed;
}

.form-submit-btn[aria-busy="true"] .btn-icon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Language code styling */
.language-code,
.language-code-header {
    display: inline-block;
    background-color: rgb(88 88 120);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    margin-right: 6px;
    line-height: 1;
}

.language-code-header {
    margin-right: 4px;
}

/* Current language indicator */
a[aria-current="true"] .language-code {
    background-color: rgb(71 71 97);
    outline: 2px solid rgb(88 88 120);
    outline-offset: 2px;
}

/* Responsive design and zoom support (200% zoom) */
@media (min-width: 320px) {
    /* Ensure content doesn't break at small widths */
    body {
        overflow-x: hidden;
    }
    
    /* Flexible containers */
    .container,
    .max-w-7xl,
    .max-w-4xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    /* Responsive navigation */
    nav {
        flex-wrap: wrap;
    }
    
    .nav-links {
        overflow-x: auto;
        scrollbar-width: none;
        -ms-overflow-style: none;
    }
    
    .nav-links::-webkit-scrollbar {
        display: none;
    }
    
    /* Flexible grid layouts - only apply to very small screens */
    .grid {
        display: grid;
        gap: 1rem;
    }
}

/* Responsive grid fixes for training filters and homepage elements */
@media (min-width: 640px) {
    /* Ensure training filters display horizontally on medium+ screens */
    .training-filters .grid,
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 768px) {
    /* Medium screens: restore proper grid layouts */
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    /* Large screens: restore all grid layouts including homepage key factors */
    .lg\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    
    .lg\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
    
    .lg\:grid-cols-5 {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* Continue with the existing responsive layout rules for small screens */
@media (min-width: 320px) {
    /* Responsive text */
    .text-4xl,
    .text-3xl,
    .text-2xl {
        line-height: 1.2;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Flexible images */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Touch targets for mobile/zoom */
    button,
    a,
    input[type="checkbox"],
    input[type="radio"] {
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Exception for inline links */
    p a,
    li a,
    .prose a {
        min-height: auto;
        min-width: auto;
        display: inline;
        padding: 1px 2px;
    }
}

/* Additional zoom support */
@media (min-resolution: 1.5dppx) and (max-width: 768px) {
    /* High DPI mobile devices */
    body {
        font-size: 16px; /* Prevent zoom on focus */
    }
    
    input,
    textarea,
    select {
        font-size: 16px; /* Prevent zoom on focus */
    }
}

/* Zoom-specific adjustments */
@supports (zoom: 2) {
    html {
        scroll-behavior: smooth;
    }
    
    /* Ensure proper reflow at high zoom */
    .flex {
        flex-wrap: wrap;
    }
    
    .fixed {
        position: static;
    }
    
    /* Mobile menu adjustments for zoom */
    #mobile-menu {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    /* Remove backdrop blur for reduced motion */
    .backdrop-blur-sm,
    .backdrop-blur-xl,
    .backdrop-blur-2xl {
        backdrop-filter: none !important;
    }
}

/* 400% Zoom Support - EU Accessibility Act Requirement */
@media (min-width: 320px) and (max-width: 1280px) {
    /* At 400% zoom, 1280px becomes 320px */
    
    /* Horizontal scrolling prevention */
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    
    /* Flexible navigation */
    nav {
        flex-wrap: wrap;
        overflow: visible;
    }
    
    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
    }
    
    /* Stack language switcher */
    #language-switcher-btn {
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
    }
    
    /* Responsive grids become single column at high zoom */
    .grid,
    .md\:grid-cols-2,
    .md\:grid-cols-3,
    .lg\:grid-cols-2,
    .lg\:grid-cols-3,
    .lg\:grid-cols-4,
    .lg\:grid-cols-5 {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    /* Flexible containers */
    .container,
    .max-w-7xl,
    .max-w-4xl,
    .max-w-2xl {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    
    /* Text reflow */
    h1, h2, h3, h4, h5, h6 {
        word-wrap: break-word;
        overflow-wrap: break-word;
        hyphens: auto;
    }
    
    p, li, span {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Flexible form layout */
    .form-row {
        flex-direction: column;
    }
    
    .form-group {
        width: 100% !important;
        margin-bottom: 1rem;
    }
    
    /* Button adjustments */
    .btn-primary-large,
    .form-submit-btn {
        width: 100%;
        max-width: none;
        padding: 1rem 2rem;
        font-size: 1.125rem;
    }
    
    /* Image adjustments */
    img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Card layouts */
    .block {
        margin-bottom: 1rem;
    }
    
    /* Footer responsive */
    footer .grid {
        grid-template-columns: 1fr !important;
        text-align: center;
    }
    
    /* Mobile menu full width */
    #mobile-menu {
        width: 100vw !important;
        max-width: none !important;
    }
}

/* Enhanced touch targets for 400% zoom */
@media (min-width: 320px) and (max-width: 1280px) {
    button,
    a,
    input[type="checkbox"],
    input[type="radio"],
    .cursor-pointer {
        min-height: 48px !important;
        min-width: 48px !important;
        padding: 0.75rem 1rem !important;
    }
    
    /* Form controls */
    input[type="text"],
    input[type="email"],
    textarea,
    select {
        min-height: 48px !important;
        padding: 0.75rem !important;
        font-size: 1rem !important;
    }
    
    /* Navigation links */
    nav a {
        padding: 1rem !important;
        display: block;
        text-align: center;
    }
}

/* Horizontal scrolling test at extreme zoom */
@media (max-width: 320px) {
    * {
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    
    .fixed {
        position: static !important;
    }
    
    nav {
        position: static !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }
    
    .container,
    .max-w-7xl,
    .max-w-4xl {
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    
    /* Ensure text doesn't overflow */
    h1, h2, h3 {
        font-size: 1.5rem !important;
        line-height: 1.2 !important;
    }
    
    .text-4xl,
    .text-3xl,
    .text-2xl {
        font-size: 1.25rem !important;
    }
}

/* Print styles for better accessibility */
@media print {
    .no-print {
        display: none !important;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
    
    abbr[title]:after {
        content: " (" attr(title) ")";
    }
}

/* Force body bottom spacing - footer spacing fix */
html {
    height: auto !important;
    min-height: auto !important;
}

body.bg-white.antialiased.pb-20 {
    height: auto !important;
    min-height: auto !important;
    padding-bottom: 2.5rem !important;
    background: linear-gradient(to bottom, white calc(100% - 2.5rem), #585878 calc(100% - 2.5rem)) !important;
}

/* Increase space above footer horizontal line */
footer .border-t {
    margin-top: 2.5rem !important;
}

/* Add space at the beginning of the footer */
footer#footer {
    margin-top: 5rem !important;
}

/* Alternative approach - add padding to main content */
main#main-content {
    padding-bottom: 3rem !important;
}