/* NIUAXI FUNNEL - TIER 2 ENHANCEMENTS (Additional CSS) */
/* Animaciones avanzadas, iconografía mejorada, micro-interacciones */

/* ============================================================
   ENHANCEMENT 1: FIELD ANIMATIONS STAGGERED (Scroll reveal)
   ============================================================ */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-field-animated {
    animation: fadeInUp 0.5s ease-out forwards;
    opacity: 0;
}

.form-field-animated:nth-child(1) { animation-delay: 0.1s; }
.form-field-animated:nth-child(2) { animation-delay: 0.2s; }
.form-field-animated:nth-child(3) { animation-delay: 0.3s; }
.form-field-animated:nth-child(4) { animation-delay: 0.4s; }
.form-field-animated:nth-child(5) { animation-delay: 0.5s; }
.form-field-animated:nth-child(6) { animation-delay: 0.6s; }

/* ============================================================
   ENHANCEMENT 2: CARD OPTION GROUP GRID MEJORADO
   ============================================================ */

.card-option {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.02);
    padding: 16px 20px;
    cursor: pointer;
    display: flex;
    align-items: flex-start;
    position: relative;
    gap: 12px;
    flex-direction: column;
}

.card-option:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.15);
}

.card-option.selected {
    background: rgba(30, 98, 236, 0.08);
    border-color: var(--accent-blue);
    box-shadow: 0 0 12px rgba(30, 98, 236, 0.15);
}

.card-option input[type="radio"],
.card-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
    left: 0;
    top: 0;
    margin: 0;
}

.card-option-circle {
    display: none;
}

.card-option-text {
    font-family: 'Outfit', sans-serif;
    font-size: 14px;
    font-weight: 500;
    width: 100%;
}

.card-option-icon {
    width: 40px;
    height: 40px;
    background: rgba(30, 98, 236, 0.15);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #4facfe;
    margin: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(30, 98, 236, 0.2);
    flex-shrink: 0;
}

.card-option.selected .card-option-icon {
    background: rgba(30, 98, 236, 0.3);
    box-shadow: 0 0 15px rgba(30, 98, 236, 0.4);
    transform: scale(1.15) rotate(5deg);
}

.card-option-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin: 16px 0;
}

/* ============================================================
   ENHANCEMENT 3: TRANSICIONES SUAVES ENTRE PASOS
   ============================================================ */

@keyframes pageTransitionOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

@keyframes pageTransitionIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-transition-out {
    animation: pageTransitionOut 0.3s ease-out forwards;
}

.page-transition-in {
    animation: pageTransitionIn 0.5s ease-out;
}

/* ============================================================
   ENHANCEMENT 4: PROGRESS META INDICATORS
   ============================================================ */

.progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 16px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.04);
}

.progress-time {
    animation: pulse 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    gap: 6px;
}

.progress-fields {
    font-weight: 500;
    color: #4facfe;
}

/* ============================================================
   ENHANCEMENT 5: REAL-TIME VALIDATION VISUAL FEEDBACK
   ============================================================ */

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.form-control.is-valid {
    border-color: #4facfe;
    background-color: rgba(79, 172, 254, 0.05);
}

.form-control.is-valid:focus {
    box-shadow: 0 0 15px rgba(79, 172, 254, 0.3),
                0 0 30px rgba(79, 172, 254, 0.1),
                inset 0 0 10px rgba(79, 172, 254, 0.05);
    border-color: #4facfe;
}

.form-control.is-invalid:not(:focus) {
    border-color: rgba(255, 82, 82, 0.5);
    background-color: rgba(255, 82, 82, 0.03);
}

.form-control.is-invalid:focus {
    border-color: #ff5252;
    box-shadow: 0 0 15px rgba(255, 82, 82, 0.3);
}

.validation-message {
    font-size: 12px;
    margin-top: 6px;
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.validation-message.valid {
    color: #4facfe;
    display: block;
}

.validation-message.invalid {
    color: #ff5252;
    display: block;
}

/* ============================================================
   ENHANCEMENT 6: ENHANCED RESULTS INFO CARDS
   ============================================================ */

.results-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.info-card {
    padding: 24px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.info-card:hover {
    background: rgba(30, 98, 236, 0.08);
    border-color: rgba(30, 98, 236, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(30, 98, 236, 0.15);
}

.info-card-title {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 700;
}

.info-card-content {
    font-size: 18px;
    font-weight: 800;
    color: #4facfe;
    line-height: 1.4;
}

.info-card-icon {
    font-size: 28px;
    margin-bottom: 12px;
    opacity: 0.8;
}

/* ============================================================
   ENHANCEMENT 7: NEXT/SUBMIT BUTTON ADVANCED EFFECTS
   ============================================================ */

.btn-next-step {
    position: relative;
    overflow: hidden;
}

.btn-next-step::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.15),
        transparent
    );
    transition: left 0.6s;
    z-index: 0;
}

