/* ============================================
   OFFREG - Animations & Effets Visuels
   ============================================ */

/* --- KEYFRAMES AVANCÉES --- */

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

/* Flottement lent */
@keyframes floatSlow {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    25% { transform: translateY(-8px) rotate(1deg); }
    75% { transform: translateY(-4px) rotate(-1deg); }
}

/* Pulse lumineux */
@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

/* Pulse glow */
@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 0 0 rgba(26,86,219,0.4); }
    50% { box-shadow: 0 0 0 12px rgba(26,86,219,0); }
}

/* Shine / Shimmer */
@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Gradient shift */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

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

/* Slide in from left */
@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-60px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Slide in from right */
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(60px); }
    to { opacity: 1; transform: translateX(0); }
}

/* Slide in from bottom with scale */
@keyframes slideInUp {
    from { opacity: 0; transform: translateY(40px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Zoom in */
@keyframes zoomIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

/* Typewriter cursor */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Gradient text animation */
@keyframes gradientText {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Ripple effect */
@keyframes ripple {
    0% { transform: scale(0); opacity: 0.6; }
    100% { transform: scale(4); opacity: 0; }
}

/* Number count up glow */
@keyframes countGlow {
    0% { text-shadow: 0 0 0 rgba(245,158,11,0); }
    50% { text-shadow: 0 0 20px rgba(245,158,11,0.5); }
    100% { text-shadow: 0 0 0 rgba(245,158,11,0); }
}

/* Icon bounce */
@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    20% { transform: translateY(-6px); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-4px); }
    80% { transform: translateY(-1px); }
}

/* Dot pulse */
@keyframes dotPulse {
    0%, 100% { opacity: 0.3; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* Wave animation for hero background */
@keyframes wave {
    0% { transform: translateX(0) translateZ(0) scaleY(1); }
    50% { transform: translateX(-25%) translateZ(0) scaleY(0.55); }
    100% { transform: translateX(-50%) translateZ(0) scaleY(1); }
}

/* Border gradient animation */
@keyframes borderGradient {
    0% { border-color: var(--primary); }
    33% { border-color: var(--accent); }
    66% { border-color: var(--success); }
    100% { border-color: var(--primary); }
}

/* Skeleton loading */
@keyframes skeleton {
    0% { background-position: -200px 0; }
    100% { background-position: calc(200px + 100%) 0; }
}


/* --- HERO ANIMATIONS --- */

/* Particules flottantes */
.hero::before {
    animation: floatSlow 8s ease-in-out infinite;
}

.hero::after {
    animation: floatSlow 10s ease-in-out infinite reverse;
}

/* Badge animation */
.hero-badge {
    animation: fadeInDown 0.8s ease, pulse 3s ease-in-out infinite 1.5s;
}

/* Title word stagger */
.hero-title span:nth-child(1) {
    animation: slideInLeft 0.8s ease 0.1s both;
}

.hero-title .highlight {
    animation: slideInUp 0.8s ease 0.3s both, gradientText 4s ease infinite;
    background-size: 200% 200%;
}

.hero-title span:nth-child(3) {
    animation: slideInRight 0.8s ease 0.5s both;
}

/* Stats animation */
.stat-item {
    animation: fadeInUp 0.6s ease both;
}

.stat-item:nth-child(1) { animation-delay: 0.5s; }
.stat-item:nth-child(2) { animation-delay: 0.7s; }
.stat-item:nth-child(3) { animation-delay: 0.9s; }

/* Stat number glow when counted */
.stat-number.counted {
    animation: countGlow 1s ease;
}

/* CTA buttons stagger */
.hero-actions .btn:nth-child(1) {
    animation: slideInUp 0.6s ease 1s both;
}

.hero-actions .btn:nth-child(2) {
    animation: slideInUp 0.6s ease 1.2s both;
}


/* --- NAVBAR ANIMATIONS --- */

.nav-logo .logo-icon {
    transition: var(--transition);
}

.nav-logo:hover .logo-icon {
    transform: rotate(-10deg) scale(1.1);
    box-shadow: 0 4px 12px rgba(26,86,219,0.3);
}

.nav-links a {
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: all 0.3s ease;
    transform: translateX(-50%);
    border-radius: 2px;
}

.nav-links a:hover::after {
    width: 60%;
}


/* --- CARD ANIMATIONS --- */

/* Step cards */
.step-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(26,86,219,0.12);
}

.step-card:hover .step-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 8px 20px rgba(26,86,219,0.3);
}

.step-card:hover .step-number {
    color: var(--primary);
    transform: scale(1.1);
}

.step-icon {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-number {
    transition: all 0.4s ease;
}

/* Amount cards */
.amount-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.amount-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s ease;
}

.amount-card:hover::before {
    left: 100%;
}

.amount-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0,0,0,0.1);
}

