/* ─── SCROLL-TRIGGERED ANIMATIONS ─── */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }
.animate-on-scroll.fade-left { transform: translateX(-40px); }
.animate-on-scroll.fade-left.visible { transform: translateX(0); }
.animate-on-scroll.fade-right { transform: translateX(40px); }
.animate-on-scroll.fade-right.visible { transform: translateX(0); }
.animate-on-scroll.scale-up { transform: scale(0.92); }
.animate-on-scroll.scale-up.visible { transform: scale(1); }

.stagger-children > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children > *:nth-child(2) { transition-delay: 80ms; }
.stagger-children > *:nth-child(3) { transition-delay: 160ms; }
.stagger-children > *:nth-child(4) { transition-delay: 240ms; }
.stagger-children > *:nth-child(5) { transition-delay: 320ms; }
.stagger-children > *:nth-child(6) { transition-delay: 400ms; }
.stagger-children > *:nth-child(7) { transition-delay: 480ms; }
.stagger-children > *:nth-child(8) { transition-delay: 560ms; }

/* ─── HERO ─── */
.hero { position: relative; overflow: hidden; }

.hero-badge { animation: badgeFloat 3s ease-in-out infinite, fadeInUp 0.8s ease-out 0.2s both; }
@keyframes badgeFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.hero-text h1 { animation: fadeInUp 0.8s ease-out 0.3s both; }
.hero-text p { animation: fadeInUp 0.8s ease-out 0.45s both; }
.hero-cta { animation: fadeInUp 0.8s ease-out 0.6s both; }
.hero-stats { animation: fadeInUp 0.8s ease-out 0.75s both; }
.hero-stats .stat strong {
    display: inline-block;
    animation: countPulse 2s ease-out 1.2s both;
}
@keyframes countPulse {
    0% { opacity: 0; transform: scale(0.5); }
    60% { transform: scale(1.1); }
    100% { opacity: 1; transform: scale(1); }
}
.hero-widget { animation: fadeInRight 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(40px); }
    to { opacity: 1; transform: translateX(0); }
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 60% 40%, var(--accent-glow) 0%, transparent 70%),
        radial-gradient(ellipse 60% 50% at 20% 70%, var(--secondary) 0%, transparent 60%);
    animation: heroBgPulse 8s ease-in-out infinite;
}
@keyframes heroBgPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    33% { opacity: 0.9; transform: scale(1.05) translate(10px, -5px); }
    66% { opacity: 0.75; transform: scale(1.02) translate(-5px, 5px); }
}

.hero-bg::before,
.hero-bg::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    animation: particleFloat 6s ease-in-out infinite;
}
.hero-bg::before {
    width: 300px; height: 300px;
    top: 10%; right: 15%;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    animation-delay: 0s;
}
.hero-bg::after {
    width: 200px; height: 200px;
    bottom: 20%; right: 30%;
    background: radial-gradient(circle, var(--secondary) 0%, transparent 70%);
    animation-delay: -2s;
}
@keyframes particleFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(20px, -30px) scale(1.05); }
    50% { transform: translate(-10px, -15px) scale(0.95); }
    75% { transform: translate(15px, 10px) scale(1.02); }
}

/* ─── FEATURE CARDS ─── */
.feature-card {
    transition:
        opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.5s cubic-bezier(0.16, 1, 0.3, 1),
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.3s ease;
}
.feature-card .feature-icon i {
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
}
.feature-card:hover .feature-icon i {
    transform: scale(1.3) rotate(5deg);
    color: var(--accent) !important;
}
.feature-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 12px 40px var(--accent-glow);
    border-color: var(--accent);
}

/* ─── STEPS ─── */
.steps { display: flex; align-items: center; gap: 0; flex-wrap: nowrap; }
.step { flex: 1; text-align: center; transition: border-color 0.3s ease, transform 0.3s ease; }
.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px; height: 64px;
    border-radius: 50%;
    font-size: 1.5rem; font-weight: 800;
    background: var(--secondary);
    border: 2px solid var(--accent);
    color: var(--accent);
    margin-bottom: 1rem;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
}
.step:hover .step-number {
    transform: scale(1.15);
    box-shadow: 0 0 30px var(--accent-glow);
}
.step-arrow {
    font-size: 1.5rem; color: var(--accent);
    opacity: 0.4; flex-shrink: 0; padding: 0 1rem;
    animation: arrowPulse 1.5s ease-in-out infinite;
}
@keyframes arrowPulse {
    0%, 100% { opacity: 0.3; transform: translateX(0); }
    50% { opacity: 0.7; transform: translateX(6px); }
}

