#home-main-hero {
    position: relative;
    min-height: 600px;
    overflow: hidden;
}

/* Background layer - house image */
#home-main-hero .home-hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

#home-main-hero .home-hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Gradient overlay on top of house image - strong blue at top, minimal white at bottom */
#home-main-hero .home-hero-gradient-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    background: linear-gradient(
        180deg,
        rgba(30, 64, 175, 0.85) 0%,
        rgba(37, 99, 235, 0.75) 15%,
        rgba(59, 130, 246, 0.55) 30%,
        rgba(96, 165, 250, 0.35) 45%,
        rgba(147, 197, 253, 0.2) 60%,
        rgba(191, 219, 254, 0.15) 75%,
        rgba(219, 234, 254, 0.1) 85%,
        rgba(240, 249, 255, 0.1) 93%,
        rgba(255, 255, 255, 0.15) 100%
    );
}

/* Content layer - on top of everything */
#home-main-hero .home-hero-content-layer {
    position: relative;
    z-index: 10;
}

#home-main-hero .home-hero-cta {
    max-width: 580px;
}

@media (max-width: 768px) {
    #home-main-hero .home-hero-cta {
        max-width: 100%;
    }
}


/* CTA Button States - Tech-forward styling */
.cta-btn {
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    cursor: pointer;
    position: relative;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-weight: 600;
    letter-spacing: -0.01em;
    z-index: 2;
    text-align: center;
    justify-content: center;
}

/* Non-active buttons: glassmorphism style */
.cta-btn:not(.cta-btn-active) {
    background: rgba(255, 255, 255, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    min-width: 120px;
}

.cta-btn:not(.cta-btn-active):hover {
    background: rgba(255, 255, 255, 0.95) !important;
    transform: translateY(-3px);
    box-shadow: 0 12px 24px -4px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.5) !important;
}

/* Active button: orange with glow */
.cta-btn-active {
    background: linear-gradient(135deg, #f16700 0%, #ea580c 100%) !important;
    color: white !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    box-shadow:
        0 8px 20px -4px rgba(241, 103, 0, 0.5),
        0 0 0 1px rgba(241, 103, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.cta-btn-active:hover {
    background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%) !important;
    transform: translateY(-3px);
    box-shadow:
        0 16px 32px -4px rgba(241, 103, 0, 0.45),
        0 0 24px rgba(241, 103, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
}

/* Fixed height header container to prevent layout shift on text change */
#home-main-hero .home-hero-cta > .text-left {
    min-height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

/* Clean, readable headline with subtle warm glow */
#home-main-hero h1 {
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    line-height: 1.05;
    letter-spacing: -0.03em;
    font-weight: 800;
    color: #ffffff;
    text-shadow:
        0 0 40px rgba(251, 191, 36, 0.3),
        0 0 80px rgba(241, 103, 0, 0.15),
        0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

#home-main-hero p {
    letter-spacing: -0.01em;
    font-weight: 400;
    opacity: 0.9;
    position: relative;
    z-index: 2;
    min-height: 24px;
}

/* Tech-forward search input */
#home-main-hero input[type="text"] {
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

#home-main-hero input[type="text"]:focus {
    background: rgba(255, 255, 255, 1) !important;
    box-shadow:
        0 12px 40px rgba(37, 99, 235, 0.15),
        0 0 0 2px rgba(37, 99, 235, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

/* Search submit button */
#home-main-hero form button[type="submit"] {
    background: linear-gradient(135deg, #f16700 0%, #ea580c 100%) !important;
    box-shadow:
        0 4px 12px rgba(241, 103, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transition: all 0.25s cubic-bezier(0.23, 1, 0.32, 1);
    font-weight: 700;
    letter-spacing: 0.01em;
}

/* Disabled state - keep it looking active, just prevent clicks */
#home-main-hero form button[type="submit"]:disabled {
    opacity: 1;
    cursor: default;
}

/* Fix suggestions dropdown positioning - reset transform context */
#home-main-hero .suggestions-container {
    transform: none !important;
    position: absolute;
    left: 0;
    right: 0;
    width: 100%;
}

/* Ensure form container has proper stacking context */
#home-main-hero form {
    position: relative;
}

#home-main-hero [data-cta-toggle-target="formContainer"] {
    transform: none !important;
    position: relative;
}

/* Parallax scroll optimization */
[data-controller*="parallax-scroll"] {
    will-change: transform;
    transform: translateZ(0);
}

[data-parallax-scroll-target="layer"] {
    will-change: transform;
    transform: translateZ(0);
}