.amount-card-featured:hover {
    box-shadow: 0 20px 40px rgba(26,86,219,0.2);
}

.amount-card .btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.amount-card .btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.amount-card .btn:hover::after {
    width: 300px;
    height: 300px;
}

/* Testimonial cards */
.testimonial-card {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.testimonial-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.08);
}

.testimonial-card:hover .author-avatar {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(26,86,219,0.3);
}

.author-avatar {
    transition: all 0.3s ease;
}

/* Feature items */
.feature-item {
    transition: all 0.3s ease;
    padding: 12px;
    border-radius: var(--radius-sm);
}

.feature-item:hover {
    background: var(--primary-light);
    transform: translateX(8px);
}

.feature-item:hover .feature-icon {
    transform: scale(1.15) rotate(-5deg);
    box-shadow: 0 4px 12px rgba(26,86,219,0.2);
}

.feature-icon {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Eligibility items */
.eligibility-item {
    transition: all 0.3s ease;
    padding: 12px;
    border-radius: var(--radius-sm);
}

.eligibility-item:hover {
    background: #f0fdf4;
    transform: translateX(6px);
}

.eligibility-item:hover .eligibility-check {
    transform: scale(1.2);
    background: var(--success);
    color: #fff;
}

.eligibility-check {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}


/* --- BUTTON ANIMATIONS --- */

.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Ripple effect on click */
.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 400px;
    height: 400px;
}

/* Primary button pulse on hover */
.btn-primary:hover {
    animation: pulseGlow 2s ease-in-out infinite;
}

/* Outline button glow */
.btn-outline:hover {
    box-shadow: 0 0 20px rgba(26,86,219,0.15);
}

/* Submit button loading state */
.btn-submit.loading {
    pointer-events: none;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 100%;
    animation: shimmer 1.5s linear infinite;
}


/* --- FORM ANIMATIONS --- */

/* Input focus glow */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    box-shadow: 0 0 0 4px rgba(26,86,219,0.1);
    transform: translateY(-1px);
}

/* Input error shake */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.form-group input.error,
.form-group select.error {
    animation: shake 0.4s ease;
}

/* Radio card selection animation */
.amount-option .option-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.amount-option input:checked + .option-card {
    animation: zoomIn 0.3s ease;
}

.amount-option .option-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(26,86,219,0.12);
}

/* Checkbox check animation */
@keyframes checkmark {
    0% { transform: scale(0) rotate(45deg); }
    50% { transform: scale(1.2) rotate(45deg); }
    100% { transform: scale(1) rotate(45deg); }
}

.checkbox-label input:checked + .checkmark::after {
    animation: checkmark 0.3s ease;
}


/* --- IMAGE ANIMATIONS --- */

.about-image img,
.eligibility-image img {
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.about-image:hover img,
.eligibility-image:hover img {
    transform: scale(1.03);
    box-shadow: 0 24px 48px rgba(0,0,0,0.15);
}

.about-image-badge {
    transition: all 0.3s ease;
    animation: float 4s ease-in-out infinite;
}

.about-image:hover .about-image-badge {
    transform: scale(1.05);
}


/* --- SECTION TAG ANIMATIONS --- */

.section-tag {
    transition: all 0.3s ease;
}

.section-tag:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26,86,219,0.3);
}