/* ─── FACTORING PREVIEW ─── */
.factoring-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem; align-items: center;
}
.factoring-visual { transition: opacity 0.6s ease, transform 0.6s ease; }
.factoring-benefits { list-style: none; padding: 0; margin: 0 0 1.5rem; }
.factoring-benefits li {
    position: relative; padding-left: 1.5rem; margin-bottom: 0.6rem;
    color: var(--muted-foreground); line-height: 1.5;
}
.factoring-benefits li::before {
    content: '';
    position: absolute; left: 0; top: 0.45em;
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--accent);
    animation: dotPulse 2s ease-in-out infinite;
}
.factoring-benefits li:nth-child(2)::before { animation-delay: 0.3s; }
.factoring-benefits li:nth-child(3)::before { animation-delay: 0.6s; }
.factoring-benefits li:nth-child(4)::before { animation-delay: 0.9s; }
@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.6; }
}
.factoring-calc {
    background: var(--secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
}
.calc-row {
    display: flex; justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s ease;
    color: var(--card-foreground);
}
.calc-row:last-child { border-bottom: none; }
.calc-row.total { font-weight: 700; color: var(--accent); }
.calc-row:hover { background: var(--card-hover); margin: 0 -0.75rem; padding-left: 0.75rem; padding-right: 0.75rem; }

/* ─── CTA SECTION ─── */
.cta-section {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--card) 100%);
    padding: 80px 0; text-align: center;
    position: relative; overflow: hidden;
}
.cta-section::before,
.cta-section::after {
    content: ''; position: absolute; border-radius: 50%; pointer-events: none;
}
.cta-section::before {
    top: -50%; left: -20%; width: 400px; height: 400px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.5;
}
.cta-section::after {
    bottom: -30%; right: -10%; width: 300px; height: 300px;
    background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
    opacity: 0.4;
}

/* ─── BUTTONS ─── */
.btn-primary, .btn-outline, .btn-nav, .btn-nav-primary {
    position: relative; overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-primary::after, .btn-outline::after {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.08) 50%, transparent 60%);
    transform: translateX(-100%); transition: transform 0.5s ease;
}
.btn-primary:hover::after, .btn-outline:hover::after { transform: translateX(100%); }
.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px var(--accent-glow);
}
.btn-outline:hover {
    transform: translateY(-2px); border-color: var(--accent); color: var(--accent);
}

/* ─── SECTION HEADER ─── */
.section-header h2 { position: relative; display: inline-block; }
.section-header h2::after {
    content: '';
    position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
    width: 60px; height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 2px;
    animation: underlineExpand 0.6s ease-out 0.5s both;
}
@keyframes underlineExpand {
    from { width: 0; opacity: 0; }
    to { width: 60px; opacity: 1; }
}

/* ─── WIDGET CARD ─── */
.widget-card { animation: widgetSlideIn 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both; }
@keyframes widgetSlideIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── RATES TICKER (Carousel) ─── */
.rates-ticker-section {
    background: var(--card);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    display: flex;
    align-items: stretch;
    min-height: 44px;
}
.ticker-label {
    display: flex; align-items: center; gap: 8px;
    padding: 0 16px;
    background: var(--primary);
    color: var(--primary-foreground);
    font-size: 12px; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0; z-index: 2;
}
.ticker-label i { font-size: 14px; }
.ticker-more {
    color: var(--primary-foreground); text-decoration: none;
    font-size: 11px; opacity: 0.8; transition: opacity 0.2s;
    margin-left: 8px;
}
.ticker-more:hover { opacity: 1; text-decoration: none; }
.rates-ticker-section .ticker-track {
    display: flex; align-items: center;
    padding: 0 16px; overflow: hidden; flex: 1;
    will-change: transform; white-space: nowrap;
}
.ticker-item {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 0 20px 0 0; margin-right: 20px;
    border-right: 1px solid var(--border);
    font-size: 13px; color: var(--card-foreground);
    flex-shrink: 0;
}
.ticker-item .ticker-bank { font-weight: 700; color: var(--accent); }
.ticker-item .ticker-product { color: var(--muted-foreground); font-size: 12px; }
.ticker-item .ticker-rate {
    font-weight: 700; font-size: 12px;
    color: var(--primary-foreground);
    background: var(--primary);
    padding: 2px 8px; border-radius: 4px;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
    .steps { flex-direction: column; gap: 1.5rem; }
    .step-arrow { transform: rotate(90deg); padding: 0; }
    .factoring-card { grid-template-columns: 1fr; }
    .hero-stats { gap: 1.5rem; flex-wrap: wrap; }
    .cta-section { padding: 48px 0; }
    .cta-section h2 { font-size: 1.5rem !important; }
}