/* ================================================================
   SAN JUAN EMPRENDE — Component System
   ================================================================ */

/* --- Smooth Scroll --- */
html {
    scroll-behavior: smooth;
}

/* ================================================================
   MOTION SYSTEM
   All animations gated behind prefers-reduced-motion
   Only animating transform & opacity (never layout properties)
   ================================================================ */

/* --- Scroll Reveal Base --- */
.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-expo),
        transform 0.7s var(--ease-expo);
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delays for choreographed reveals (desktop) */
.reveal-delay-1 {
    transition-delay: 80ms;
}

.reveal-delay-2 {
    transition-delay: 160ms;
}

.reveal-delay-3 {
    transition-delay: 240ms;
}

@keyframes cta-shimmer {
    0%, 94%, 100% {
        transform: translateX(0);
    }
    96% {
        transform: translateX(4px);
    }
    98% {
        transform: translateX(0);
    }
}

.cta-shimmer .material-symbols-outlined {
    display: inline-block;
    animation: cta-shimmer 10s ease-in-out infinite;
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .cta-shimmer .material-symbols-outlined {
        animation: none;
    }

    .btn-primary,
    .nav-link,
    .faq-item,
    .faq-button .material-symbols-outlined,
    .form-input {
        transition: none !important;
    }
}


/* ================================================================
   BUTTONS
   ================================================================ */

.btn-primary {
    background-color: var(--color-naranja-cta);
    color: white;
    font-weight: 600;
    border-radius: var(--squircle-pill);
    transition: background-color 0.25s var(--ease-expo),
        transform 0.25s var(--ease-expo),
        box-shadow 0.25s var(--ease-expo);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@keyframes hero-pulse-glow {
    0%, 20%, 100% {
        box-shadow: 0 0 0 0 rgb(var(--color-naranja-rgb) / 0);
    }
    10% {
        box-shadow: 0 0 25px 8px rgb(var(--color-naranja-rgb) / 0.5);
    }
}

/* Base class with higher specificity than standard buttons */
a.btn-hero-bolder,
button.btn-hero-bolder {
    animation: hero-pulse-glow 8s cubic-bezier(0.4, 0, 0.6, 1) infinite !important;
    position: relative;
    z-index: 10;
}

/* Desktop hover — only on devices that support hover */
@media (hover: hover) {
    .btn-primary:hover {
        background-color: var(--color-naranja-hover);
        transform: translateY(-2px);
        box-shadow: 0 8px 24px -4px rgb(var(--color-naranja-rgb) / 0.35);
    }

    /* Higher specificity to override the above */
    a.btn-hero-bolder:hover,
    button.btn-hero-bolder:hover {
        animation: none !important;
        box-shadow: 0 16px 40px -4px rgb(var(--color-naranja-rgb) / 0.5) !important;
        transform: translateY(-4px) !important;
    }
}

/* ================================================================
   HERO ANIMATIONS (Die-Cut Layout)
   ================================================================ */

/* Hero Image Diagonal Slide (from bottom-left) */
@keyframes fi-slide-tr {
    0% {
        transform: translateY(40%) translateX(-35%);
        opacity: 0;
    }

    100% {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
}

.animate-fi-slide-tr {
    animation: fi-slide-tr 0.6s var(--ease-out-quart) both;
}

/* Hero Elements Slide Up */
@keyframes fi-slide-t {
    0% {
        transform: translateY(30px) translateX(0);
        opacity: 0;
    }

    100% {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }
}

.animate-fi-slide-t {
    animation: fi-slide-t 0.7s var(--ease-out-quart) both;
}

/* Hero Elements Fade In */
@keyframes fi-fade-in {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 1;
    }
}

.animate-fi-fade-in {
    animation: fi-fade-in 0.01s linear both;
}

/* Floating Elements (Continuous) */
@keyframes float-slow {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.animate-float-slow {
    animation: float-slow 4s ease-in-out infinite;
}

.animate-float-delayed {
    animation: float-slow 4.5s ease-in-out infinite;
    animation-delay: 1.5s;
}

/* Touch feedback for mobile */
.btn-primary:active {
    transform: scale(0.97);
    transition-duration: 0.1s;
}

.btn-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgb(var(--color-naranja-rgb) / 0.3);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ================================================================
   UTILITY CLASSES
   ================================================================ */

.bg-sj-institucional {
    background-color: var(--color-sj-institucional);
}

/* ================================================================
   NAVIGATION
   ================================================================ */

.nav-link {
    padding: 0.25rem 0.5rem;
    position: relative;
    transition: color 0.25s var(--ease-expo);
}

/* Animated underline on hover */
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0.5rem;
    right: 0.5rem;
    height: 2px;
    background: var(--color-naranja-cta);
    border-radius: 1px;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s var(--ease-expo);
}

.nav-link:hover {
    color: var(--color-naranja-cta);
}

.nav-link:hover::after,
.nav-link.active::after {
    transform: scaleX(1);
}

.nav-link:focus-visible {
    outline: none;
    border-radius: var(--squircle-sm);
    box-shadow: 0 0 0 2px var(--color-naranja-cta);
}


/* ================================================================
   FORM SYSTEM
   ================================================================ */

.form-input {
    width: 100%;
    border: 1.5px solid var(--color-gris-claro);
    border-radius: var(--squircle-md) !important;
    padding: 0.875rem 1.25rem;
    font-size: 1rem;
    background-color: white;
    transition: border-color 0.25s var(--ease-expo),
        box-shadow 0.25s var(--ease-expo);
    outline: none;
    color: var(--color-sj-oscuro);
}

.form-input:focus,
.form-input:focus-visible {
    border-color: var(--color-naranja-cta) !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgb(var(--color-naranja-rgb) / 0.12),
        inset 0 1px 3px rgb(var(--color-naranja-rgb) / 0.06) !important;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-gris-labels);
    margin-bottom: 0.5rem;
    margin-left: 0.5rem;
    transition: color 0.2s;
}

