/**
 * FastPaw Properties — Index Animations
 * Solo se carga en index.php
 * CSS puro + clases activadas por IntersectionObserver
 */

/* ============================================================
   KEYFRAMES
   ============================================================ */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.88); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.55); }
    50%       { box-shadow: 0 0 0 12px rgba(249, 115, 22, 0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes countUp {
    from { opacity: 0; transform: translateY(20px) scale(0.8); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes borderPulse {
    0%, 100% { border-color: rgba(249, 115, 22, 0.2); }
    50%       { border-color: rgba(249, 115, 22, 0.6); }
}

@keyframes iconSpin {
    from { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.15); }
    to   { transform: rotate(360deg) scale(1); }
}

/* ============================================================
   HERO — fade-in-up escalonado al cargar
   ============================================================ */

/* .hero-title animation se maneja por .hero-word stagger — no animar el h1 completo */

.hero-subtitle {
    animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.28s both;
}

.hero-benefits {
    animation: fadeInUp 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.46s both;
}

.hero-form-wrapper {
    animation: fadeInScale 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}

/* Beneficios individuales escalonados */
.hero-benefit-pill:nth-child(1) { animation: fadeInLeft 0.5s ease 0.65s both; }
.hero-benefit-pill:nth-child(2) { animation: fadeInLeft 0.5s ease 0.78s both; }
.hero-benefit-pill:nth-child(3) { animation: fadeInLeft 0.5s ease 0.91s both; }

/* ============================================================
   BOTÓN CTA — pulse + scale hover
   ============================================================ */

.hero-submit-btn {
    animation: pulse-glow 2.2s ease-in-out infinite;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease,
                background 0.2s ease !important;
}

.hero-submit-btn:hover:not(:disabled) {
    animation: none;
    transform: scale(1.05) translateY(-2px) !important;
    box-shadow: 0 0 32px rgba(249, 115, 22, 0.65) !important;
}

/* CTA section button */
.cta-button {
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.25s ease !important;
}

.cta-button:hover {
    transform: translateY(-3px) scale(1.03) !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25) !important;
}

.cta-button:hover .cta-button-icon {
    transform: translateX(6px) !important;
}

/* ============================================================
   SCROLL REVEAL — clase base (invisible) + .visible (animado)
   ============================================================ */

.reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.reveal.from-left {
    transform: translateX(-40px);
}

.reveal.from-right {
    transform: translateX(40px);
}

.reveal.from-scale {
    transform: scale(0.9);
    opacity: 0;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

/* Delays escalonados para grids */
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.40s; }
.reveal-delay-6 { transition-delay: 0.48s; }

/* ============================================================
   FEATURES CARDS — elevación + drop shadow
   ============================================================ */

.features__card {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease,
                filter 0.35s ease !important;
}

.features__card:hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 16px 32px rgba(249, 115, 22, 0.22) !important;
    filter: drop-shadow(0 8px 16px rgba(249, 115, 22, 0.18)) !important;
    border-color: #f97316 !important;
}

/* Icono gira al hover de la card */
.features__card:hover .features__icon svg {
    animation: iconSpin 0.6s ease forwards;
}

/* ============================================================
   HOW IT WORKS CARDS
   ============================================================ */

.how-card {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease,
                border-color 0.35s ease !important;
}

.how-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 28px rgba(249, 115, 22, 0.2) !important;
    border-color: #f97316 !important;
}

/* Número flota al hover */
.how-card:hover .how-number {
    color: rgba(249, 115, 22, 0.25);
    transition: color 0.3s ease;
}

/* ============================================================
   WHO WE HELP CARDS
   ============================================================ */

.who-card {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                background-image 200ms ease,
                box-shadow 0.35s ease,
                border-color 0.35s ease !important;
}

.who-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 28px rgba(249, 115, 22, 0.18) !important;
}

/* Items de lista con hover */
.who-list li {
    transition: color 0.2s ease, padding-left 0.2s ease;
    cursor: default;
}

.who-list li:hover {
    color: #f97316;
    padding-left: 6px;
}

/* ============================================================
   WHY WORK CARDS
   ============================================================ */

.why-work-card {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease,
                background-image 200ms ease,
                box-shadow 0.3s ease !important;
}

.why-work-card:hover {
    transform: translateY(-4px) scale(1.02) !important;
    box-shadow: 0 8px 20px rgba(249, 115, 22, 0.15) !important;
}

/* ============================================================
   TRUST SECTION — float animation
   ============================================================ */

.trust-icon-svg {
    animation: float 3.5s ease-in-out infinite;
}

/* ============================================================
   TESTIMONIALS CARDS
   ============================================================ */

.testimonials-card {
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 0.35s ease !important;
}

.testimonials-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.3) !important;
}

/* ============================================================
   NAVBAR LINKS — underline slide
   ============================================================ */

.navbar-link {
    position: relative;
    overflow: hidden;
}

