/* Advanced Password Reset Animations & Effects */

/* Floating Animation for Icons */
@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.forgot-icon, .reset-icon {
    animation: float 3s ease-in-out infinite;
}

/* Pulse Animation for Icon Background */
@keyframes iconPulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.3;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.2);
        opacity: 0.1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

.forgot-icon-pulse, .reset-icon-pulse {
    animation: iconPulse 2s infinite;
}

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

.forgot-password-container, .reset-password-container {
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

/* Slide In Animation for Form */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.forgot-panel, .reset-panel {
    animation: slideInUp 0.6s ease-out;
}

/* Fade In Animation for Security Side */
@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.security-side {
    animation: fadeInRight 0.8s ease-out 0.3s both;
}

/* Stagger Animation for Feature Items */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.feature-item {
    animation: fadeInScale 0.5s ease-out both;
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.2s; }
.feature-item:nth-child(3) { animation-delay: 0.3s; }
.feature-item:nth-child(4) { animation-delay: 0.4s; }

/* Button Hover Effects */
.custom-submit-btn {
    position: relative;
    overflow: hidden;
}

.custom-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.custom-submit-btn:hover::before {
    left: 100%;
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.custom-submit-btn.loading {
    position: relative;
}

.custom-submit-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Input Focus Animation */
.custom-input-group {
    position: relative;
}

.custom-input-group::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.custom-input-group.focused::after,
.custom-input-group:focus-within::after {
    width: 100%;
}

/* Password Strength Animation */
.password-strength-bar {
    position: relative;
    overflow: hidden;
}

.password-strength-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* Requirement Check Animation */
.requirement-item {
    transition: all 0.3s ease;
}

.requirement-item.req-met {
    transform: scale(1.05);
}

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

.req-met .requirement-icon {
    transform: scale(1.2);
}

/* Alert Animation */
@keyframes alertSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.custom-alert {
    animation: alertSlideIn 0.4s ease-out;
}

/* Success State Animation */
@keyframes successPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(72, 187, 120, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 0 10px rgba(72, 187, 120, 0);
    }
}

.custom-input.is-valid {
    animation: successPulse 0.6s ease-out;
}

/* Error State Animation */
@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.custom-input.is-invalid {
    animation: errorShake 0.5s ease-out;
}

/* Countdown Animation */
@keyframes countdownPulse {
    0%, 100% {
        color: #f56565;
        transform: scale(1);
    }
    50% {
        color: #e53e3e;
        transform: scale(1.1);
    }
}

#countdown {
    animation: countdownPulse 1s ease-in-out infinite;
}

/* Security Card Hover Effect */
.security-info-card, .requirements-card {
    transition: all 0.3s ease;
}

.security-info-card:hover, .requirements-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* Particle Effect for Background */
.security-side::before {
    animation: particleFloat 20s linear infinite;
}

@keyframes particleFloat {
    0% { transform: translateY(0px) rotate(0deg); }
    100% { transform: translateY(-100px) rotate(360deg); }
}

/* Typing Effect for Titles */
@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink {
    0%, 50% { border-color: transparent; }
    51%, 100% { border-color: currentColor; }
}

.forgot-title, .reset-title {
    overflow: hidden;
    white-space: nowrap;
    border-right: 2px solid;
    animation: typing 2s steps(20) 0.5s both, blink 1s step-end infinite 2.5s;
}

/* Responsive Animations */
@media (max-width: 768px) {
    .forgot-panel, .reset-panel {
        animation: slideInUp 0.4s ease-out;
    }
    
    .feature-item {
        animation-duration: 0.3s;
    }
    
    .forgot-title, .reset-title {
        animation: none;
        border-right: none;
        white-space: normal;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .forgot-icon, .reset-icon {
        animation: none;
    }
    
    .forgot-icon-pulse, .reset-icon-pulse {
        animation: none;
        opacity: 0.3;
    }
    
    .forgot-password-container, .reset-password-container {
        animation: none;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .custom-submit-btn {
        border: 2px solid currentColor;
    }
    
    .password-strength-bar {
        border: 1px solid currentColor;
    }
    
    .custom-input-group {
        border: 2px solid currentColor;
    }
}

/* Print Styles */
@media print {
    .forgot-icon-pulse, .reset-icon-pulse {
        display: none;
    }
    
    .security-side {
        display: none !important;
    }
    
    .forgot-panel, .reset-panel {
        box-shadow: none;
        border: 1px solid #000;
    }
}