:root {
    --motion-blue: #002a5c;
    --motion-blue-deep: #001f4c;
    --motion-yellow: #ffc107;
    --motion-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

.motion-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.skip-link {
    position: fixed;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 10001;
    padding: 0.75rem 1rem;
    border: 2px solid #fff;
    border-radius: 0.5rem;
    background: var(--motion-yellow);
    color: var(--motion-blue-deep);
    font-weight: 800;
    text-decoration: none;
    transform: translateY(calc(-100% - 1rem));
    transition: transform 180ms ease;
}

.skip-link:focus-visible {
    outline: 3px solid var(--motion-blue-deep);
    outline-offset: 2px;
    transform: translateY(0);
}

main#main-content {
    padding-top: 0;
    overflow: clip;
}

main#main-content:focus {
    outline: 3px solid var(--motion-yellow);
    outline-offset: -3px;
}

.hero {
    isolation: isolate;
    overflow: hidden;
    min-height: 650px;
}

.hero::before {
    position: absolute;
    inset: 0;
    z-index: -2;
    background: linear-gradient(to bottom right, var(--primary-blue), var(--secondary-blue));
    content: "";
    transform-origin: center;
    animation: hero-background-scale 18s ease-out both;
}

.hero::after {
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 18% 25%, rgba(255, 193, 7, 0.12), transparent 28%),
        radial-gradient(circle at 82% 72%, rgba(255, 255, 255, 0.08), transparent 32%);
    content: "";
    pointer-events: none;
}

@keyframes hero-background-scale {
    from {
        transform: scale(1);
    }

    to {
        transform: scale(1.03);
    }
}

.hero-content {
    position: relative;
    z-index: 2;
    width: min(100% - 1.5rem, 1040px);
    max-width: 1040px;
}

.hero-eyebrow,
.hero h1,
.hero-lead,
.hero-buttons,
.hero-trust-badges {
    opacity: 0;
    animation: hero-enter 700ms var(--motion-ease) both;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-bottom: 1rem;
    padding: 0.45rem 0.8rem;
    border: 1px solid rgba(255, 193, 7, 0.58);
    border-radius: 999px;
    background: rgba(0, 31, 76, 0.54);
    color: #fff4bf;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    animation-delay: 80ms;
}

.hero-eyebrow::before {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--motion-yellow);
    content: "";
}

.hero h1 {
    max-width: 980px;
    margin-right: auto;
    margin-left: auto;
    font-size: clamp(2.35rem, 6vw, 4.6rem);
    line-height: 1.08;
    text-wrap: balance;
    animation-delay: 170ms;
}

.hero .hero-lead {
    max-width: 790px;
    margin: 0 auto 1.5rem;
    color: #edf4f8;
    font-size: clamp(1rem, 2vw, 1.25rem);
    line-height: 1.65;
    text-wrap: balance;
    animation-delay: 260ms;
}

.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.7rem;
    animation-delay: 350ms;
}

.hero-buttons .btn {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.hero-buttons .hero-btn-whatsapp {
    border-color: rgba(255, 255, 255, 0.72);
    background: #137a3f;
    color: #fff;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.2);
}

.hero-buttons .hero-btn-whatsapp:hover,
.hero-buttons .hero-btn-whatsapp:focus-visible {
    border-color: #fff;
    background: #0e6333;
    color: #fff;
}

.hero-buttons .btn:focus-visible,
.service-strip-item:focus-visible,
.service-card .btn-service:focus-visible,
.mobile-action-bar a:focus-visible,
.homepage-faq button:focus-visible,
.back-to-top:focus-visible {
    outline: 3px solid var(--motion-yellow);
    outline-offset: 3px;
}

.hero-trust-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.55rem;
    max-width: 940px;
    margin: 1.6rem auto 0;
    padding: 0;
    list-style: none;
    animation-delay: 440ms;
}

.hero-trust-badges li {
    padding: 0.45rem 0.72rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 999px;
    background: rgba(0, 31, 76, 0.48);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 700;
    opacity: 0;
    transform: translateY(10px);
    animation: badge-enter 480ms var(--motion-ease) forwards;
}