/* Label turns orange when its sibling input is focused */
.form-group:focus-within .form-label {
    color: var(--color-naranja-cta);
}

/* Step crossfade transition */
.step-fade {
    transition: opacity 0.35s var(--ease-expo);
}

.step-fade.fading {
    opacity: 0;
}


/* ================================================================
   FAQ ACCORDION — Grid-Row Animation
   ================================================================ */

.squircle-card {
    border-radius: var(--squircle-lg);
}

.squircle-icon {
    border-radius: var(--squircle-sm);
}

.faq-item {
    background: white;
    border-radius: var(--squircle-lg);
    box-shadow: 0 1px 3px rgb(var(--color-shadow-base) / 0.04);
    overflow: hidden;
    transition: box-shadow 0.3s var(--ease-expo);
}

@media (hover: hover) {
    .faq-item:hover {
        box-shadow: 0 4px 12px rgb(var(--color-shadow-base) / 0.06);
    }
}

.faq-button {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1.125rem;
    text-align: left;
    color: var(--color-sj-oscuro);
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 1rem;
    outline: none;
}

.faq-button:focus-visible {
    box-shadow: 0 0 0 3px rgb(var(--color-naranja-rgb) / 0.15);
}

/* Chevron rotation with exponential easing */
.faq-button .material-symbols-outlined {
    transition: transform 0.4s var(--ease-expo),
        color 0.3s;
}

/* Grid-row animation for smooth height transitions */
.faq-content-wrapper {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.4s var(--ease-expo);
}

.faq-item.active .faq-content-wrapper {
    grid-template-rows: 1fr;
}

.faq-content {
    overflow: hidden;
    font-size: 1.0625rem;
    color: var(--color-gris-body);
    line-height: 1.7;
}

.faq-content-inner {
    padding: 0 1.5rem 1.5rem 1.5rem;
    opacity: 0;
    transition: opacity 0.3s 0.1s;
}

.faq-item.active .faq-content-inner {
    opacity: 1;
}

.faq-item.active .faq-button .material-symbols-outlined {
    transform: rotate(180deg);
    color: var(--color-naranja-cta);
}


/* ================================================================
   BENEFIT CARDS — Desktop Hover
   ================================================================ */

