/**
 * BQB Portal Cliente — Motion System
 * Fuente: motion-design skill (Corporate personality)
 */

/* Entrance: cards and quick actions */
@keyframes bqb-fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bqb-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bqb-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-10px); }
    40% { transform: translateX(10px); }
    60% { transform: translateX(-6px); }
    80% { transform: translateX(6px); }
}

@keyframes bqb-scale-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Staggered entrance for home quick actions */
.bqb-portal .start-btn-container {
    animation: bqb-fade-up var(--motion-standard) var(--ease-entrance) both;
}

.bqb-portal .start-btn-container:nth-child(1) { animation-delay: 0ms; }
.bqb-portal .start-btn-container:nth-child(2) { animation-delay: 50ms; }
.bqb-portal .start-btn-container:nth-child(3) { animation-delay: 100ms; }
.bqb-portal .start-btn-container:nth-child(4) { animation-delay: 150ms; }

/* Section content transitions */
.bqb-portal .bqb-section-enter {
    animation: bqb-fade-up var(--motion-standard) var(--ease-entrance) both;
}

/* Modal entrance */
.bqb-portal .modal.show .modal-dialog {
    animation: bqb-scale-in var(--motion-slow) var(--ease-entrance) both;
}

/* Error shake utility */
.bqb-portal .bqb-shake {
    animation: bqb-shake 300ms var(--ease-standard);
}

/* Success toast — improved from slide-in-out */
.bqb-portal #success-form.show {
    animation: bqb-toast-in-out 4s var(--ease-standard);
}

@keyframes bqb-toast-in-out {
    0%, 100% {
        transform: translateY(-100%);
        opacity: 0;
    }
    8%, 92% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Loading skeleton (Fase 3) */
@keyframes bqb-skeleton-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.bqb-portal .bqb-skeleton {
    background: linear-gradient(90deg, var(--bqb-border) 25%, var(--bqb-surface-alt) 50%, var(--bqb-border) 75%);
    background-size: 200% 100%;
    animation: bqb-skeleton-pulse 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
}

/* Reduced motion — CRITICAL */
@media (prefers-reduced-motion: reduce) {
    .bqb-portal *,
    .bqb-portal *::before,
    .bqb-portal *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .bqb-portal .start-btn-container:hover,
    .bqb-portal .start-btn-container,
    .bqb-portal .general-card:hover {
        transform: none !important;
    }
}
