/* Homepage-specific styles */

:root {
    --hero-padding: 140px;
    --gradient-primary: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

/* Hero Section */
.hero {
    position: relative;
    background: url('../img/hero-bg.webp') no-repeat center center / cover;
    color: #ffffff;
    padding: 3rem 0 3rem;
    min-height: 60vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(10, 20, 50, 0.9) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 4rem;
    align-items: center;
}

/* Lead-form in hero: stack header above form (container too narrow for side-by-side) */
.hero-content .lead-form {
    grid-template-columns: 1fr;
    grid-template-areas:
        "header"
        "form"
        "badges";
    padding: 1.75rem;
}

.hero-content .lead-form .form-header {
    text-align: center;
    padding-top: 0;
}

.hero-content .lead-form .quote-form {
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
}

.hero h1 {
    font-size: 3.75rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    /* Reduced margin */
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.7);
    /* Much heavier shadow for pop */
    color: #ffffff;
}

.hero h1 span {
    color: #f59e0b;
    display: inline-block;
}

.hero-subtitle {
    font-size: 1.35rem;
    margin-bottom: 2rem;
    line-height: 1.6;
    max-width: 650px;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.trust-banner {
    background: #10b981;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    display: inline-block;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-trust-signals {
    display: flex;
    gap: 0.75rem;
    /* Tighter gap */
    margin: 1rem 0;
    /* Reduced from 2rem */
    flex-wrap: wrap;
}

.trust-signal-item {
    background: rgba(15, 23, 42, 0.85);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.trust-signal-item.prominent {
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
}

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.trust-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
}



/* Form Styles */
.lead-form {
    background: rgba(255, 255, 255, 0.97);
    -webkit-backdrop-filter: blur(25px);
    backdrop-filter: blur(25px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-xl);
    padding: 2.35rem 2rem 1.85rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
    color: #0f172a;
    scroll-margin-top: 170px;
}

.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.form-header h2 {
    font-size: 1.9rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #0f172a;
    /* Explicit contrast */
}

.form-header p {
    color: #475569;
    /* Slate gray for subtitle */
    margin: 0 auto 0.9rem;
    /* Reduced gap */
    font-weight: 500;
    max-width: 26rem;
}

.quote-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.quote-form-grid {
    display: grid;
    gap: 1rem;
    align-items: start;
}

.quote-form-grid-halves {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
    margin-bottom: 0;
    /* Layout gap handled by form grid */
}

.form-group label {
    display: block;
    font-weight: 700;
    /* Bolder */
    margin-bottom: 0.55rem;
    color: #0f172a;
    /* Deep Navy to avoid white-on-gray */
}

.form-control {
    width: 100%;
    min-height: 56px;
    padding: 0.95rem 1rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
    color: #0f172a;
    background: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.form-control:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.4);
}

.form-text {
    display: block;
    margin-top: 0.55rem;
    font-size: 0.8rem;
    line-height: 1.45;
    color: var(--text-secondary);
}

.form-actions {
    margin-top: 0.25rem;
    padding-top: 0.25rem;
}

.submit-btn {
    width: 100%;
    background: var(--primary);
    color: #ffffff;
    min-height: 58px;
    padding: 1.1rem 1.6rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    margin-bottom: 0.9rem;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.25);
}

.submit-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.35);
}

.secondary-actions {
    display: flex;
    gap: 0.85rem;
    margin-top: 0;
}

.secondary-btn {
    flex: 1;
    min-height: 50px;
    padding: 0.85rem 1rem;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.3s ease, filter 0.3s ease, background-color 0.3s ease;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.secondary-btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
}

.btn-call {
    background: #10b981;
}

.btn-chat {
    background: #0ea5e9;
}

.security-badges {
    display: flex;
    justify-content: center;
    gap: 0.85rem;
    margin-top: 1.25rem;
    padding-top: 1.1rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    /* Subtle separator */
    flex-wrap: wrap;
}

.security-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #475569;
    font-weight: 700;
    padding: 0.55rem 0.8rem;
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 999px;
}

