/* =====================================================================
   EAA Auditores – Animations CSS
   Keyframes, reveal animations, micro-interactions
   ===================================================================== */

/* -----------------------------------------------------------------------
   1. KEYFRAMES
----------------------------------------------------------------------- */
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%       { opacity: 0.5; transform: scale(1.3); }
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%       { transform: translateX(-50%) translateY(-8px); }
}

@keyframes ticker {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

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

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

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

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

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.92); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes shimmer {
    0%   { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

@keyframes whatsappPulse {
    0%, 100% { box-shadow: 0 6px 30px rgba(37,211,102,0.50); }
    50%       { box-shadow: 0 6px 50px rgba(37,211,102,0.75), 0 0 0 15px rgba(37,211,102,0.08); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-12px); }
}

@keyframes rotateSlow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

@keyframes particleFade {
    0%   { opacity: 0; transform: translateY(0) scale(1); }
    50%  { opacity: 0.6; }
    100% { opacity: 0; transform: translateY(-80px) scale(0.5); }
}

/* -----------------------------------------------------------------------
   2. SCROLL REVEAL (via Intersection Observer en JS)
----------------------------------------------------------------------- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.65s var(--ease-out), transform 0.65s var(--ease-out);
}

.reveal.reveal--left {
    transform: translateX(-30px);
}

.reveal.reveal--right {
    transform: translateX(30px);
}

.reveal.reveal--scale {
    transform: scale(0.94);
}

.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* Staggered children */
.reveal-group > * {
    opacity: 0;
    transform: translateY(25px);
    transition: opacity 0.55s var(--ease-out), transform 0.55s var(--ease-out);
}

.reveal-group.is-visible > *:nth-child(1)  { transition-delay: 0.05s; opacity: 1; transform: none; }
.reveal-group.is-visible > *:nth-child(2)  { transition-delay: 0.12s; opacity: 1; transform: none; }
.reveal-group.is-visible > *:nth-child(3)  { transition-delay: 0.20s; opacity: 1; transform: none; }
.reveal-group.is-visible > *:nth-child(4)  { transition-delay: 0.28s; opacity: 1; transform: none; }
.reveal-group.is-visible > *:nth-child(5)  { transition-delay: 0.36s; opacity: 1; transform: none; }
.reveal-group.is-visible > *:nth-child(6)  { transition-delay: 0.44s; opacity: 1; transform: none; }
.reveal-group.is-visible > *:nth-child(7)  { transition-delay: 0.52s; opacity: 1; transform: none; }
.reveal-group.is-visible > *:nth-child(8)  { transition-delay: 0.60s; opacity: 1; transform: none; }

/* -----------------------------------------------------------------------
   3. HERO ENTRANCE
----------------------------------------------------------------------- */
.hero__eyebrow  { animation: fadeInDown 0.8s var(--ease-out) 0.2s both; }
.hero__title    { animation: fadeInUp   0.9s var(--ease-out) 0.4s both; }
.hero__subtitle { animation: fadeInUp   0.9s var(--ease-out) 0.55s both; }
.hero__actions  { animation: fadeInUp   0.9s var(--ease-out) 0.70s both; }
.hero__stats    { animation: fadeInUp   0.9s var(--ease-out) 0.85s both; }
.hero__scroll   { animation: bounce 2.5s infinite 1.2s, fadeInUp 0.9s var(--ease-out) 1.0s both; }

/* -----------------------------------------------------------------------
   4. PAGE HERO ENTRANCE
----------------------------------------------------------------------- */
.page-hero__inner .breadcrumb  { animation: fadeInDown 0.6s var(--ease-out) 0.1s both; }
.page-hero__inner .page-hero__title    { animation: fadeInUp 0.7s var(--ease-out) 0.2s both; }
.page-hero__inner .page-hero__subtitle { animation: fadeInUp 0.7s var(--ease-out) 0.35s both; }

/* -----------------------------------------------------------------------
   5. TOPBAR HIDE on SCROLL
----------------------------------------------------------------------- */
.topbar.is-hidden {
    transform: translateY(-100%);
}

/* -----------------------------------------------------------------------
   6. COUNTER ANIMATION
----------------------------------------------------------------------- */
.counter-number {
    will-change: contents;
}

/* -----------------------------------------------------------------------
   7. PARTICLES CANVAS
----------------------------------------------------------------------- */
#heroParticles {
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
}

/* -----------------------------------------------------------------------
   8. PROGRESS STEPS (Certificación)
----------------------------------------------------------------------- */
.steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-6);
    position: relative;
}

.steps-grid::before {
    content: '';
    position: absolute;
    top: 36px;
    left: 12%;
    right: 12%;
    height: 2px;
    background: linear-gradient(to right, var(--color-accent), var(--color-gold));
}

.step-card {
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-card__num {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: 3px solid var(--color-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-5);
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    color: white;
    transition: all var(--tr-base);
    box-shadow: var(--shadow-accent);
}

.step-card:hover .step-card__num {
    background: var(--gradient-accent);
    transform: scale(1.10);
}

.step-card__title {
    font-size: var(--fs-md);
    font-weight: 700;
    margin-bottom: var(--space-3);
}

.step-card__desc {
    font-size: var(--fs-sm);
    color: var(--color-muted);
    line-height: 1.65;
}

@media (max-width: 768px) {
    .steps-grid { grid-template-columns: repeat(2, 1fr); }
    .steps-grid::before { display: none; }
}

@media (max-width: 480px) {
    .steps-grid { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------------------
   9. LOADING SKELETON
----------------------------------------------------------------------- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
    background-size: 1000px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* -----------------------------------------------------------------------
   10. SMOOTH PAGE TRANSITIONS
----------------------------------------------------------------------- */
body {
    animation: fadeInUp 0.4s var(--ease-out);
}

/* -----------------------------------------------------------------------
   11. FLOATING DECORATION ELEMENTS
----------------------------------------------------------------------- */
.float-element {
    animation: float 6s ease-in-out infinite;
}

.float-element--slow {
    animation-duration: 8s;
    animation-delay: 1s;
}

/* -----------------------------------------------------------------------
   12. ACCENT LINE DECORATION
----------------------------------------------------------------------- */
.accent-bar {
    display: inline-block;
    width: 50px;
    height: 4px;
    background: var(--gradient-accent);
    border-radius: var(--radius-full);
    vertical-align: middle;
    margin-right: var(--space-3);
}

/* -----------------------------------------------------------------------
   13. GOLD BADGE
----------------------------------------------------------------------- */
.gold-badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-4);
    background: var(--gradient-gold);
    border-radius: var(--radius-full);
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* -----------------------------------------------------------------------
   14. MAP CONTAINER
----------------------------------------------------------------------- */
.map-container {
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    height: 380px;
}

.map-container iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* -----------------------------------------------------------------------
   15. REDUCED MOTION
----------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    .reveal, .reveal-group > * {
        opacity: 1 !important;
        transform: none !important;
    }
}
