/* ========================================
   ADVANCED ANIMATIONS & EFFECTS
   Premium micro-interactions library
   ======================================== */

/* ===== Scroll Reveal Animations ===== */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.reveal-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-left.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-right {
    opacity: 0;
    transform: translateX(60px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-right.revealed {
    opacity: 1;
    transform: translateX(0);
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
        transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: scale(1);
}

/* Stagger delay classes */
.delay-1 {
    transition-delay: 0.1s;
}

.delay-2 {
    transition-delay: 0.2s;
}

.delay-3 {
    transition-delay: 0.3s;
}

.delay-4 {
    transition-delay: 0.4s;
}

.delay-5 {
    transition-delay: 0.5s;
}

.delay-6 {
    transition-delay: 0.6s;
}

/* ===== Typewriter Effect ===== */
.typewriter {
    overflow: hidden;
    border-right: 3px solid var(--primary-400);
    white-space: nowrap;
    animation: typewriter-cursor 0.8s step-end infinite;
    display: inline-block;
}

@keyframes typewriter-cursor {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--primary-400);
    }
}

/* ===== Shimmer Button Effect ===== */
.btn-shimmer {
    position: relative;
    overflow: hidden;
}

.btn-shimmer::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(to right,
            transparent 0%,
            rgba(255, 255, 255, 0.15) 50%,
            transparent 100%);
    transform: rotate(30deg);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%) rotate(30deg);
    }

    100% {
        transform: translateX(100%) rotate(30deg);
    }
}

/* ===== Gradient Border Glow ===== */
.glow-card {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.glow-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--primary-400), var(--accent-400), var(--purple-400, #a855f7), var(--primary-400));
    background-size: 300% 300%;
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.5s ease;
    animation: gradient-rotate 4s ease infinite;
}

.glow-card:hover::before {
    opacity: 1;
}

@keyframes gradient-rotate {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ===== Floating Animation Variants ===== */
@keyframes float-slow {

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

    25% {
        transform: translateY(-15px) rotate(1deg);
    }

    75% {
        transform: translateY(10px) rotate(-1deg);
    }
}

@keyframes float-medium {

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

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

@keyframes float-fast {

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

    50% {
        transform: translateY(-10px) scale(1.05);
    }
}

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

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

.float-fast {
    animation: float-fast 2.5s ease-in-out infinite;
}

/* ===== Particle Dots (CSS-only) ===== */
.particles-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--primary-400);
    border-radius: 50%;
    opacity: 0.3;
    animation: particle-drift linear infinite;
}

.particle:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-duration: 15s;
    animation-delay: 0s;
    width: 3px;
    height: 3px;
}

.particle:nth-child(2) {
    left: 25%;
    top: 60%;
    animation-duration: 20s;
    animation-delay: -3s;
    width: 5px;
    height: 5px;
    opacity: 0.2;
}

.particle:nth-child(3) {
    left: 45%;
    top: 35%;
    animation-duration: 18s;
    animation-delay: -6s;
    background: var(--accent-400);
}

.particle:nth-child(4) {
    left: 65%;
    top: 75%;
    animation-duration: 22s;
    animation-delay: -9s;
    width: 6px;
    height: 6px;
    opacity: 0.15;
}

.particle:nth-child(5) {
    left: 80%;
    top: 15%;
    animation-duration: 16s;
    animation-delay: -12s;
    background: var(--accent-400);
}

.particle:nth-child(6) {
    left: 15%;
    top: 80%;
    animation-duration: 25s;
    animation-delay: -2s;
    width: 3px;
    height: 3px;
    opacity: 0.25;
}

.particle:nth-child(7) {
    left: 55%;
    top: 50%;
    animation-duration: 19s;
    animation-delay: -5s;
    width: 4px;
    height: 4px;
}

.particle:nth-child(8) {
    left: 90%;
    top: 40%;
    animation-duration: 21s;
    animation-delay: -8s;
    background: #a855f7;
    opacity: 0.2;
}

.particle:nth-child(9) {
    left: 35%;
    top: 10%;
    animation-duration: 17s;
    animation-delay: -11s;
    width: 5px;
    height: 5px;
}

.particle:nth-child(10) {
    left: 70%;
    top: 90%;
    animation-duration: 23s;
    animation-delay: -4s;
    background: var(--accent-400);
    opacity: 0.15;
}

.particle:nth-child(11) {
    left: 5%;
    top: 45%;
    animation-duration: 20s;
    animation-delay: -7s;
}

.particle:nth-child(12) {
    left: 50%;
    top: 85%;
    animation-duration: 24s;
    animation-delay: -10s;
    background: #a855f7;
    width: 3px;
    height: 3px;
}

@keyframes particle-drift {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 0;
    }

    10% {
        opacity: 0.3;
    }

    90% {
        opacity: 0.3;
    }

    100% {
        transform: translate(calc(var(--drift-x, 100px)), calc(var(--drift-y, -200px))) scale(0.5);
        opacity: 0;
    }
}

.particle:nth-child(odd) {
    --drift-x: 80px;
    --drift-y: -300px;
}