/* --- SCROLL REVEAL ANIMATIONS --- */

/* Base reveal */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Slide from left */
.reveal-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Slide from right */
.reveal-right {
    opacity: 0;
    transform: translateX(50px);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Zoom reveal */
.reveal-zoom {
    opacity: 0;
    transform: scale(0.85);
    transition: all 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Stagger delays for children */
.stagger-children > *:nth-child(1) { transition-delay: 0.05s; }
.stagger-children > *:nth-child(2) { transition-delay: 0.12s; }
.stagger-children > *:nth-child(3) { transition-delay: 0.19s; }
.stagger-children > *:nth-child(4) { transition-delay: 0.26s; }
.stagger-children > *:nth-child(5) { transition-delay: 0.33s; }
.stagger-children > *:nth-child(6) { transition-delay: 0.40s; }


/* --- PARALLAX EFFECT --- */

.parallax-slow {
    will-change: transform;
}


/* --- FOOTER ANIMATIONS --- */

.footer-social a {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.footer-social a:hover {
    transform: translateY(-4px) scale(1.1);
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 6px 16px rgba(26,86,219,0.3);
}

.footer-links a {
    position: relative;
    padding-left: 0;
    transition: all 0.3s ease;
}

.footer-links a:hover {
    padding-left: 8px;
    color: #fff;
}

.footer-links a::before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
    transform: translateY(-50%);
    border-radius: 2px;
}

.footer-links a:hover::before {
    width: 12px;
}

.footer-logo .logo-icon {
    transition: all 0.3s ease;
}

.footer-logo:hover .logo-icon {
    transform: rotate(-10deg) scale(1.1);
}


/* --- MODAL ANIMATIONS --- */

.modal-overlay {
    transition: opacity 0.3s ease;
}

.modal-content {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-icon {
    animation: zoomIn 0.5s ease 0.2s both;
}

.modal-content h3 {
    animation: fadeInUp 0.5s ease 0.3s both;
}

.modal-content p {
    animation: fadeInUp 0.5s ease 0.4s both;
}

.modal-content .btn {
    animation: fadeInUp 0.5s ease 0.5s both;
}


/* --- COUNTER ANIMATION --- */

.stat-number {
    transition: all 0.3s ease;
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
    color: var(--accent);
}

.stat-item:hover .stat-label {
    color: var(--text);
}


/* --- SMOOTH SECTION TRANSITIONS --- */

.section {
    position: relative;
}

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border), transparent);
}


/* --- LOADING STATE --- */

.page-loading {
    position: fixed;
    inset: 0;
    background: var(--bg);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-loading.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: rotateSlow 0.8s linear infinite;
}


/* --- MOBILE ANIMATIONS --- */
@media (max-width: 768px) {
    /* Disable tilt effect on touch devices */
    .step-card:hover,
    .amount-card:hover,
    .testimonial-card:hover {
        transform: translateY(-4px);
    }

    /* Simpler hover states for mobile */
    .feature-item:hover,
    .eligibility-item:hover {
        transform: none;
        background: transparent;
    }

    .feature-item:active,
    .eligibility-item:active {
        background: var(--primary-light);
    }

    /* Reduce animation intensity */
    .hero-badge {
        animation: fadeInDown 0.6s ease;
    }

    .about-image-badge {
        animation: none;
    }

    /* Faster reveal for mobile */
    .reveal,
    .reveal-left,
    .reveal-right,
    .reveal-zoom {
        transition-duration: 0.5s;
    }

    /* Disable parallax on mobile for performance */
    .hero-content {
        transform: none !important;
        opacity: 1 !important;
    }
}

/* --- 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-left, .reveal-right, .reveal-zoom {
        opacity: 1;
        transform: none;
    }
}
