/* Global Styles - Doulos Networks Brand Colors */
:root {
    --primary-color: #1a3a5c;
    --secondary-color: #2d5a87;
    --accent-color: #c8102e;
    --text-dark: #1a1a1a;
    --text-light: #ffffff;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Dark Mode Variables */
.dark-mode {
    --primary-color: #4a7ba7;
    --secondary-color: #6ba3d4;
    --accent-color: #ff4444;
    --text-dark: #e0e0e0;
    --text-light: #ffffff;
    --bg-light: #1a1a1a;
    --bg-white: #2d2d2d;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.7);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Skip to main content link */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: var(--text-light);
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    font-weight: 600;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden; /* Prevent horizontal scroll */
    font-size: 16px; /* Base font size for accessibility */
    letter-spacing: 0.01em; /* Slight letter spacing for readability */
}

/* Typography improvements */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 0.5em;
}

p {
    line-height: 1.7;
    margin-bottom: 1em;
}

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* 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;
    }
}

/* 8px spacing grid system */
:root {
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* Header & Navigation */
header {
    background-color: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1400px;
    margin: 0 auto;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 50px;
    width: auto;
    max-width: 250px;
    object-fit: contain;
    display: block;
    max-height: 50px;
    /* Ensure size stays consistent across all modes */
    box-sizing: border-box;
}

.wip-disclaimer {
    font-size: 0.75rem;
    color: var(--accent-color);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    background-color: rgba(200, 16, 46, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Prevent logo from breaking layout on small screens */
@media (max-width: 480px) {
    .logo {
        flex-shrink: 0;
    }
    
    .logo-img {
        max-width: 100%;
        height: auto;
        max-height: 40px;
    }
}

.logo h1 {
    color: var(--primary-color);
    font-size: 1.8rem;
    font-weight: 700;
}

/* Mobile menu toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-dark);
    cursor: pointer;
    padding: var(--spacing-sm);
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

/* Mobile navigation */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }
    
    .nav-links {
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background-color: var(--bg-white);
        flex-direction: column;
        padding: var(--spacing-lg);
        box-shadow: var(--shadow);
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 999;
        gap: 0;
    }
    
    .nav-links.active {
        transform: translateX(0);
    }
    
    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--bg-light);
    }
    
    .nav-links a {
        display: block;
        padding: var(--spacing-md);
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .accessibility-controls {
        flex-wrap: wrap;
        gap: var(--spacing-sm);
    }
}

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--text-light);
    padding: 6rem 2rem;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.95;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Buttons */
.btn {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    min-height: 44px; /* Touch target size */
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background-color: #d62839;
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-light);
    border: 2px solid var(--text-light);
}

.btn-secondary:hover {
    background-color: var(--text-light);
    color: var(--primary-color);
}

.btn-info {
    background-color: var(--secondary-color);
    color: var(--text-light);
}

.btn-info:hover {
    background-color: #3d8f8c;
}

/* Section separators */
section {
    position: relative;
}

section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.3;
}

/* Mission Section */
.mission {
    padding: var(--spacing-3xl) var(--spacing-md);
    background-color: var(--bg-white);
    text-align: center;
}

.mission h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 1.5rem;
}

.mission p {
    font-size: 1.3rem;
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.8;
}

/* Services Section */
.services {
    padding: 5rem 2rem;
    background-color: var(--bg-light);
}

.services h2 {
    text-align: center;
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.service-card {
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
    text-align: center;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
    border: 2px solid transparent;
}

.service-card:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.service-icon {
    margin-bottom: 1.5rem;
    width: 64px;
    height: 64px;
    display: block;
    margin-left: auto;
    margin-right: auto;
    transition: opacity 0.2s ease;
    position: relative;
    z-index: 1;
}

.service-icon img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.service-icon svg {
    width: 100%;
    height: 100%;
    stroke: var(--primary-color);
    fill: none;
    transition: stroke 0.2s ease;
    display: block;
}

.service-card:hover .service-icon {
    opacity: 0.9;
}

.service-card:hover .service-icon svg {
    stroke: var(--accent-color);
}

.service-card h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    margin-top: 0;
    padding-top: 0;
    transition: color 0.2s ease;
    position: relative;
    z-index: 2;
    clear: both;
}

