@media (max-width: 64rem) {
    body {
        --site-header-height: calc(2.5rem + 4rem + 1px);
        padding-top: var(--site-header-height);
    }

    .utility-bar__inner {
        grid-template-columns: 1fr;
        min-height: 2.5rem;
    }

    .utility-contact,
    .utility-social {
        display: none;
    }

    .announcement-marquee__track {
        gap: var(--space-xl);
    }

    .site-header__inner {
        position: relative;
        min-height: 4rem;
        flex-wrap: wrap;
        gap: var(--space-sm);
    }

    .site-header .site-logo img {
        width: auto;
        height: 2.75rem;
    }

    .menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: var(--space-sm);
        min-height: 2.75rem;
        padding: .5rem .75rem;
        border: 1px solid var(--color-blue);
        border-radius: var(--radius-md);
        color: var(--color-blue);
        background: var(--color-white);
        font-size: var(--text-sm);
        font-weight: 600;
        cursor: pointer;
    }

    .site-navigation {
        position: absolute;
        top: 100%;
        right: calc(-1 * var(--container-gutter));
        left: calc(-1 * var(--container-gutter));
        display: none;
        max-height: calc(100vh - var(--site-header-height, 6.5rem) - env(safe-area-inset-bottom, 0px));
        max-height: calc(100dvh - var(--site-header-height, 6.5rem) - env(safe-area-inset-bottom, 0px));
        overflow-y: auto;
        overscroll-behavior: contain;
        margin: 0;
        padding: var(--space-md) var(--container-gutter) var(--space-xl);
        border-top: 1px solid var(--color-border);
        background: var(--color-white);
        box-shadow: var(--shadow-subtle);
    }

    .site-navigation.is-open {
        display: block;
    }

    .primary-menu {
        display: grid;
        align-items: stretch;
        gap: 0;
    }

    .primary-menu>li {
        border-bottom: 1px solid var(--color-border);
    }

    .primary-menu>li>a,
    .nav-trigger {
        display: flex;
        width: 100%;
        min-height: 2.875rem;
        justify-content: space-between;
        padding: .625rem .75rem;
        border-radius: var(--radius-md);
        font-size: var(--text-md);
        text-align: left;
    }

    /* Mobile: the amber accent becomes a left bar inside the row (same box whether active or not). */
    .primary-menu>li>a::after,
    .nav-trigger::after {
        top: .5rem;
        right: auto;
        bottom: .5rem;
        left: .25rem;
        width: 4px;
        height: auto;
        transform: scaleY(0);
    }

    .primary-menu>li>a:hover::after,
    .nav-trigger:hover::after,
    .nav-trigger[aria-expanded="true"]::after {
        transform: scaleY(.5);
    }

    .primary-menu>li>a.is-active::after,
    .nav-trigger.is-active::after,
    .nav-trigger.is-active:hover::after,
    .nav-trigger.is-active[aria-expanded="true"]::after {
        transform: scaleY(1);
    }

    .primary-menu>li {
        padding-block: .125rem;
    }

    .header-actions {
        display: none;
    }

    .mobile-nav-actions {
        position: sticky;
        bottom: 0;
        display: grid;
        gap: var(--space-sm);
        margin-top: var(--space-md);
        padding: var(--space-md) 0 var(--space-xs);
        background: var(--color-white);
    }

    .mobile-nav-actions .btn {
        width: 100%;
        min-height: 3rem;
        font-size: var(--text-md);
    }

    .mega-menu,
    .dropdown-menu {
        position: static;
        min-width: 0;
        margin: 0 0 var(--space-md);
        padding: var(--space-md);
        border: 1px solid var(--color-border);
        border-top: 2px solid var(--color-blue);
        border-radius: var(--radius-sm);
        box-shadow: none;
        animation: none;
    }

    .mega-menu {
        width: auto;
        max-width: none;
        grid-template-columns: 1fr;
        gap: var(--space-lg);
        transform: none;
    }

    .mega-menu__course-columns {
        grid-template-columns: 1fr;
        gap: var(--space-sm);
    }

    .mega-menu__right {
        padding: var(--space-lg) 0 0;
        border-top: 1px solid var(--color-border);
        border-left: 0;
    }

    .dropdown-menu {
        width: 100%;
    }

    .mobile-cta {
        position: fixed;
        inset: auto 0 0;
        z-index: 40;
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, .78fr) minmax(0, 1.55fr);
        width: 100%;
        min-height: calc(4.5rem + env(safe-area-inset-bottom, 0px));
        align-items: center;
        gap: 6px;
        padding: 9px 8px calc(9px + env(safe-area-inset-bottom, 0px));
        border-top: 1px solid rgb(7 54 106 / 10%);
        background: var(--color-white);
        box-shadow: 0 -5px 20px rgb(7 54 106 / 12%);
    }

    .mobile-cta a {
        display: inline-flex;
        width: 100%;
        min-width: 0;
        min-height: 48px;
        align-items: center;
        justify-content: center;
        padding: 0 4px;
        border-radius: 9px;
        color: var(--color-primary);
        font-size: .8125rem;
        font-weight: 800;
        line-height: 1;
        text-align: center;
        text-decoration: none;
        white-space: nowrap;
        transition: background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
    }

    .mobile-cta__whatsapp,
    .mobile-cta__call {
        position: relative;
        gap: 4px;
        margin: 0;
    }

    .mobile-cta__whatsapp:active,
    .mobile-cta__call:active {
        background: rgb(7 54 106 / 7%);
        transform: scale(.97);
    }

    .mobile-cta__icon {
        width: 1.375rem;
        height: 1.375rem;
        flex: 0 0 1.375rem;
        transform-origin: center;
        will-change: transform;
    }

    .mobile-cta__icon--whatsapp {
        color: #25D366;
    }

    .mobile-cta__icon--call {
        color: #07366A;
    }

    .mobile-cta .btn {
        position: relative;
        overflow: hidden;
        isolation: isolate;
        min-height: 48px;
        padding: 0 6px;
        border: 0;
        border-radius: 9px;
        background: #07569B;
        box-shadow: 0 5px 12px rgb(7 86 155 / 25%);
        color: #fff;
        font-size: .8125rem;
        font-weight: 800;
        letter-spacing: .01em;
        text-transform: uppercase;
        transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
        animation: mobile-cta-demo-glow 3.6s ease-in-out infinite;
    }

    .mobile-cta .btn::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        left: -42%;
        width: 34%;
        pointer-events: none;
        background: linear-gradient(90deg, transparent, rgb(255 255 255 / 32%), transparent);
        transform: skewX(-18deg);
        animation: mobile-cta-demo-shine 5.2s ease-in-out infinite;
    }

    .mobile-cta .btn:hover,
    .mobile-cta .btn:active {
        background: #064b86;
        color: #fff;
        box-shadow: 0 3px 8px rgb(7 86 155 / 25%);
    }

    .mobile-cta .btn:active {
        transform: scale(.97);
    }

    @media (max-width: 22.5rem) {
        .mobile-cta {
            gap: 4px;
            padding-inline: 6px;
        }

        .mobile-cta a {
            min-height: 46px;
            padding-inline: 3px;
            font-size: .75rem;
        }

        .mobile-cta__whatsapp,
        .mobile-cta__call {
            gap: 3px;
        }

        .mobile-cta__whatsapp .mobile-cta__label,
        .mobile-cta__call .mobile-cta__label {
            font-size: .75rem;
        }

        .mobile-cta__icon {
            width: 1.25rem;
            height: 1.25rem;
            flex-basis: 1.25rem;
        }

        .mobile-cta .btn {
            min-height: 46px;
            padding-inline: 4px;
            font-size: .75rem;
        }
    }
}