.hero-trust-badges li:nth-child(1) {
    animation-delay: 500ms;
}

.hero-trust-badges li:nth-child(2) {
    animation-delay: 570ms;
}

.hero-trust-badges li:nth-child(3) {
    animation-delay: 640ms;
}

.hero-trust-badges li:nth-child(4) {
    animation-delay: 710ms;
}

.hero-trust-badges li:nth-child(5) {
    animation-delay: 780ms;
}

@keyframes hero-enter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes badge-enter {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-circuit {
    position: absolute;
    inset: 0;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.circuit-line {
    position: absolute;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 193, 7, 0.72), transparent);
    opacity: 0.5;
}

.circuit-line-one {
    top: 26%;
    left: -5%;
    width: 38%;
    transform: rotate(-8deg);
}

.circuit-line-two {
    right: -6%;
    bottom: 24%;
    width: 42%;
    transform: rotate(8deg);
}

.circuit-node {
    position: absolute;
    width: 8px;
    height: 8px;
    border: 2px solid var(--motion-yellow);
    border-radius: 50%;
    opacity: 0.55;
    animation: circuit-pulse 3.8s ease-in-out infinite;
}

.circuit-node-one {
    top: 23%;
    left: 20%;
}

.circuit-node-two {
    right: 21%;
    bottom: 21%;
    animation-delay: 1.5s;
}

@keyframes circuit-pulse {
    0%,
    100% {
        opacity: 0.38;
        transform: scale(0.85);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.2);
    }
}

.trust-counters {
    position: relative;
    z-index: 3;
    margin-top: -2.4rem;
}

.trust-counter-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid rgba(0, 42, 92, 0.12);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 16px 34px rgba(0, 31, 76, 0.15);
}

.trust-counter {
    display: grid;
    gap: 0.2rem;
    min-width: 0;
    padding: 1.25rem 0.8rem;
    text-align: center;
}

.trust-counter + .trust-counter {
    border-left: 1px solid rgba(0, 42, 92, 0.12);
}

.trust-counter strong {
    color: var(--motion-blue);
    font-size: clamp(1.4rem, 3vw, 2.15rem);
    line-height: 1.1;
}

.trust-counter span {
    color: #435468;
    font-size: 0.82rem;
    font-weight: 700;
}

.electrical-service-strip {
    padding: 2.35rem 0 0.4rem;
}

.service-strip-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0.7rem;
}

.service-strip-item {
    position: relative;
    display: grid;
    gap: 0.5rem;
    min-width: 0;
    min-height: 92px;
    align-content: center;
    justify-items: center;
    overflow: hidden;
    padding: 0.8rem 0.45rem;
    border: 1px solid rgba(0, 42, 92, 0.15);
    border-radius: 0.8rem;
    background: #fff;
    color: var(--motion-blue);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    transition: transform 220ms var(--motion-ease), border-color 220ms ease, background-color 220ms ease;
}

.service-strip-item::after {
    position: absolute;
    right: 15%;
    bottom: 0.55rem;
    left: 15%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--motion-yellow), transparent);
    content: "";
    opacity: 0.6;
    transform: scaleX(0.45);
    transition: transform 220ms var(--motion-ease), opacity 220ms ease;
}

.service-strip-item svg {
    width: 26px;
    height: 26px;
    fill: var(--motion-yellow);
    stroke: var(--motion-blue);
    stroke-linejoin: round;
    stroke-width: 0.5;
}

.service-strip-item:hover,
.service-strip-item:focus-visible {
    border-color: var(--motion-yellow);
    background: #f8fbff;
    transform: translateY(-4px);
}

.service-strip-item:hover::after,
.service-strip-item:focus-visible::after {
    opacity: 1;
    transform: scaleX(1);
}

/* Fail-safe reveal motion:
   Important content stays visible even if IntersectionObserver
   does not fire during Googlebot or full-page rendering. */

.motion-enabled .motion-reveal,
.motion-enabled .motion-reveal-left,
.motion-enabled .motion-reveal-right,
.motion-enabled .motion-stagger > * {
    opacity: 1;
    transition: transform 520ms var(--motion-ease);
    will-change: transform;
}