.service-card:hover h3 {
    color: var(--accent-color);
}

.service-card p {
    margin-bottom: 1.5rem;
    color: var(--text-dark);
    opacity: 0.8;
    margin-top: 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    background-color: var(--bg-white);
    margin: 10% auto;
    padding: 2rem;
    border-radius: 10px;
    max-width: 600px;
    position: relative;
    animation: slideIn 0.3s ease-out;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    color: var(--text-dark);
    opacity: 0.7;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.close:hover {
    opacity: 1;
    color: var(--text-dark);
}

#modal-title {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 2rem;
}

.service-details {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.8;
}

/* Security Section */
.security {
    padding: 4rem 2rem;
    background-color: var(--bg-white);
    text-align: center;
}

.security h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.security-details {
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 10px;
    max-width: 800px;
    margin: 0 auto;
    text-align: left;
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.8;
    box-shadow: var(--shadow);
}

/* Estimator Section */
.estimator {
    padding: 4rem 2rem;
    background-color: var(--bg-light);
}

.estimator h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.estimator-form {
    max-width: 600px;
    margin: 0 auto;
    background-color: var(--bg-white);
    padding: 2rem;
    border-radius: 10px;
    box-shadow: var(--shadow);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-dark);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
    -webkit-appearance: none; /* Remove iOS default styling */
    -moz-appearance: none;
    appearance: none;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    /* Fix iOS input zoom on focus */
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    /* Larger touch targets */
    .btn {
        min-height: 48px;
        min-width: 48px;
        padding: var(--spacing-md) var(--spacing-lg);
    }
    
    /* Better spacing on mobile */
    .container {
        padding: 0 var(--spacing-md);
    }
    
    section {
        padding: var(--spacing-2xl) var(--spacing-md) !important;
    }
    
    /* Hero adjustments */
    .hero {
        padding: var(--spacing-3xl) var(--spacing-md);
    }
    
    .hero h1, .hero #hero-heading {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .cta-buttons .btn {
        width: 100%;
    }
    
    /* Service cards stack on mobile */
    .services-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
    
    .service-icon {
        margin-bottom: var(--spacing-md);
    }
    
    .service-card {
        padding: var(--spacing-lg);
    }
    
    /* Testimonial carousel adjustments */
    .testimonial-carousel {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .carousel-btn {
        width: 100%;
        padding: var(--spacing-md);
    }
    
    /* Footer adjustments */
    footer .container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Form validation states */
.form-group input.error,
.form-group textarea.error {
    border-color: var(--accent-color);
    border-width: 2px;
    background-color: #fff5f5;
}

.form-group input.valid,
.form-group textarea.valid {
    border-color: #28a745;
    border-width: 2px;
    background-color: #f0fff4;
}

.error-message {
    display: none;
    color: var(--accent-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-weight: 600;
}

.cost-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 5px;
    white-space: pre-wrap;
    font-family: inherit;
    display: none;
}

.cost-result.show {
    display: block;
    animation: fadeIn 0.5s ease-out;
}

/* Testimonials Section */
.testimonials {
    padding: 4rem 2rem;
    background-color: var(--bg-white);
}

.testimonials h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.testimonial-carousel {
    max-width: 800px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.testimonial-content {
    flex: 1;
    background-color: var(--bg-light);
    padding: 2rem;
    border-radius: 10px;
    font-style: italic;
    font-size: 1.1rem;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: var(--shadow);
    transition: opacity 0.5s ease, transform 0.5s ease;
    position: relative;
}

.testimonial-content.fade-out {
    opacity: 0;
}

.testimonial-content.fade-in {
    opacity: 1;
}

.testimonial-quote {
    font-style: italic;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: var(--spacing-md);
    color: var(--text-dark);
}

.testimonial-author {
    margin-top: var(--spacing-md);
    font-weight: 600;
    font-style: normal;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.testimonial-organization {
    font-size: 0.85rem;
    color: var(--text-dark);
    opacity: 0.7;
    margin-top: var(--spacing-xs);
    font-style: normal;
}

.carousel-btn {
    background-color: var(--primary-color);
    color: var(--text-light);
    border: none;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-btn:hover {
    background-color: var(--secondary-color);
}

/* About Section */
.about {
    padding: 4rem 2rem;
    background-color: var(--bg-light);
}

.about h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.about p {
    max-width: 800px;
    margin: 0 auto 1.5rem;
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Loading spinner */
.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--text-light);
    animation: spin 0.8s linear infinite;
    margin-right: var(--spacing-sm);
}

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

/* Skeleton loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Error notification */
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--accent-color);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    max-width: 300px;
    animation: slideInRight 0.3s ease-out;
}

/* Keyboard shortcut hint (for power users) */
.keyboard-hint {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-size: 0.85rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.keyboard-hint.show {
    opacity: 1;
}

/* Contact Section */
.contact {
    padding: var(--spacing-3xl) var(--spacing-md);
    background-color: var(--bg-white);
}

.contact h2 {
    text-align: center;
    color: var(--primary-color);
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.contact-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-result {
    max-width: 600px;
    margin: 2rem auto 0;
    padding: 1.5rem;
    border-radius: 8px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-result.success {
    display: block;
    background-color: #d4edda;
    color: #155724;
    border: 2px solid #c3e6cb;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
}

.form-result.error {
    display: block;
    background-color: #f8d7da;
    color: #721c24;
    border: 2px solid #f5c6cb;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.2);
}

.form-result.loading {
    display: block;
    background-color: #e7f3ff;
    color: #004085;
    border: 2px solid #b3d9ff;
    text-align: center;
}

.success-content,
.error-content {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.success-content h3,
.error-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: 700;
}

.success-content p,
.error-content p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.success-content .summary-text {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    font-size: 0.9rem;
    white-space: pre-line;
}

.error-content ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.error-content li {
    margin: 0.5rem 0;
}

.success-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: #28a745;
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: bold;
    flex-shrink: 0;
}

.error-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: bold;
    flex-shrink: 0;
}

.loading-spinner {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    border: 2px solid #004085;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
    vertical-align: middle;
}

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

/* Footer */
footer {
    background-color: var(--text-dark);
    color: var(--text-light);
    padding: 2rem;
    text-align: center;
}

footer p {
    margin: 0.5rem 0;
}

.service-area {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 1rem;
}

.service-area-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.service-area-info h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.service-area-info p {
    margin-bottom: 0.75rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Simplified animations - removed complex transforms */

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Responsive Design */

/* Mobile Phones (320px - 480px) */
@media (max-width: 480px) {
    nav {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }

    .logo-img {
        height: 40px;
        max-width: 180px;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem;
        margin-top: 0.5rem;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        display: block;
        padding: 0.5rem;
    }

    .hero {
        padding: 3rem 1rem;
    }

    .hero h2 {
        font-size: 1.75rem;
        line-height: 1.2;
    }

    .hero-subtitle {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
    }

    .cta-buttons {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn {
        width: 100%;
        padding: 0.75rem 1.5rem;
        font-size: 0.95rem;
    }

    .mission {
        padding: 2.5rem 1rem;
    }

    .mission h2 {
        font-size: 1.75rem;
    }

    .mission p {
        font-size: 1rem;
    }

    .services {
        padding: 2.5rem 1rem;
    }

    .services h2 {
        font-size: 1.75rem;
        margin-bottom: 2rem;
    }

    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .service-card {
        padding: 1.5rem;
    }

    .service-icon {
        font-size: 3rem;
    }

    .service-card h3 {
        font-size: 1.25rem;
    }

    .security {
        padding: 2.5rem 1rem;
    }

    .security h2 {
        font-size: 1.75rem;
    }

    .security-details {
        padding: 1.5rem;
        font-size: 0.95rem;
    }

    .estimator {
        padding: 2.5rem 1rem;
    }

    .estimator h2 {
        font-size: 1.75rem;
    }

    .estimator-form {
        padding: 1.5rem;
    }

    .testimonials {
        padding: 2.5rem 1rem;
    }

    .testimonials h2 {
        font-size: 1.75rem;
    }

    .testimonial-carousel {
        flex-direction: column;
        gap: 0.75rem;
    }

    .testimonial-content {
        padding: 1.5rem;
        font-size: 1rem;
        min-height: 120px;
    }

    .carousel-btn {
        width: 100%;
        font-size: 1.5rem;
        padding: 0.75rem;
    }

    .about {
        padding: 2.5rem 1rem;
    }

    .about h2 {
        font-size: 1.75rem;
    }

    .about p {
        font-size: 1rem;
    }

    .contact {
        padding: 2.5rem 1rem;
    }

    .contact h2 {
        font-size: 1.75rem;
    }

    .contact-form {
        padding: 0;
    }

    .modal-content {
        margin: 5% auto;
        padding: 1.5rem;
        max-width: 90%;
    }

    #modal-title {
        font-size: 1.5rem;
    }

    .service-details {
        padding: 1rem;
        font-size: 0.95rem;
    }

    footer {
        padding: 1.5rem 1rem;
    }

    footer p {
        font-size: 0.9rem;
    }
}

/* Large Phones / Small Tablets (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    nav {
        padding: 1rem 1.5rem;
    }

    .logo-img {
        height: 45px;
        max-width: 200px;
    }

    .nav-links {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .hero {
        padding: 4rem 1.5rem;
    }

    .hero h2 {
        font-size: 2.25rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .cta-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }

    .btn {
        min-width: 150px;
    }

    .mission {
        padding: 3rem 1.5rem;
    }

    .mission h2 {
        font-size: 2rem;
    }

    .mission p {
        font-size: 1.1rem;
    }

    .services {
        padding: 3.5rem 1.5rem;
    }

    .services h2 {
        font-size: 2rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .security {
        padding: 3rem 1.5rem;
    }

    .security h2 {
        font-size: 2rem;
    }

    .estimator {
        padding: 3rem 1.5rem;
    }

    .estimator h2 {
        font-size: 2rem;
    }

    .testimonials {
        padding: 3rem 1.5rem;
    }

    .testimonials h2 {
        font-size: 2rem;
    }

    .testimonial-carousel {
        flex-direction: row;
    }

    .carousel-btn {
        width: auto;
    }

    .about {
        padding: 3rem 1.5rem;
    }

    .about h2 {
        font-size: 2rem;
    }

    .contact {
        padding: 3rem 1.5rem;
    }

    .contact h2 {
        font-size: 2rem;
    }

    .modal-content {
        margin: 8% auto;
        max-width: 85%;
    }
}

/* Tablets (769px - 1024px) - iPad, Android Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    nav {
        padding: 1rem 2rem;
    }

    .hero {
        padding: 5rem 2rem;
    }

    .hero h2 {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }

    .mission h2,
    .services h2,
    .security h2,
    .estimator h2,
    .testimonials h2,
    .about h2,
    .contact h2 {
        font-size: 2.25rem;
    }
}

/* Small Desktops (1025px - 1280px) */
@media (min-width: 1025px) and (max-width: 1280px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Large Desktops (1281px+) */
@media (min-width: 1281px) {
    .container {
        max-width: 1400px;
    }

    .services-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Landscape Orientation Fixes */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        padding: 2rem 1rem;
    }

    .hero h2 {
        font-size: 1.5rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 1rem;
    }

    nav {
        padding: 0.5rem 1rem;
    }

    .logo-img {
        height: 35px;
    }
}

/* High DPI / Retina Displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .logo-img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Touch Device Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 44px; /* iOS recommended touch target */
        min-width: 44px;
    }

    .nav-links a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .carousel-btn {
        min-height: 44px;
        min-width: 44px;
    }

    .service-card {
        cursor: pointer;
    }

    /* Remove hover effects on touch devices */
    .service-card:hover {
        transform: none;
    }

    .btn-primary:hover {
        transform: none;
    }
}

/* Accessibility Features */

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Accessibility Controls */
.accessibility-controls {
    display: flex;
    flex-direction: row;
    gap: 0.5rem;
    align-items: center;
    margin-left: auto;
    flex-wrap: wrap;
}

.accessibility-btn {
    background: var(--primary-color);
    color: var(--text-light);
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    min-width: 80px;
    min-height: 60px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.btn-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon img {
    width: 100%;
    height: 100%;
    display: block;
    filter: brightness(0) invert(1); /* Make icons white */
}

.dark-mode .btn-icon img {
    filter: brightness(0) invert(1); /* Keep icons white in dark mode */
}

.btn-label {
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
}

.accessibility-btn:hover,
.accessibility-btn:focus {
    background: var(--secondary-color);
    outline: 3px solid var(--accent-color);
    outline-offset: 2px;
}

/* Dark Mode Styles */
.dark-mode body {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.dark-mode header {
    background-color: var(--bg-white);
    border-bottom: 1px solid #444;
}

.dark-mode .nav-links a {
    color: var(--text-dark);
}

.dark-mode .nav-links a:hover {
    color: var(--primary-color);
}

.dark-mode .hero {
    background: linear-gradient(135deg, #0f1f33, #1a3a5c);
}

.dark-mode .service-card,
.dark-mode .modal-content,
.dark-mode .estimator-form,
.dark-mode .testimonial-content,
.dark-mode .security-details {
    background-color: var(--bg-white);
    border: 1px solid #444;
}

.dark-mode .service-card:hover {
    border-color: var(--primary-color);
}

.dark-mode .form-group input,
.dark-mode .form-group select,
.dark-mode .form-group textarea {
    background-color: var(--bg-white);
    color: var(--text-dark);
    border-color: #555;
}

.dark-mode .form-group input:focus,
.dark-mode .form-group select:focus,
.dark-mode .form-group textarea:focus {
    border-color: var(--primary-color);
    background-color: var(--bg-white);
}

.dark-mode .form-group input.error,
.dark-mode .form-group textarea.error {
    border-color: var(--accent-color);
    background-color: rgba(200, 16, 46, 0.1);
}

.dark-mode .form-group input.valid,
.dark-mode .form-group textarea.valid {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.1);
}

.dark-mode .form-result.success {
    background-color: rgba(40, 167, 69, 0.2);
    border-color: #28a745;
    color: #d4edda;
}

.dark-mode .form-result.error {
    background-color: rgba(220, 53, 69, 0.2);
    border-color: var(--accent-color);
    color: #f8d7da;
}

.dark-mode .form-result.loading {
    background-color: rgba(0, 64, 133, 0.2);
    border-color: #4a7ba7;
    color: #b3d9ff;
}

.dark-mode .cost-result,
.dark-mode .service-details {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.dark-mode footer {
    background-color: #1a1a1a;
    border-top: 1px solid #444;
}

.dark-mode .accessibility-controls {
    background: var(--bg-white);
    border: 2px solid var(--primary-color);
}

.dark-mode .accessibility-btn {
    background: var(--primary-color);
    color: var(--text-light);
}

.dark-mode .accessibility-btn:hover,
.dark-mode .accessibility-btn:focus {
    background: var(--secondary-color);
}

.dark-mode .accessibility-controls {
    background: transparent;
    border: none;
}

.dark-mode .logo-img {
    filter: brightness(1.2) contrast(1.1);
}

.dark-mode .wip-disclaimer {
    color: var(--accent-color);
    background-color: rgba(255, 68, 68, 0.15);
    border-color: var(--accent-color);
}

/* Dark mode for specific elements */
.dark-mode .mission,
.dark-mode .security,
.dark-mode .about,
.dark-mode .contact {
    background-color: var(--bg-light);
}

.dark-mode .services {
    background-color: var(--bg-light);
}

.dark-mode .estimator {
    background-color: var(--bg-light);
}

.dark-mode .testimonials {
    background-color: var(--bg-light);
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3 {
    color: var(--text-dark);
}

.dark-mode .btn-secondary {
    border-color: var(--text-light);
    color: var(--text-light);
}

.dark-mode .btn-secondary:hover {
    background-color: var(--text-light);
    color: var(--primary-color);
}

.dark-mode .modal {
    background-color: rgba(0, 0, 0, 0.8);
}

.dark-mode .close {
    color: var(--text-dark);
}

.dark-mode .close:hover {
    color: var(--accent-color);
}

/* High Contrast Mode */
.high-contrast {
    --primary-color: #000000;
    --secondary-color: #000080;
    --accent-color: #ff0000;
    --text-dark: #000000;
    --text-light: #ffffff;
    --bg-light: #ffffff;
    --bg-white: #ffffff;
}

.high-contrast body {
    background: #ffffff;
    color: #000000;
}

.high-contrast .btn {
    border: 3px solid currentColor;
    font-weight: 700;
    /* Keep same size - use box-sizing to prevent size changes from border */
    box-sizing: border-box;
    /* Ensure padding and margins stay the same */
    padding: var(--spacing-md) var(--spacing-lg) !important;
    min-height: 48px !important;
    min-width: 48px !important;
}

.high-contrast .nav-links a,
.high-contrast a {
    text-decoration: underline;
}

.high-contrast .service-card,
.high-contrast .modal-content {
    border: 3px solid #000000;
    /* Keep same size - use box-sizing to prevent size changes from border */
    box-sizing: border-box;
}

/* High Contrast - Hero Section */
.high-contrast .hero {
    background: #000000 !important;
    background-image: none !important;
    color: #ffffff !important;
}

.high-contrast .hero h1,
.high-contrast .hero #hero-heading,
.high-contrast .hero h2,
.high-contrast .hero-subtitle,
.high-contrast .hero p,
.high-contrast .hero-content h1,
.high-contrast .hero-content #hero-heading {
    color: #ffffff !important;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8) !important;
}

.high-contrast .hero-content {
    color: #ffffff !important;
}

.high-contrast .hero-content * {
    color: #ffffff !important;
}

/* Override any global h1 rules in high contrast hero */
.high-contrast .hero h1,
.high-contrast .hero #hero-heading {
    color: #ffffff !important;
}

/* High Contrast - Logo Visibility */
/* Ensure logo is visible on white/gray backgrounds in high contrast */
.high-contrast header {
    background-color: #ffffff !important;
    border-bottom: 3px solid #000000;
    /* Keep same size - use box-sizing to prevent size changes from border */
    box-sizing: border-box;
}

.high-contrast .logo-img {
    filter: brightness(0);
    background: transparent;
    /* Keep same size - no padding or size changes */
    height: 50px !important;
    max-width: 250px !important;
    width: auto !important;
}

/* High Contrast - Header and Navigation */
.high-contrast header {
    background-color: #ffffff;
    border-bottom: 3px solid #000000;
}

.high-contrast .nav-links a {
    color: var(--text-dark);
    text-decoration: underline;
}

.high-contrast .nav-links a:hover {
    color: var(--secondary-color);
    background-color: #ffff00;
}

/* High Contrast - All text elements */
.high-contrast p,
.high-contrast .service-card p,
.high-contrast .testimonial-organization,
.high-contrast .help-text,
.high-contrast .close {
    color: var(--text-dark) !important;
    opacity: 1 !important;
}

.high-contrast .service-card h3,
.high-contrast h1,
.high-contrast h2,
.high-contrast h3,
.high-contrast h4,
.high-contrast h5,
.high-contrast h6 {
    color: var(--text-dark) !important;
}

.high-contrast footer,
.high-contrast footer a,
.high-contrast footer p {
    color: var(--text-light) !important;
}

/* Enhanced Focus Indicators */
.keyboard-navigation *:focus {
    outline: 4px solid var(--accent-color);
    outline-offset: 3px;
    box-shadow: 0 0 0 2px var(--bg-white), 0 0 0 6px var(--accent-color);
}

.keyboard-navigation button:focus,
.keyboard-navigation a:focus,
.keyboard-navigation input:focus,
.keyboard-navigation select:focus,
.keyboard-navigation textarea:focus {
    outline: 4px solid var(--accent-color);
    outline-offset: 3px;
}

/* Form Accessibility */
.required {
    color: var(--accent-color);
    font-weight: 700;
}


.help-text {
    display: block;
    color: var(--text-dark);
    opacity: 0.7;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    font-style: italic;
}

.form-group input:invalid:not(:focus):not(:placeholder-shown),
.form-group textarea:invalid:not(:focus):not(:placeholder-shown) {
    border-color: var(--accent-color);
    border-width: 3px;
}

.form-group input:valid:not(:focus):not(:placeholder-shown),
.form-group textarea:valid:not(:focus):not(:placeholder-shown) {
    border-color: #28a745;
}

/* Improved Readability */
body {
    font-size: 1rem;
    line-height: 1.7; /* Increased for better readability */
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 700;
}

p {
    line-height: 1.8;
    margin-bottom: 1rem;
}

/* Minimum contrast ratios for text */
.hero h1,
.hero h2 {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

/* Better button contrast */
.btn {
    font-weight: 600;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--text-light);
    border: 2px solid var(--accent-color);
}

.btn-secondary {
    border-width: 3px;
}

/* Modal Accessibility */
.modal[aria-hidden="true"] {
    display: none;
}

.modal[aria-hidden="false"] {
    display: block;
}

/* Service Details - Change from pre to div for better screen reader support */
.service-details {
    background-color: var(--bg-light);
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
    white-space: pre-wrap;
    font-family: inherit;
    line-height: 1.8;
    font-size: 1rem;
}

/* Cost Result - Change from pre to div */
.cost-result {
    margin-top: 1.5rem;
    padding: 1.5rem;
    background-color: var(--bg-light);
    border-radius: 5px;
    white-space: pre-wrap;
    font-family: inherit;
    display: none;
    font-size: 1rem;
    line-height: 1.8;
}

/* Mobile Accessibility Controls */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-links {
        order: 2;
    }
    
    .accessibility-controls {
        order: 3;
        width: 100%;
        justify-content: center;
        margin-top: 0.5rem;
        margin-left: 0;
        flex-wrap: wrap;
        padding: 0.5rem;
        background: var(--bg-light);
        border-radius: 8px;
        gap: 0.4rem;
    }
    
    .accessibility-btn {
        min-width: 70px;
        min-height: 55px;
        padding: 0.4rem 0.5rem;
        flex: 1 1 auto;
        max-width: 120px;
    }
    
    .btn-icon {
        font-size: 1rem;
    }
    
    .btn-label {
        font-size: 0.65rem;
        line-height: 1.1;
    }
}

/* Small mobile devices */
@media (max-width: 480px) {
    .accessibility-controls {
        gap: 0.3rem;
        padding: 0.4rem;
    }
    
    .accessibility-btn {
        min-width: 65px;
        min-height: 50px;
        padding: 0.35rem 0.4rem;
    }
    
    .btn-icon {
        font-size: 0.95rem;
    }
    
    .btn-label {
        font-size: 0.6rem;
    }
}

/* Tablet devices */
@media (min-width: 769px) and (max-width: 1024px) {
    .accessibility-btn {
        min-width: 75px;
        padding: 0.45rem 0.65rem;
    }
    
    .btn-label {
        font-size: 0.68rem;
    }
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%; /* Prevent iOS text size adjustment */
    -ms-text-size-adjust: 100%;
}

/* Prevent text overflow */
* {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
}

/* Fix for iOS Safari viewport height */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
}