@media (min-width: 64.001rem) and (max-width: 80rem) {
    .utility-bar__inner {
        grid-template-columns: max-content minmax(0, 35%) max-content;
    }
}

@media (max-width: 64rem) {
    .section-hero {
        min-height: auto;
        padding: 40px 0 45px;
    }

    .hero-copy h1 {
        max-width: 16ch;
        font-size: clamp(2.25rem, 8vw, 3.25rem);
    }

    .hero-description {
        font-size: var(--text-md);
    }

    .hero-actions {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
    }

    .hero-actions .btn {
        width: 100%;
    }

    .section-hero::before {
        background: linear-gradient(90deg,
            rgb(7 54 106 / 74%) 0%,
            rgb(7 54 106 / 64%) 55%,
            rgb(7 54 106 / 50%) 100%);
    }
}

@media (max-width: 40rem) {
    .trust-strip__sequence {
        --trust-strip-gap: clamp(1.25rem, 5vw, 2rem);
    }

    .trust-strip__item {
        font-size: var(--text-md);
    }
}

@media (prefers-reduced-motion: reduce) {
    .announcement-marquee__track,
    .mobile-cta__whatsapp,
    .mobile-cta__whatsapp .mobile-cta__icon,
    .mobile-cta__call .mobile-cta__icon,
    .mobile-cta .btn,
    .mobile-cta .btn::after {
        animation: none;
    }

    .mobile-cta .btn::after {
        display: none;
    }

    .section-hero {
        background-image: url('../images/hero/fintax-hero-person.webp');
        background-position: center;
        background-size: cover;
    }

    .hero-background-video {
        display: none;
    }
}