.motion-enabled .motion-reveal,
.motion-enabled .motion-stagger > * {
    transform: translateY(12px);
}

.motion-enabled .motion-reveal-left {
    transform: translateX(-12px);
}

.motion-enabled .motion-reveal-right {
    transform: translateX(12px);
}

.motion-enabled .motion-reveal.is-visible,
.motion-enabled .motion-reveal-left.is-visible,
.motion-enabled .motion-reveal-right.is-visible,
.motion-enabled .motion-stagger.is-visible > * {
    opacity: 1;
    transform: translate(0, 0);
    will-change: auto;
}

.motion-enabled .motion-stagger.is-visible > :nth-child(2) {
    transition-delay: 70ms;
}

.motion-enabled .motion-stagger.is-visible > :nth-child(3) {
    transition-delay: 140ms;
}

.motion-enabled .motion-stagger.is-visible > :nth-child(4) {
    transition-delay: 210ms;
}

.motion-enabled .motion-stagger.is-visible > :nth-child(5) {
    transition-delay: 280ms;
}

.motion-enabled .motion-stagger.is-visible > :nth-child(6) {
    transition-delay: 350ms;
}

.service-card:hover,
.service-card:focus-within {
    transform: translateY(-6px);
}

.service-card:focus-within {
    border-color: var(--motion-yellow);
    box-shadow: 0 18px 35px rgba(0, 0, 0, 0.2);
}

.service-card:hover .service-img img,
.service-card:focus-within .service-img img {
    transform: scale(1.06);
}

.service-card .btn-service i {
    display: inline-block;
    margin-left: 0.3rem;
    transition: transform 200ms var(--motion-ease);
}

.service-card:hover .btn-service i,
.service-card:focus-within .btn-service i {
    transform: translateX(5px);
}

.how-it-works {
    background: #fff;
}