.form-trust-line {
    display: flex;
    gap: 0.65rem;
    align-items: center;
    justify-content: center;
    margin-top: 0.65rem;
    flex-wrap: wrap;
}

.trust-success {
    color: #0f172a;
    /* Deep Navy for maximum legibility */
    font-size: 0.8rem;
    /* Slightly smaller to fit */
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.75rem;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-radius: 999px;
    white-space: nowrap;
}

.trust-success::before {
    content: '✓';
    color: #059669;
    /* Bold Green checkmark */
    font-weight: 950;
    -webkit-text-stroke: 1px #059669;
}

/* Stats Section */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0 4rem;
    /* Reduced top margin to minimize gap */
}

.stat-card {
    background: var(--gradient-primary);
    color: #ffffff;
    padding: 2rem;
    border-radius: var(--radius-lg);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-icon {
    margin-bottom: 1rem;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1rem;
    color: #ffffff;
}

/* Content Sections */
.content-section {
    padding: 4rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.section-header p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.feature-card {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    text-align: center;
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
}

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1.5rem;
    background: var(--gradient-accent);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-card h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
}

.feature-card ul {
    text-align: left;
    color: var(--text-secondary);
    padding-left: 1.5rem;
}

/* Testimonials */
.testimonials-section {
    background: var(--bg-secondary);
    padding: 4rem 0;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.testimonial-card {
    background: white;
    padding: 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease;
}

.testimonial-card:hover {
    transform: translateY(-5px);
}

.stars {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.star {
    color: #fbbf24;
    font-size: 1.2rem;
}

.testimonial-text {
    font-style: italic;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
}

.author-info h4 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.author-info p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* CTA Section */
.cta-section {
    background: var(--gradient-primary);
    color: #ffffff;
    padding: 4rem 0;
    text-align: center;
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    color: #ffffff;
}

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

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: transform 0.3s ease;
    display: inline-block;
}

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

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

.btn-primary:hover,
.btn-secondary:hover {
    transform: translateY(-2px);
}

.btn-secondary:hover {
    background: #059669;
    border-color: #059669;
}

/* Footer uses shared styles from main.css for consistency */

/* Floating Elements */
.floating-phone {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--gradient-primary);
    color: white;
    padding: 15px 20px;
    border-radius: 50px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.floating-phone:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    background: #059669;
    /* Slightly different green or blue depending on primary */
}

/* Exit Intent Popup Styling */
#exit-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10000;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.exit-popup-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.exit-popup-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-light);
    font-size: 1.25rem;
    z-index: 1;
    transition: background 0.2s, color 0.2s;
}

.exit-popup-close:hover {
    background: #e5e7eb;
    color: #1f2937;
}