.particle:nth-child(even) {
    --drift-x: -60px;
    --drift-y: -250px;
}

/* ===== Animated Counter ===== */
.counter-value {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* ===== Pulse Ring ===== */
.pulse-ring {
    position: relative;
}

.pulse-ring::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    border: 2px solid var(--primary-400);
    transform: translate(-50%, -50%);
    animation: pulse-ring 2s ease-out infinite;
}

@keyframes pulse-ring {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* ===== Gradient Text Animation ===== */
.text-gradient-animated {
    background: linear-gradient(90deg, #6366f1, #0ea5e9, #06b6d4, #8b5cf6, #6366f1);
    background-size: 200% auto;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-text 4s linear infinite;
}

@keyframes gradient-text {
    to {
        background-position: 200% center;
    }
}

/* ===== Hero Mesh Gradient Background ===== */
.hero-gradient-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.hero-gradient-bg::before {
    content: '';
    position: absolute;
    width: 150%;
    height: 150%;
    top: -25%;
    left: -25%;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(6, 182, 212, 0.12) 0%, transparent 50%),
        radial-gradient(ellipse at 40% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%),
        radial-gradient(ellipse at 60% 30%, rgba(14, 165, 233, 0.08) 0%, transparent 50%);
    animation: mesh-move 20s ease-in-out infinite alternate;
}

@keyframes mesh-move {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }

    33% {
        transform: translate(30px, -20px) rotate(1deg);
    }

    66% {
        transform: translate(-20px, 20px) rotate(-1deg);
    }

    100% {
        transform: translate(10px, -10px) rotate(0.5deg);
    }
}

/* ===== Smooth Section Divider ===== */
.section-divider {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-400), var(--accent-400));
    border-radius: var(--radius-full);
    margin: 0 auto 2rem;
}

/* ===== Back to Top Button ===== */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

/* ===== Testimonial Carousel ===== */
.testimonial-track {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 1rem 0;
}

.testimonial-track::-webkit-scrollbar {
    display: none;
}

.testimonial-card {
    min-width: 350px;
    max-width: 400px;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-xl);
    flex-shrink: 0;
    transition: all 0.4s ease;
}

.testimonial-card:hover {
    border-color: var(--primary-400);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.testimonial-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-400), var(--accent-400));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
}

.testimonial-stars {
    color: #fbbf24;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    letter-spacing: 2px;
}

.testimonial-text {
    font-style: italic;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.testimonial-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.testimonial-role {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ===== Logo Bar ===== */
.logo-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.logo-bar:hover {
    opacity: 0.8;
}

.logo-item {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
}

/* ===== Split Auth Layout ===== */
.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

.auth-brand-panel {
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 40%, #172554 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.auth-brand-panel::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background:
        radial-gradient(ellipse at 30% 50%, rgba(99, 102, 241, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 30%, rgba(6, 182, 212, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 80%, rgba(139, 92, 246, 0.12) 0%, transparent 50%);
    animation: mesh-move 15s ease-in-out infinite alternate;
}

.auth-brand-content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: white;
    max-width: 400px;
}

.auth-brand-logo {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.auth-brand-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.auth-brand-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.auth-brand-features {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    text-align: left;
}

.auth-brand-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.8);
}

.auth-brand-feature i {
    width: 24px;
    height: 24px;
    background: rgba(99, 102, 241, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #818cf8;
    flex-shrink: 0;
}

.auth-form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: var(--bg-color);
}

.auth-form-wrapper {
    width: 100%;
    max-width: 440px;
}

@media (max-width: 900px) {
    .auth-split {
        grid-template-columns: 1fr;
    }

    .auth-brand-panel {
        display: none;
    }
}

/* ===== Enhanced Step Timeline ===== */
.timeline-steps {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.timeline-step {
    display: flex;
    gap: 2rem;
    position: relative;
    padding-bottom: 3rem;
}

.timeline-step:last-child {
    padding-bottom: 0;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

.timeline-dot {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: white;
    position: relative;
    z-index: 1;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

.timeline-line {
    width: 2px;
    flex: 1;
    background: linear-gradient(to bottom, var(--primary-400), transparent);
    margin-top: 0.5rem;
}

.timeline-step:last-child .timeline-line {
    display: none;
}

.timeline-content {
    padding-top: 0.75rem;
}

.timeline-content h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.timeline-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

@media (max-width: 600px) {
    .timeline-step {
        gap: 1rem;
    }

    .timeline-dot {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

/* ===== Newsletter Input ===== */
.newsletter-form {
    display: flex;
    gap: 0;
    max-width: 400px;
}

.newsletter-input {
    flex: 1;
    padding: 0.75rem 1rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.3s ease;
}

.newsletter-input:focus {
    border-color: var(--primary-400);
}

.newsletter-input::placeholder {
    color: var(--text-muted);
}

.newsletter-btn {
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--primary-500), var(--accent-500));
    border: none;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.newsletter-btn:hover {
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--primary-400);
    color: white;
    border-color: var(--primary-400);
}