/* Cardiff Surveyors - Main Stylesheet */
/* Modern, Professional, SEO-Optimized Design */

:root {
    --primary-color: #1a365d;
    --secondary-color: #2c5282;
    --accent-color: #d4af37;
    --text-dark: #2d3748;
    --text-light: #718096;
    --white: #ffffff;
    --light-bg: #f7fafc;
    --border-color: #e2e8f0;
    --success-color: #48bb78;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    font-size: 16px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: var(--transition);
}

a:hover {
    color: var(--secondary-color);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.5rem;
}

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

ul, ol {
    margin-bottom: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.wide-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.site-header {
    background: var(--white);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-top {
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 0;
    font-size: 0.9rem;
}

.header-top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.header-main {
    padding: 20px 0;
}

.header-main .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    background: var(--accent-color);
    color: var(--white);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 1.2rem;
}

/* Navigation */
.main-nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.main-nav a {
    color: var(--text-dark);
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-color);
    transition: var(--transition);
}

.main-nav a:hover::after,
.main-nav a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 600px;
    display: flex;
    align-items: center;
    color: var(--white);
    overflow: hidden;
}

.hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(26, 54, 93, 0.9) 0%, rgba(44, 82, 130, 0.85) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 60px 0;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.hero h1 {
    color: var(--white);
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-text {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.hero-features {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 2rem;
}

.hero-feature {
    display: flex;
    align-items: center;
    gap: 10px;
}

.hero-feature-icon {
    background: var(--accent-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 14px 32px;
    border-radius: 8px;
    font-weight: 600;
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-align: center;
}

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

.btn-primary:hover {
    background: #c19b2f;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--light-bg);
    transform: translateY(-2px);
}

/* Contact Form */
.contact-form-wrapper {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.contact-form-title {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.contact-form-subtitle {
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Sections */
.section {
    padding: 80px 0;
}

.section-light {
    background: var(--light-bg);
}

.section-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 50px;
}

.section-subtitle {
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
    margin-bottom: 10px;
}

.section-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.section-description {
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Grid Layouts */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: var(--transition);
    height: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    color: var(--white);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.card h3 {
    margin-bottom: 15px;
}

.card p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    line-height: 1.8;
}

.card ul {
    margin-bottom: 1.5rem;
}

.card li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

/* Service Cards */
.service-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.service-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.service-card-content {
    padding: 25px;
}

.service-card h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
}

.service-card-price {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 15px;
}

/* Team Members */
.team-member {
    text-align: center;
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: var(--transition);
}

.team-member:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.team-member-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 20px;
    border: 5px solid var(--accent-color);
}

.team-member h3 {
    margin-bottom: 5px;
}

.team-member-title {
    color: var(--accent-color);
    font-weight: 600;
    margin-bottom: 10px;
}

.team-member-credentials {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

/* Testimonials */
.testimonial {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    position: relative;
}

.testimonial-rating {
    color: var(--accent-color);
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.testimonial-text {
    font-style: italic;
    color: var(--text-light);
    margin-bottom: 20px;
    line-height: 1.8;
}

.testimonial-author {
    font-weight: 600;
    color: var(--primary-color);
}

.testimonial-location {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* Stats */
.stats {
    background: var(--primary-color);
    color: var(--white);
    padding: 60px 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 40px;
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 10px;
}

.stat-label {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* FAQ */
.faq-item {
    background: var(--white);
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.faq-question {
    width: 100%;
    padding: 20px;
    background: none;
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    margin: 0;
    position: relative;
}

/* Only add auto-icon if there's no explicit .faq-icon child */
.faq-question:not(:has(.faq-icon))::after {
    content: '\f078';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: 15px;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.faq-question:hover {
    background: var(--light-bg);
}

.faq-icon {
    transition: var(--transition);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Rotate auto-generated icon when active */
.faq-item.active .faq-question:not(:has(.faq-icon))::after {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-item.active .faq-answer {
    padding: 0 20px 20px;
    max-height: 1000px;
}

.faq-answer p {
    color: var(--text-light);
    line-height: 1.8;
}

/* Blog */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.blog-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: var(--transition);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.blog-card-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
}

.blog-card-content {
    padding: 25px;
}

.blog-card-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.blog-card h3 {
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.blog-card h3 a {
    color: var(--primary-color);
}

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

.blog-card-excerpt {
    color: var(--text-light);
    margin-bottom: 15px;
}

.read-more {
    color: var(--accent-color);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Blog Article */
.blog-article {
    max-width: 800px;
    margin: 0 auto;
}

.article-header {
    text-align: center;
    margin-bottom: 40px;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: var(--text-light);
    margin-bottom: 20px;
}

.article-title {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
}

.article-featured-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 40px;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content h2 {
    margin-top: 40px;
    margin-bottom: 20px;
}

.article-content h3 {
    margin-top: 30px;
    margin-bottom: 15px;
}

.article-content ul, .article-content ol {
    margin-left: 30px;
    margin-bottom: 1.5rem;
}

.article-content li {
    margin-bottom: 0.75rem;
    line-height: 1.8;
}

.article-content blockquote {
    border-left: 4px solid var(--accent-color);
    padding-left: 20px;
    margin: 30px 0;
    font-style: italic;
    color: var(--text-light);
}

/* Footer */
.site-footer {
    background: var(--primary-color);
    color: var(--white);
    padding: 60px 0 20px;
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.footer-about h3,
.footer-links h4 {
    color: var(--accent-color);
    margin-bottom: 20px;
}

.footer-about p {
    opacity: 0.9;
    line-height: 1.8;
}

.footer-links ul {
    list-style: none;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--white);
    opacity: 0.9;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

.accreditations {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.accreditation-badge {
    background: var(--white);
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 0.9rem;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 20px;
    text-align: center;
    opacity: 0.8;
}

/* CTA Section */
.cta-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: var(--white);
    padding: 80px 0;
    text-align: center;
}

.cta-section h2 {
    color: var(--white);
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.cta-section p {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.95;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-primary {
    background: var(--primary-color);
    color: var(--white);
}

.badge-accent {
    background: var(--accent-color);
    color: var(--white);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-main {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--white);
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        padding: 20px;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .main-nav ul {
        flex-direction: column;
        gap: 0;
    }
    
    .main-nav li {
        padding: 15px 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .menu-toggle {
        display: block;
    }
    
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-main {
        grid-template-columns: 1fr;
    }
    
    /* Mobile Form Adjustments */
    .contact-form-wrapper {
        padding: 20px;
    }
    
    .section {
        padding: 40px 0;
    }
}

/* HubSpot Form Mobile Fixes */
/* Ensure HubSpot forms display properly on mobile devices */
#hubspot-form-top,
#hubspot-form-bottom,
#hubspot-contact-form {
    width: 100% !important;
    max-width: 100% !important;
    min-height: 400px;
}

/* HubSpot form container responsive styles */
.hbspt-form {
    width: 100% !important;
    max-width: 100% !important;
}

/* 
/* ====================================================================
   MOBILE OPTIMIZATION - 100% RESPONSIVE
   Enhanced mobile experience with touch-friendly interactions
   ==================================================================== */

/* Mobile-First Improvements */
@media (max-width: 480px) {
    /* Ultra-small mobile devices */
    body {
        font-size: 14px;
    }
    
    h1 {
        font-size: 1.75rem;
        line-height: 1.3;
    }
    
    h2 {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    h3 {
        font-size: 1.25rem;
        line-height: 1.3;
    }
    
    .hero h1 {
        font-size: 1.85rem;
        line-height: 1.3;
    }
    
    .hero {
        min-height: 500px;
    }
    
    .hero-text {
        font-size: 0.95rem;
    }
    
    /* Improved container padding for small screens */
    .container {
        padding: 0 15px;
    }
    
    /* Section spacing optimization */
    .section {
        padding: 30px 0;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .section-description {
        font-size: 0.95rem;
    }
    
    /* Button optimization for touch */
    .btn {
        padding: 14px 24px;
        font-size: 0.95rem;
        width: 100%;
        text-align: center;
        display: block;
    }
    
    /* Header adjustments */
    .header-top {
        font-size: 0.8rem;
        padding: 8px 0;
    }
    
    .header-info,
    .header-cta {
        font-size: 0.8rem;
    }
    
    .logo {
        font-size: 1.2rem;
    }
    
    .logo-icon {
        width: 38px;
        height: 38px;
        font-size: 1rem;
    }
    
    /* Card improvements */
    .service-card,
    .blog-card {
        margin-bottom: 20px;
    }
    
    .service-card-content,
    .blog-card-content {
        padding: 20px;
    }
    
    /* Form improvements */
    .contact-form-wrapper {
        padding: 15px;
    }
    
    .contact-form-title {
        font-size: 1.3rem;
    }
    
    /* Table responsiveness */
    table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Footer adjustments */
    .footer-main {
        gap: 30px;
    }
    
    .footer-section h3 {
        font-size: 1.1rem;
    }
}

/* Touch-Friendly Enhancements (All Mobile) */
@media (max-width: 768px) {
    /* Larger touch targets (minimum 44x44px per Apple/Google guidelines) */
    .btn,
    .main-nav a,
    .menu-toggle,
    button,
    input[type="submit"],
    input[type="button"],
    a.btn {
        min-height: 44px;
        min-width: 44px;
        padding: 12px 20px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Navigation touch optimization */
    .main-nav a {
        padding: 15px 20px;
        display: block;
        font-size: 1rem;
    }
    
    .menu-toggle {
        padding: 10px;
        font-size: 1.8rem;
        min-width: 50px;
        min-height: 50px;
    }
    
    /* Prevent horizontal scroll */
    body {
        overflow-x: hidden;
    }
    
    .container,
    .wide-container {
        overflow-x: hidden;
    }
    
    /* Images responsive */
    img {
        max-width: 100%;
        height: auto;
    }
    
    /* Video responsive */
    video {
        max-width: 100%;
        height: auto;
    }
    
    /* Hero mobile optimization */
    .hero-content {
        padding: 30px 0;
    }
    
    .hero-features {
        flex-direction: column;
        gap: 10px;
    }
    
    .hero-feature {
        width: 100%;
        justify-content: flex-start;
    }
    
    /* Stats section mobile */
    .stat-card {
        padding: 25px;
        text-align: center;
    }
    
    /* Badge mobile optimization */
    .badge {
        font-size: 0.75rem;
        padding: 6px 12px;
    }
    
    /* Article/Blog mobile improvements */
    .article-featured-image,
    .service-card-image {
        border-radius: 8px;
        margin-bottom: 15px;
    }
    
    .article-content,
    .blog-article {
        font-size: 1rem;
        line-height: 1.8;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
        margin-top: 30px;
        margin-bottom: 15px;
    }
    
    .article-content h3 {
        font-size: 1.25rem;
        margin-top: 25px;
        margin-bottom: 12px;
    }
    
    /* List improvements for mobile */
    .article-content ul,
    .article-content ol {
        padding-left: 20px;
        margin-bottom: 20px;
    }
    
    .article-content li {
        margin-bottom: 10px;
        line-height: 1.7;
    }
    
    /* Call-to-action mobile optimization */
    .cta-section {
        padding: 40px 20px;
    }
    
    .cta-title {
        font-size: 1.75rem;
    }
    
    /* Footer mobile optimization */
    .footer-section {
        margin-bottom: 30px;
    }
    
    .footer-section ul {
        margin-top: 15px;
    }
    
    .footer-section li {
        margin-bottom: 12px;
    }
    
    .footer-section a {
        font-size: 0.95rem;
        padding: 5px 0;
        display: inline-block;
    }
    
    /* Header top mobile improvements */
    .header-top .container {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
    
    .header-info,
    .header-cta {
        width: 100%;
    }
}

/* Landscape mobile optimization (phones in landscape) */
@media (max-width: 768px) and (orientation: landscape) {
    .hero {
        min-height: 400px;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .section {
        padding: 35px 0;
    }
}

/* Tablet-specific optimizations (768px - 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Optimized layouts for tablets */
    h1 {
        font-size: 2.25rem;
    }
    
    h2 {
        font-size: 1.85rem;
    }
    
    .hero h1 {
        font-size: 2.4rem;
    }
    
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 0 30px;
    }
    
    /* Touch targets for tablet */
    .btn,
    button {
        min-height: 44px;
        padding: 12px 24px;
    }
}

/* iOS-specific fixes */
@supports (-webkit-touch-callout: none) {
    /* iOS Safari specific styles */
    input,
    textarea,
    select {
        font-size: 16px !important; /* Prevents zoom on focus */
    }
    
    .btn,
    button {
        -webkit-appearance: none;
        border-radius: 8px;
    }
}

/* Android-specific fixes */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select,
    textarea,
    input {
        font-size: 16px; /* Prevents zoom on Android */
    }
}

/* High-DPI mobile screens */
@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    /* Optimize for retina/high-DPI mobile displays */
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Accessibility - Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print optimization */
@media print {
    .site-header,
    .site-footer,
    .cta-section,
    .menu-toggle {
        display: none;
    }
    
    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
}

/* HubSpot Form Mobile Enhancements */
@media (max-width: 768px) {
    /* Form container improvements */
    #hubspot-form-top,
    #hubspot-form-bottom,
    #hubspot-contact-form {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
    }
    
    /* HubSpot iframe mobile optimization */
    .hbspt-form iframe {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* Form fields mobile optimization */
    .hs-form-field {
        margin-bottom: 15px !important;
    }
    
    .hs-input {
        font-size: 16px !important; /* Prevents zoom on iOS */
        padding: 12px !important;
        width: 100% !important;
    }
    
    .hs-button {
        width: 100% !important;
        padding: 14px 20px !important;
        font-size: 16px !important;
        min-height: 48px !important;
    }
    
    /* Form loading state mobile */
    .form-loading-spinner {
        width: 40px !important;
        height: 40px !important;
    }
}

/* Additional mobile performance optimizations */
@media (max-width: 768px) {
    /* Optimize animations for mobile performance */
    * {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* Smooth scrolling */
    html {
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Prevent text size adjustment on orientation change */
    body {
        -webkit-text-size-adjust: 100%;
        -moz-text-size-adjust: 100%;
        -ms-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

/* End of Mobile Optimization - 100% Responsive */