@media (hover: hover) {
    .benefit-card {
        transition: transform 0.35s var(--ease-expo),
            box-shadow 0.35s var(--ease-expo);
    }

    .benefit-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 32px -8px rgb(var(--color-shadow-base) / 0.1);
    }

    .benefit-card .benefit-icon {
        transition: background-color 0.3s, transform 0.3s var(--ease-expo);
    }

    .benefit-card:hover .benefit-icon {
        background-color: #FFE8D6;
        transform: scale(1.08);
    }
}


/* ================================================================
   TESTIMONIAL CARDS — Desktop Hover
   ================================================================ */

@media (hover: hover) {
    .testimonial-card {
        transition: transform 0.35s var(--ease-expo),
            box-shadow 0.35s var(--ease-expo);
    }

    .testimonial-card:hover {
        transform: translateY(-3px) scale(1.005);
        box-shadow: 0 16px 40px -12px rgb(var(--color-shadow-base) / 0.1);
    }
}


/* ================================================================
   MOBILE OVERRIDES
   ================================================================ */

@media (max-width: 767px) {

    /* Remove stagger on mobile — single fade per element */
    .reveal-delay-1,
    .reveal-delay-2,
    .reveal-delay-3 {
        transition-delay: 0ms;
    }

    /* Tighter section padding on mobile */
    .section-spacing {
        padding-top: 4rem;
        padding-bottom: 4rem;
    }
}


/* ================================================================
   BENTO GRID LAYOUT (Apple-style Interlocking Cards)
   ================================================================ */

.bento-grid {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Desktop Interlocking Grid */
@media (min-width: 768px) {
    .bento-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, minmax(0, auto));
        gap: 1.5rem;
    }

    .bento-tall-left {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
    }

    .bento-short-left {
        grid-column: 1 / 2;
        grid-row: 3 / 4;
    }

    .bento-short-right {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
    }

    .bento-tall-right {
        grid-column: 2 / 3;
        grid-row: 2 / 4;
    }
}

/* ================================================================
   FORM ANIMATIONS (Spatial & Height Tween)
   ================================================================ */

.ease-out-expo {
    transition-timing-function: var(--ease-expo);
}

#form-animator {
    position: relative;
    overflow: hidden;
}

/* All form steps share the same transition */
.form-step {
    transition: opacity 0.4s var(--ease-expo),
        transform 0.4s var(--ease-expo),
        visibility 0.4s;
}

/* Hidden steps go absolute so they don't affect container height */
.step-hidden-left {
    opacity: 0;
    transform: translateX(-40px);
    pointer-events: none;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.step-hidden-right {
    opacity: 0;
    transform: translateX(40px);
    pointer-events: none;
    visibility: hidden;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

/* Active step is in flow — container naturally sizes to it */
.step-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    visibility: visible;
    position: relative;
}


/* ================================================================
   TRUST BADGE
   ================================================================ */

.trust-badge-container {
    padding: 0;
}


/* ================================================================
   ACTIVE NAV INDICATOR
   ================================================================ */

.nav-link.active {
    color: var(--color-naranja-cta);
}

/* ================================================================
   CAROUSEL NAVIGATION (Premium Aesthetics)
   High-fidelity state management for entrepreneur stories.
   ================================================================ */

.nav-name-item {
    cursor: pointer;
    position: relative;
    padding: 0.25rem 0;
    transition: color 0.4s var(--ease-expo), transform 0.4s var(--ease-expo), opacity 0.4s var(--ease-expo);
    opacity: 0.6;
}

.nav-name-item::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--color-naranja-cta);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.6s var(--ease-expo);
}

.nav-name-item:hover {
    opacity: 1;
    color: var(--color-sj-oscuro);
}

/* Active State: Desktop Names */
.nav-name-item.active-nav {
    color: var(--color-naranja-cta) !important;
    opacity: 1;
    transform: translateY(-1px);
}

.nav-name-item.active-nav::after {
    transform: scaleX(1);
}

/* Navigation Dots (Mobile Context) */
.nav-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-gris-claro);
    border-radius: 50%;
    transition: all 0.4s var(--ease-expo);
}

/* Active State: Mobile Dots (Expands into pill) */
.nav-dot.active-dot {
    background-color: var(--color-naranja-cta);
    width: 24px;
    border-radius: 4px;
}