/* Enhanced Mobile Optimization */
@media (max-width: 1024px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

/* Hide hamburger on desktop for cleaner UI */
.mobile-nav-toggle {
    display: none;
}

@media (max-width: 768px) {
    .mobile-nav-toggle {
        display: flex;
    }


    /* Enhanced Mobile Hero - Optimized for full visibility */
    .hero {
        padding: 80px 0 40px;
        min-height: auto;
        text-align: center;
    }

    .hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

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

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }

    .trust-banner {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
        margin-bottom: 0.75rem;
    }

    /* Mobile-optimized trust signals */
    .hero-trust-signals {
        justify-content: center;
        gap: 0.75rem;
        margin: 1rem 0;
    }

    .hero-trust-signals>div {
        height: 36px !important;
        width: 100px !important;
        font-size: 0.75rem !important;
        padding: 0.25rem !important;
    }

    .trust-badges {
        justify-content: center;
        gap: 0.5rem;
        margin: 1rem 0 1.5rem;
    }

    .trust-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }

    /* Enhanced Mobile Forms */
    .lead-form {
        padding: 1.4rem 1rem 1.2rem;
        margin-top: 1rem;
        border-radius: 16px;
        max-width: 100%;
        scroll-margin-top: 110px;
    }

    .form-header {
        margin-bottom: 1.25rem;
        padding-bottom: 1rem;
    }

    .form-header h2 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .form-header p {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }

    .quote-form-grid-halves {
        grid-template-columns: 1fr;
        gap: 0.9rem;
    }

    .form-group {
        margin-bottom: 0;
    }

    .form-control {
        padding: 0.875rem;
        font-size: 1rem;
        border-radius: 10px;
        border: 2px solid var(--border);
        transition: border-color 0.3s ease, box-shadow 0.3s ease;
        -webkit-appearance: none;
        appearance: none;
    }

    .form-control:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        outline: none;
    }

    .form-actions {
        margin-top: 0;
        padding-top: 0;
    }

    .secondary-actions {
        flex-direction: column;
        gap: 0.75rem;
    }

    .security-badges {
        gap: 0.65rem;
    }

    /* Enhanced Mobile Buttons */
    .btn-primary,
    .btn-secondary,
    .btn-outline,
    .submit-btn {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        border-radius: 10px;
        min-height: 48px;
        font-weight: 600;
        transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        cursor: pointer;
    }

    .btn-primary:active,
    .btn-secondary:active,
    .submit-btn:active {
        transform: translateY(1px);
    }

    /* Mobile Grid Layouts */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
        margin: 2rem 0;
    }

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

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

    /* Mobile Content Sections */
    .content-section {
        padding: 2.5rem 0;
    }

    .section-header h2 {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1rem;
    }

    .section-header p {
        font-size: 1rem;
        line-height: 1.5;
    }

    /* Mobile Cards */
    .feature-card,
    .testimonial-card {
        padding: 1.5rem 1rem;
        border-radius: 16px;
    }

    /* Mobile Footer */
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: left;
    }

    .footer h4 {
        margin-bottom: 1rem;
        font-size: 1rem;
    }

    /* Mobile Floating Elements */
    .floating-phone {
        width: 56px;
        height: 56px;
        border-radius: 50%;
        justify-content: center;
        bottom: 20px;
        right: 20px;
        box-shadow: 0 4px 16px rgba(37, 99, 235, 0.3);
    }

    .floating-phone span {
        display: none;
    }

    /* Mobile Specific Utilities */
    .cta-buttons {
        flex-direction: column;
        align-items: center;
        gap: 0.75rem;
        width: 100%;
    }

    .cta-buttons .btn-primary,
    .cta-buttons .btn-secondary {
        width: 100%;
        max-width: 280px;
    }

    /* Mobile viewport optimization */
    .container {
        padding: 0 1rem;
        max-width: 100%;
    }
}