.btn-next-step:hover::after {
    left: 100%;
}

.btn-next-step:active {
    transform: translateY(-1px) scale(0.98);
    box-shadow: 0 0 16px rgba(30, 98, 236, 0.6);
}

/* ============================================================
   ENHANCEMENT 8: OPTION ICON ANIMATIONS
   ============================================================ */

@keyframes iconFloat {
    0%, 100% {
        transform: translateY(0) rotateZ(0deg);
    }
    50% {
        transform: translateY(-3px) rotateZ(2deg);
    }
}

.card-option:hover .card-option-icon {
    animation: iconFloat 1.5s ease-in-out infinite;
}

/* ============================================================
   ENHANCEMENT 9: SCROLL REVEAL ANIMATIONS
   ============================================================ */

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.scroll-reveal {
    opacity: 0;
}

.scroll-reveal.in-view {
    animation: slideInUp 0.6s ease-out forwards;
}

.scroll-reveal-left.in-view {
    animation: slideInLeft 0.6s ease-out forwards;
}

.scroll-reveal-right.in-view {
    animation: slideInRight 0.6s ease-out forwards;
}

/* ============================================================
   ENHANCEMENT 10: LOADING SKELETON EFFECTS
   ============================================================ */

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.skeleton-loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.05) 0%,
        rgba(255, 255, 255, 0.1) 50%,
        rgba(255, 255, 255, 0.05) 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: 8px;
    min-height: 40px;
}

/* ============================================================
   ENHANCEMENT 11: FORM GROUP ANIMATIONS
   ============================================================ */

.form-group {
    transition: all 0.3s ease;
}

.form-group.error {
    animation: shake 0.5s ease-in-out;
}

.form-group.success {
    animation: slideInRight 0.4s ease-out;
}

/* ============================================================
   ENHANCEMENT 12: BUTTON GROUP ANIMATIONS
   ============================================================ */

.button-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.button-group .btn {
    flex: 1;
    min-width: 150px;
    animation: fadeIn 0.4s ease-out both;
}

.button-group .btn:nth-child(2) {
    animation-delay: 0.1s;
}

.button-group .btn:nth-child(3) {
    animation-delay: 0.2s;
}

/* ============================================================
   ENHANCEMENT 13: STEP COMPLETE ANIMATION
   ============================================================ */

@keyframes stepComplete {
    0% {
        transform: scale(0.8) rotate(-10deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.15) rotate(5deg);
    }
    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.step-node.completed .step-dot {
    animation: stepComplete 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   ENHANCEMENT 14: CONFIRMATION VISUAL
   ============================================================ */

@keyframes confetti {
    0% {
        transform: translateY(0) rotateZ(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(20px) rotateZ(360deg);
        opacity: 0;
    }
}

.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(79, 172, 254, 0.15);
    border: 2px solid #4facfe;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #4facfe;
    margin: 0 auto 20px;
    animation: stepComplete 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ============================================================
   ENHANCEMENT 15: RESPONSIVE & MOBILE OPTIMIZATIONS
   ============================================================ */

@media (max-width: 768px) {
    .card-option-group {
        grid-template-columns: 1fr;
    }
    
    .button-group {
        flex-direction: column;
    }
    
    .button-group .btn {
        min-width: 100%;
    }
    
    .results-metrics-grid,
    .results-info-grid {
        grid-template-columns: 1fr;
    }
    
    .progress-meta {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}

/* ============================================================
   ENHANCEMENT 16: DARK MODE CONSISTENCY
   ============================================================ */

@media (prefers-color-scheme: dark) {
    .form-control, .form-select {
        color-scheme: dark;
    }
}

/* ============================================================
   ENHANCEMENT 16: PROGRESS META INDICATOR
   ============================================================ */

.progress-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: rgba(30, 98, 236, 0.08);
    border: 1px solid rgba(30, 98, 236, 0.2);
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-muted, #a0aec0);
    gap: 16px;
}

.progress-time {
    display: flex;
    align-items: center;
    gap: 6px;
}

.progress-fields {
    font-weight: 500;
    color: var(--accent-blue, #1e62ec);
}

/* ============================================================
   ENHANCEMENT 17: OPTION TITLES AND DESCRIPTIONS
   ============================================================ */

.option-title {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
    color: var(--text-primary, #ffffff);
}

.option-desc {
    font-size: 12px;
    color: var(--text-muted, #a0aec0);
    margin: 0;
}

/* ============================================================
   ENHANCEMENT 18: PERFORMANCE OPTIMIZATION
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