/* Disable parallax on mobile for performance */
@media (max-width: 768px) {
    [data-controller*="parallax-scroll"],
    [data-parallax-scroll-target="layer"] {
        transform: none !important;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    [data-controller*="parallax-scroll"],
    [data-parallax-scroll-target="layer"] {
        transform: none !important;
    }
}

@media (max-width: 768px) {
    #home-main-hero .home-hero-cta > .text-left {
        min-height: 100px; /* Smaller container for mobile */
    }

    #home-main-hero h1 {
        min-height: 60px; /* Reduced from 120px for mobile */
        font-size: 2rem !important; /* Smaller font for mobile */
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    #home-main-hero .home-hero-cta > .text-left {
        min-height: 120px; /* Medium container for tablet */
    }

    #home-main-hero h1 {
        min-height: 70px; /* Reduced from 140px for tablet */
        font-size: 3rem !important; /* Medium font for tablet */
    }
}

/* Service Cards - Scattered Layout */
.service-cards {
    position: relative;
    height: 600px;
    margin-top: 2rem;
    padding: 0;
}

.service-card:nth-child(1) {
    position: absolute;
    top: 0;
    right: -20px;
    transform: rotate(-8deg);
    z-index: 6;
}

.service-card:nth-child(2) {
    position: absolute;
    top: 90px;
    right: 280px;
    transform: rotate(12deg);
    z-index: 5;
}

.service-card:nth-child(3) {
    position: absolute;
    top: 180px;
    right: 100px;
    transform: rotate(-5deg);
    z-index: 4;
}

.service-card:nth-child(4) {
    position: absolute;
    top: 270px;
    right: 250px;
    transform: rotate(9deg);
    z-index: 3;
}

.service-card:nth-child(5) {
    position: absolute;
    top: 360px;
    right: 20px;
    transform: rotate(-10deg);
    z-index: 2;
}

.service-card:nth-child(6) {
    position: absolute;
    top: 450px;
    right: 180px;
    transform: rotate(6deg);
    z-index: 1;
}

@media (max-width: 1024px) {
    .service-cards {
        height: 700px;
    }
    
    .service-card:nth-child(1) {
        right: 10px;
        top: 0;
    }
    
    .service-card:nth-child(2) {
        right: -20px;
        top: 100px;
    }
    
    .service-card:nth-child(3) {
        right: 15px;
        top: 200px;
    }
    
    .service-card:nth-child(4) {
        right: -10px;
        top: 300px;
    }
    
    .service-card:nth-child(5) {
        right: 20px;
        top: 400px;
    }
    
    .service-card:nth-child(6) {
        right: -15px;
        top: 500px;
    }
}

.service-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
    border: 1px solid rgba(229, 231, 235, 0.5);
    overflow: hidden;
    cursor: pointer;
    height: 180px;
    width: 280px;
}

.service-card:hover {
    transform: translateY(-8px) rotate(0deg) !important;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 20 !important;
}

.service-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s ease;
    transform-style: preserve-3d;
}

.service-card:hover .service-card-inner {
    transform: rotateY(180deg) !important;
}

.service-card-front,
.service-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.service-card-back {
    transform: rotateY(180deg);
    background: linear-gradient(135deg, #3b82f6 0%, #1e40af 100%);
    color: white;
    border-radius: 8px;
    padding: 1.5rem;
}

.service-icon {
    font-size: 3rem;
    color: #3b82f6;
    margin-bottom: 1rem;
}

.service-card h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.5rem;
}

.service-card p {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.5;
}

.service-card-back h3 {
    color: white;
    margin-bottom: 1rem;
}

.service-card-back p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    line-height: 1.6;
}

.service-card-back .cta-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 1rem;
    transition: all 0.2s;
}

.service-card-back .cta-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

/* Orange background when CTA button triggers the card */
.service-card-back.cta-activated {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%) !important;
}

.service-card-back.cta-activated h3,
.service-card-back.cta-activated p {
    color: white !important;
}

.service-card-back.cta-activated .cta-button {
    background: rgba(255, 255, 255, 0.9) !important;
    color: #f97316 !important;
    border-color: white !important;
}

.service-card-back.cta-activated .cta-button:hover {
    background: white !important;
    transform: translateY(-1px);
}

/* Savings Section Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.animate-fade-in {
    animation: fadeIn 0.8s ease-out forwards;
}

.animate-slide-in-left {
    animation: slideInLeft 0.8s ease-out 0.2s forwards;
}

.animate-slide-in-right {
    animation: slideInRight 0.8s ease-out 0.4s forwards;
}

/* ===== SUGGESTIONS DROPDOWN FOR CTA FORMS ===== */
#home-main-hero [data-cta-toggle-target="formContainer"],
#home-main-hero [data-controller="address-autocomplete"] {
    overflow: visible !important;
}

#home-main-hero [data-address-autocomplete-target="suggestions"] {
    position: absolute !important;
    top: 100% !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    margin-top: 8px !important;
    pointer-events: auto !important;
    z-index: 9999 !important;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
}

/* Ensure parent containers allow dropdown overflow */
#home-main-hero .home-hero-left,
#home-main-hero form,
#home-main-hero form > div,
#home-main-hero form .space-y-4,
#home-main-hero form .relative {
    overflow: visible !important;
}