@media (max-width: 480px) {

    /* Small Mobile Optimization */
    .container {
        padding: 0 0.875rem;
    }

    .hero {
        padding: 70px 0 30px;
    }

    .hero h1 {
        font-size: 1.75rem;
        line-height: 1.1;
        margin-bottom: 0.875rem;
    }

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

    .lead-form {
        padding: 1.25rem 0.875rem;
        margin: 1rem 0;
        scroll-margin-top: 100px;
    }

    .form-header h2 {
        font-size: 1.375rem;
    }

    .section-header h2 {
        font-size: 1.75rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .stat-card {
        padding: 1.25rem 0.875rem;
        text-align: center;
    }

    .feature-card {
        padding: 1.25rem 0.875rem;
    }

    .floating-phone {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 16px;
    }

    /* Small screen form optimization */
    .form-control {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }

    /* Small screen typography */
    .feature-card h3 {
        font-size: 1.2rem;
    }

    .testimonial-card {
        padding: 1.25rem 0.875rem;
    }

    .footer {
        padding: 1.5rem 0 1rem;
    }

    /* Trust signals optimization for small screens */
    .hero-trust-signals {
        gap: 0.5rem;
        flex-wrap: wrap;
    }

    .hero-trust-signals>div {
        height: 32px !important;
        width: 90px !important;
        font-size: 0.7rem !important;
    }

    .trust-badges {
        gap: 0.375rem;
        margin: 0.75rem 0 1.25rem;
    }

    .trust-badge {
        font-size: 0.75rem;
        padding: 0.375rem 0.625rem;
    }
}

@media (max-width: 360px) {

    /* Extra Small Mobile - iPhone SE and similar */
    .container {
        padding: 0 0.75rem;
    }

    .hero {
        padding: 60px 0 25px;
    }

    .hero h1 {
        font-size: 1.5rem;
        line-height: 1.1;
    }

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

    .btn-primary,
    .btn-secondary,
    .submit-btn {
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        min-height: 44px;
    }

    .lead-form {
        padding: 1rem 0.75rem;
        scroll-margin-top: 96px;
    }

    .form-header h2 {
        font-size: 1.25rem;
    }

    .form-control {
        padding: 0.675rem 0.75rem;
        font-size: 0.9rem;
    }

    /* Extra small screen trust elements */
    .hero-trust-signals {
        flex-direction: column;
        align-items: center;
        gap: 0.375rem;
    }

    .hero-trust-signals>div {
        height: 30px !important;
        width: 120px !important;
        font-size: 0.7rem !important;
    }

    .trust-badges {
        justify-content: center;
        gap: 0.25rem;
    }
}

/* Touch improvements for all mobile devices */
@media (hover: none) and (pointer: coarse) {

    .btn-primary,
    .btn-secondary,
    .submit-btn,
    .form-control {
        font-size: max(16px, 1rem);
    }

    .form-control {
        transform: none;
    }

    input[type="date"],
    input[type="email"],
    input[type="tel"],
    select {
        font-size: 16px;
    }
}

/* Loading animations */
.hero .loading {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.hero .loading.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Image Optimization Styles */
img {
    max-width: 100%;
    height: auto;
}

img.lazy {
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

img.lazy:not([src*="data:image/svg"]) {
    opacity: 1;
}

/* Critical images should load immediately */
img[loading="eager"],
img:not([loading]) {
    opacity: 1;
}

/* Prevent layout shift during image loading */
.carrier-logo img,
.trust-badge img {
    aspect-ratio: 3/1;
    object-fit: contain;
}

/* Font loaded via Google Fonts link in HTML - no duplicate @font-face needed */

/* === Style Block 2 === */
@keyframes popupSlideIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

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

    to {
        transform: rotate(360deg);
    }
}

#exit-popup-form.success .btn-text {
    display: none;
}

#exit-popup-form.success #exit-submit-btn::after {
    content: "✓ Guide Sent! Check Your Email";
}

#exit-popup-form.error #exit-submit-btn {
    background: #ef4444;
}

#exit-popup-form.error .btn-text {
    display: none;
}

#exit-popup-form.error #exit-submit-btn::after {
    content: "Error - Please Try Again";
}

/* === Style Block 3 === */
/* Image optimization for Core Web Vitals */
img {
    transition: opacity 0.3s ease;
}

img.loading {
    opacity: 0.7;
}

img.loaded {
    opacity: 1;
}

/* Prevent layout shift */
img[width][height] {
    height: auto;
}

/* Internal link styling for better UX */
.internal-links {
    background: var(--bg-light);
    padding: 2rem;
    border-radius: 0.75rem;
    margin: 2rem 0;
    border-left: 4px solid var(--primary);
}

.internal-links h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.internal-links ul {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.internal-links li a {
    display: block;
    padding: 0.75rem 1rem;
    background: white;
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text);
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--border);
}

.internal-links li a:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Enhanced responsive images */
.responsive-img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    box-shadow: var(--shadow);
}

/* Final Performance Optimizations */
html {
    scroll-behavior: smooth;
}

/* Critical resource loading optimization */
.critical-css {
    display: block;
}