.process-steps {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.process-steps::before {
    position: absolute;
    top: 1.45rem;
    right: 12%;
    left: 12%;
    height: 2px;
    background: linear-gradient(90deg, var(--motion-yellow), rgba(0, 42, 92, 0.3), var(--motion-yellow));
    content: "";
}

.process-steps li {
    position: relative;
    z-index: 1;
    min-width: 0;
    padding: 0 0.5rem;
    text-align: center;
}

.process-number {
    display: inline-grid;
    width: 3rem;
    height: 3rem;
    margin-bottom: 0.8rem;
    place-items: center;
    border: 3px solid var(--motion-yellow);
    border-radius: 50%;
    background: var(--motion-blue);
    color: #fff;
    font-weight: 800;
}

.process-steps h3 {
    color: var(--motion-blue);
    font-size: 1rem;
    line-height: 1.4;
}

.homepage-faq {
    background: #fff;
}

.homepage-faq-list {
    max-width: 900px;
    margin: 0 auto;
    border: 1px solid rgba(0, 42, 92, 0.14);
    border-radius: 1rem;
    background: #fff;
    box-shadow: 0 12px 28px rgba(0, 31, 76, 0.1);
}

.homepage-faq-item + .homepage-faq-item {
    border-top: 1px solid rgba(0, 42, 92, 0.12);
}

.homepage-faq-item h3 {
    margin: 0;
}

.homepage-faq button {
    position: relative;
    width: 100%;
    padding: 1.15rem 3.25rem 1.15rem 1.2rem;
    border: 0;
    background: transparent;
    color: var(--motion-blue);
    font: inherit;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
}

.homepage-faq button::after {
    position: absolute;
    top: 50%;
    right: 1.2rem;
    color: var(--motion-blue);
    content: "+";
    font-size: 1.4rem;
    transform: translateY(-50%);
}

.homepage-faq button[aria-expanded="true"]::after {
    content: "−";
}

.homepage-faq-panel {
    padding: 0 1.2rem 1.2rem;
    color: #34465a;
}

.homepage-faq-panel[hidden] {
    display: none;
}

.homepage-faq-more {
    margin-top: 1.5rem;
    text-align: center;
}

.mobile-action-bar {
    display: none;
}

.back-to-top {
    position: fixed;
    right: 1.1rem;
    bottom: 6rem;
    z-index: 9997;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    border: 2px solid var(--motion-yellow);
    border-radius: 50%;
    background: var(--motion-blue);
    color: #fff;
    font-size: 1.25rem;
    font-weight: 800;
    cursor: pointer;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 180ms ease, transform 180ms ease;
}

.back-to-top[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .hero {
        min-height: 680px;
    }

    .trust-counter-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .trust-counter:nth-child(3) {
        border-top: 1px solid rgba(0, 42, 92, 0.12);
        border-left: 0;
    }

    .trust-counter:nth-child(4) {
        border-top: 1px solid rgba(0, 42, 92, 0.12);
    }

    .service-strip-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .hero {
        min-height: 700px;
        margin-top: 55px;
        padding: 80px 10px 95px;
    }

    .hero-trust-badges {
        gap: 0.4rem;
    }

    .trust-counters {
        margin-top: -1.8rem;
    }

    .process-steps {
        grid-template-columns: 1fr;
        gap: 0;
        max-width: 520px;
        margin: 0 auto;
    }

    .process-steps::before {
        top: 1.5rem;
        bottom: 1.5rem;
        left: 1.5rem;
        width: 2px;
        height: auto;
        background: linear-gradient(180deg, var(--motion-yellow), rgba(0, 42, 92, 0.3), var(--motion-yellow));
    }

    .process-steps li {
        display: grid;
        grid-template-columns: 3rem minmax(0, 1fr);
        gap: 1rem;
        align-items: center;
        padding: 0 0 1.4rem;
        text-align: left;
    }

    .process-number {
        margin: 0;
    }

    .mobile-action-bar {
        position: fixed;
        right: max(0.55rem, env(safe-area-inset-right));
        bottom: max(0.55rem, env(safe-area-inset-bottom));
        left: max(0.55rem, env(safe-area-inset-left));
        z-index: 9998;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        overflow: hidden;
        border: 1px solid rgba(255, 255, 255, 0.25);
        border-radius: 0.9rem;
        background: rgba(0, 31, 76, 0.97);
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24);
        opacity: 1;
        transform: translateY(0);
        transition: opacity 180ms ease, transform 180ms var(--motion-ease), visibility 0s linear 0s;
    }

    .mobile-action-bar.is-suppressed {
        visibility: hidden;
        opacity: 0;
        transform: translateY(calc(100% + 1rem));
        transition: opacity 180ms ease, transform 180ms var(--motion-ease), visibility 0s linear 180ms;
        pointer-events: none;
    }

    .mobile-action-bar a {
        display: grid;
        gap: 0.12rem;
        min-width: 0;
        min-height: 58px;
        place-content: center;
        color: #fff;
        font-size: 0.75rem;
        font-weight: 800;
        text-align: center;
        text-decoration: none;
    }

    .mobile-action-bar a + a {
        border-left: 1px solid rgba(255, 255, 255, 0.2);
    }

    .mobile-action-bar a:nth-child(2) {
        color: #d8ffe5;
    }

    .mobile-action-bar a:nth-child(3) {
        color: #ffe584;
    }

    .mobile-action-bar a span[aria-hidden="true"] {
        font-size: 1rem;
        line-height: 1;
    }

    .back-to-top {
        right: 0.85rem;
        bottom: calc(8.2rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 480px) {
    .hero {
        min-height: 740px;
        padding-right: 6px;
        padding-left: 6px;
    }

    .hero h1 {
        font-size: clamp(2rem, 10vw, 2.7rem);
    }

    .hero-buttons {
        display: grid;
        grid-template-columns: 1fr;
        width: min(100%, 310px);
        margin: 0 auto;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    .hero-trust-badges li {
        font-size: 0.7rem;
    }

    .service-strip-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .services-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .about-img,
    .about-text,
    .contact-info,
    .contact-form {
        min-width: 0;
    }

    .contact-info,
    .contact-form {
        padding: 1.2rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