@keyframes mobile-cta-whatsapp-glow {
    0%, 68%, 100% {
        box-shadow: none;
    }
    78% {
        box-shadow: 0 0 0 3px rgb(37 211 102 / 8%), 0 4px 14px rgb(37 211 102 / 14%);
    }
    86% {
        box-shadow: 0 0 0 5px rgb(37 211 102 / 0%), 0 2px 8px rgb(37 211 102 / 7%);
    }
}

@keyframes mobile-cta-whatsapp-bounce {
    0%, 68%, 82%, 100% {
        transform: translateY(0) scale(1);
    }
    72% {
        transform: translateY(-2px) scale(1.04);
    }
    76% {
        transform: translateY(0) scale(.98);
    }
}

@keyframes mobile-cta-call-ring {
    0%, 66%, 82%, 100% {
        transform: rotate(0deg);
    }
    69% {
        transform: rotate(-9deg);
    }
    72% {
        transform: rotate(8deg);
    }
    75% {
        transform: rotate(-6deg);
    }
    78% {
        transform: rotate(4deg);
    }
}

@keyframes mobile-cta-demo-glow {
    0%, 100% {
        box-shadow: 0 5px 12px rgb(7 86 155 / 25%);
    }
    50% {
        box-shadow: 0 5px 17px rgb(7 120 215 / 42%);
    }
}

@keyframes mobile-cta-demo-shine {
    0%, 72%, 100% {
        left: -42%;
    }
    88% {
        left: 118%;
    }
}

@keyframes mobile-cta-enter {
    0% {
        opacity: 0;
        transform: translateY(28px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes mobile-cta-float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-1px);
    }
}

.mobile-cta {
    -webkit-tap-highlight-color: transparent;
    opacity: 0;
    will-change: transform, opacity;
    animation:
        mobile-cta-enter 620ms cubic-bezier(.22, .78, .22, 1) both,
        mobile-cta-float 5.8s ease-in-out 620ms infinite;
}