/* === Dark mode overrides === */
@media (prefers-color-scheme: dark) {
    .feature-card,
    .testimonial-card,
    .internal-links li a {
        background: #1e293b;
        color: #e2e8f0;
        border-color: #334155;
    }

    .feature-card h3,
    .testimonial-card h4 {
        color: #f1f5f9;
    }

    .feature-card p,
    .testimonial-card p {
        color: #cbd5e1;
    }

    .feature-card li {
        color: #cbd5e1;
    }

    .internal-links li a:hover {
        background: #334155;
    }

    /* Form inputs on homepage */
    .hero-form input,
    .hero-form select,
    .hero-form textarea,
    .quote-form input,
    .quote-form select,
    .quote-form textarea {
        background: #0f172a;
        color: #e2e8f0;
        border-color: #475569;
    }

    .hero-form input::placeholder,
    .quote-form input::placeholder {
        color: #64748b;
    }

    .hero-form label,
    .quote-form label {
        color: #cbd5e1;
    }

    /* Dark mode: featured quote section */
    .featured-quote {
        background: #1e293b !important;
        color: #e2e8f0 !important;
        border-color: #334155 !important;
    }

    .featured-quote:focus {
        background: #1e293b !important;
    }

    .featured-quote h2,
    .featured-quote h3 {
        color: #f1f5f9 !important;
    }

    .featured-quote p,
    .featured-quote label {
        color: #cbd5e1 !important;
    }

    .featured-quote-input,
    .featured-quote input,
    .featured-quote select {
        background: #0f172a !important;
        color: #e2e8f0 !important;
        border-color: #475569 !important;
    }

    /* Dark mode: headline and trust sections */
    .headline-variant,
    .trust-success {
        color: #f1f5f9 !important;
    }

    .trust-signal-item {
        color: #cbd5e1 !important;
    }

    .trust-signal-item.prominent {
        color: #f1f5f9 !important;
    }

    /* Dark mode: exit popup */
    .exit-popup {
        background: #1e293b !important;
        color: #e2e8f0 !important;
    }

    .exit-popup h2, .exit-popup h3 {
        color: #f1f5f9 !important;
    }

    .exit-popup p {
        color: #cbd5e1 !important;
    }

    .exit-popup-close:hover {
        color: #e2e8f0 !important;
    }

    .exit-popup-close-btn {
        background: #334155 !important;
        color: #e2e8f0 !important;
    }

    /* Dark mode: form group on homepage */
    .form-group label,
    .form-label {
        color: #cbd5e1 !important;
    }

    .form-control {
        background: #0f172a !important;
        color: #e2e8f0 !important;
        border-color: #475569 !important;
    }

    /* Dark mode: lead form card (white card in hero) */
    .lead-form {
        background: rgba(15, 23, 42, 0.97) !important;
        border-color: #334155 !important;
        color: #e2e8f0 !important;
    }

    .form-header {
        border-bottom-color: #334155 !important;
    }

    .form-header h2 {
        color: #f1f5f9 !important;
    }

    .form-header p {
        color: #cbd5e1 !important;
    }

    /* Dark mode: trust elements inside form */
    .trust-signal-item {
        background: rgba(30, 41, 59, 0.8) !important;
        color: #e2e8f0 !important;
        border-color: #334155 !important;
    }

    .trust-signal-item.prominent {
        color: #f1f5f9 !important;
    }

    .trust-success {
        background: rgba(5, 150, 105, 0.15) !important;
        color: #6ee7b7 !important;
    }

    .trust-banner {
        background: #059669 !important;
        color: white !important;
    }

    /* Dark mode: secondary/green buttons - improve contrast */
    .secondary-btn,
    .btn-secondary {
        background: #059669 !important;
        color: white !important;
    }

    /* Dark mode: form-footer trust badges */
    .form-footer {
        color: #94a3b8 !important;
    }

    .form-footer img {
        opacity: 0.8;
    }

    /* Dark mode: form-group labels and trust line text */
    .form-group label,
    .form-group .form-label,
    .lead-form label,
    .lead-form .form-group label {
        color: #cbd5e1 !important;
    }

    .form-trust-line,
    .form-trust-line span,
    .secondary-actions,
    .secondary-actions span {
        color: #e2e8f0 !important;
    }

    .lead-form .form-group,
    .lead-form .quote-form {
        color: #e2e8f0 !important;
    }

    .form-text {
        color: #94a3b8 !important;
    }
}

/* End of homepage.css */