.navbar-link::before {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    width: 0;
    height: 2px;
    background: #f97316;
    border-radius: 2px;
    transform: translateX(-50%);
    transition: width 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.navbar-link:hover::before {
    width: 60%;
}

/* ============================================================
   FOOTER LINKS
   ============================================================ */

.footer-link {
    position: relative;
    transition: color 0.2s ease, padding-left 0.2s ease !important;
}

.footer-link:hover {
    padding-left: 4px;
}

/* ============================================================
   FLOATING CONTACT BUTTON
   ============================================================ */

.floating-contact {
    animation: float 3s ease-in-out infinite;
}

/* ============================================================
   SECTION TITLES — shimmer accent
   ============================================================ */

.features__title-highlight,
.how-title em,
.who-title em,
.why-work-title em {
    background: linear-gradient(
        90deg,
        #f97316 0%,
        #fbbf24 40%,
        #f97316 60%,
        #ea580c 100%
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}

/* ============================================================
   REDUCED MOTION — respeta preferencias del usuario
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* ============================================================
   WORD STAGGER — hero title words (blur + fade + slide)
   ============================================================ */

@keyframes word-reveal {
    from {
        opacity: 0;
        filter: blur(6px);
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        filter: blur(0px);
        transform: translateY(0);
    }
}

.hero-word {
    display: inline-block;
    opacity: 0; /* estado inicial antes de que la animación arranque */
    will-change: opacity, filter, transform;
}

.hero-word.visible {
    animation: word-reveal 700ms cubic-bezier(0.215, 0.61, 0.355, 1) both;
    /* animation-delay se inyecta inline por JS: i * 80ms */
}

/* ============================================================
   PILLS SLIDE-IN — estado inicial
   ============================================================ */

.hero-benefit-pill {
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 500ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
    will-change: opacity, transform;
}

.hero-benefit-pill.pill-visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================================
   FORM — input focus underline
   ============================================================ */

.hero-input-wrapper {
    position: relative;
    display: block;
}

.hero-input-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #f97316;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 250ms cubic-bezier(0.22, 1, 0.36, 1);
    border-radius: 0 0 6px 6px;
    pointer-events: none;
}

.hero-input-wrapper:focus-within::after {
    transform: scaleX(1);
}

/* ============================================================
   SUBMIT BUTTON — idle / loading / success states
   ============================================================ */

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes checkDraw {
    from { stroke-dashoffset: 40; }
    to   { stroke-dashoffset: 0; }
}

.hero-submit-btn {
    position: relative;
    overflow: hidden;
    transition: transform 200ms cubic-bezier(0.34, 1.56, 0.64, 1),
                box-shadow 200ms ease,
                background 300ms ease !important;
}

.hero-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px) scale(1.03) !important;
    box-shadow: 0 8px 24px rgba(249, 115, 22, 0.55) !important;
    animation: none !important;
}

/* Loading state */
.hero-submit-btn.btn-loading .hero-btn-text { display: none !important; }
.hero-submit-btn.btn-loading .hero-btn-loading { display: flex !important; align-items: center; gap: 8px; }

.btn-spinner {
    width: 20px;
    height: 20px;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

/* Success state */
.hero-submit-btn.btn-success {
    background: #10b981 !important;
    animation: none !important;
}

.hero-submit-btn.btn-success .hero-btn-text { display: none !important; }
.hero-submit-btn.btn-success .hero-btn-loading { display: none !important; }
.hero-submit-btn.btn-success .hero-btn-success { display: flex !important; align-items: center; gap: 8px; }

.btn-check {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.btn-check-path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: checkDraw 400ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

/* ============================================================
   HOW IT WORKS — número counter + connector line
   ============================================================ */

@keyframes numberPop {
    0%   { opacity: 0; transform: scale(0) rotate(-15deg); }
    70%  { transform: scale(1.2) rotate(5deg); }
    100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes lineGrow {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
}

@keyframes iconBounce {
    0%   { transform: scale(0) rotate(-20deg); opacity: 0; }
    60%  { transform: scale(1.15) rotate(5deg); opacity: 1; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

.how-number {
    transition: color 0.3s ease;
    display: block;
}

.how-card.step-visible .how-number {
    animation: numberPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.how-card.step-visible .how-icon-circle {
    animation: iconBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.2s both;
}

.how-card.step-visible .how-card-title {
    animation: fadeInUp 0.5s ease 0.3s both;
}

.how-card.step-visible .how-card-text {
    animation: fadeInUp 0.5s ease 0.4s both;
}

/* Connector line between steps */
.how-grid {
    position: relative;
}

.how-grid::before {
    content: '';
    position: absolute;
    top: 44px;
    left: calc(16.66% + 28px);
    width: calc(66.66% - 56px);
    height: 2px;
    background: linear-gradient(90deg, #f97316, rgba(249, 115, 22, 0.3));
    transform-origin: left center;
    transform: scaleX(0);
    transition: transform 800ms cubic-bezier(0.22, 1, 0.36, 1) 0.4s;
    border-radius: 2px;
}

.how-grid.line-visible::before {
    transform: scaleX(1);
}

@media (max-width: 968px) {
    .how-grid::before { display: none; }
}

/* ============================================================
   SECTION TITLES — split reveal
   ============================================================ */

.section-title-reveal {
    overflow: hidden;
}

.section-title-reveal .title-line {
    display: block;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1),
                transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

.section-title-reveal.visible .title-line:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0ms; }
.section-title-reveal.visible .title-line:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 80ms; }
.section-title-reveal.visible .title-line:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 160ms; }