.mobile-cta__whatsapp {
    transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.mobile-cta__call {
    transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.mobile-cta__whatsapp:active,
.mobile-cta__call:active {
    background: rgb(7 54 106 / 7%);
    transform: scale(.97);
}

.mobile-cta__whatsapp:focus-visible,
.mobile-cta__call:focus-visible,
.mobile-cta .btn:focus-visible {
    outline: 3px solid rgb(37 99 235 / 72%);
    outline-offset: 2px;
}

.mobile-cta__whatsapp:hover .mobile-cta__icon,
.mobile-cta__call:hover .mobile-cta__icon {
    animation-play-state: paused;
}

.mobile-cta__whatsapp:hover .mobile-cta__icon {
    transform: scale(1.06) translateY(-1px);
}

.mobile-cta__call:hover .mobile-cta__icon {
    transform: scale(1.04) rotate(-3deg);
}

.mobile-cta .btn {
    transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

@media (hover: hover) {
    .mobile-cta__whatsapp:hover,
    .mobile-cta__call:hover {
        transform: translateY(-1px) scale(1.015);
    }

    .mobile-cta .btn:hover {
        transform: translateY(-1px) scale(1.015);
    }
}

@media (prefers-reduced-motion: reduce) {
    .mobile-cta {
        opacity: 1;
        will-change: auto;
        animation: none;
    }

    .mobile-cta__whatsapp,
    .mobile-cta__whatsapp .mobile-cta__icon,
    .mobile-cta__call,
    .mobile-cta__call .mobile-cta__icon,
    .mobile-cta .btn,
    .mobile-cta .btn::after {
        animation: none;
    }

    .mobile-cta__whatsapp,
    .mobile-cta__call,
    .mobile-cta .btn,
    .mobile-cta__whatsapp .mobile-cta__icon,
    .mobile-cta__call .mobile-cta__icon {
        transition: none;
    }

    .mobile-cta__whatsapp:hover,
    .mobile-cta__call:hover,
    .mobile-cta .btn:hover,
    .mobile-cta__whatsapp:active,
    .mobile-cta__call:active,
    .mobile-cta .btn:active,
    .mobile-cta__whatsapp:hover .mobile-cta__icon,
    .mobile-cta__call:hover .mobile-cta__icon {
        transform: none;
    }

    .mobile-cta .btn::after {
        display: none;
    }
}


/* Home page hero: compact typography on mobile only */
@media (max-width: 40rem) {
    .section-hero {
        min-height: auto;
        padding: 24px 0 30px;
    }

    .hero-eyebrow {
        margin-bottom: 10px;
        font-size: .7rem;
        line-height: 1.4;
        letter-spacing: .1em;
    }

    .hero-copy h1 {
        max-width: 100%;
        margin-bottom: 14px;
        font-size: clamp(1.8rem, 7vw, 2.15rem);
        line-height: 1.15;
    }

    .hero-description {
        margin-bottom: 18px;
        font-size: .94rem;
        line-height: 1.48;
    }

    .hero-actions {
        gap: 10px;
    }

    .hero-actions .btn {
        min-height: 44px;
        padding: .6rem 1rem;
        font-size: .875rem;
    }
}


/* Mobile form typography and spacing: applies to forms site-wide only */
@media screen and (max-width: 640px) {
    form {
        row-gap: .65rem;
    }

    form label,
    form .contact-consent,
    form .form-check-label {
        font-size: 13px !important;
        line-height: 1.4 !important;
    }

    form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="submit"]),
    form select,
    form textarea {
        font-size: 14px !important;
        line-height: 1.35 !important;
        padding: 9px 10px !important;
        min-height: 42px !important;
    }

    form textarea {
        min-height: 88px !important;
    }

    form button,
    form input[type="submit"],
    form .btn,
    form .button {
        font-size: 14px !important;
        line-height: 1.3 !important;
        min-height: 42px !important;
        padding: 9px 14px !important;
    }

    form small,
    form .form-text,
    form .dm-form__note {
        font-size: 11.5px !important;
        line-height: 1.4 !important;
    }

    form input[type="checkbox"],
    form input[type="radio"] {
        width: 16px;
        height: 16px;
    }

    .lead-form { gap: .65rem !important; }
    .dm-form, .cn-form, .ct-form { gap: .7rem !important; }
}


/* Mobile footer visibility: reserve space above the fixed bottom CTA */
@media screen and (max-width: 640px) {
    .site-footer {
        padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)) !important;
    }

    .fintax-social-links--footer {
        display: flex !important;
        flex-wrap: wrap !important;
        align-items: center;
        justify-content: flex-start;
        gap: .65rem !important;
        margin-top: 1.25rem !important;
        margin-bottom: .75rem !important;
    }

    .fintax-social-links--footer .fintax-social-links__item {
        flex: 0 0 2.75rem;
    }
}
