﻿/* Custom Animations */
@keyframes blob {
    0% {
        transform: translate(0px, 0px) scale(1);
    }

    33% {
        transform: translate(30px, -50px) scale(1.1);
    }

    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }

    100% {
        transform: translate(0px, 0px) scale(1);
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

/* Form Transitions */
.form-section {
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

    .form-section.hidden {
        display: none;
    }

    .form-section.active {
        opacity: 1;
        transform: translateX(0);
    }

/* Toast Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast-enter {
    animation: slideIn 0.3s ease-out forwards;
}

.toast-exit {
    animation: slideOut 0.3s ease-in forwards;
}

/* Password Rule Transitions */
.rule-item {
    transition: all 0.3s ease;
}

    .rule-item.valid {
        color: #10b981;
    }

        .rule-item.valid .rule-icon {
            fill: #10b981;
            stroke: #10b981;
        }

/* Input Autofill Styling */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px white inset;
    -webkit-text-fill-color: inherit;
    transition: background-color 5000s ease-in-out 0s;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #ef4444;
    border-radius: 4px;
}

    ::-webkit-scrollbar-thumb:hover {
        background: #dc2626;
    }

/* Shake Animation for Errors */
@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }

    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.shake {
    animation: shake 0.5s ease-in-out;
}

/* Success Checkmark Animation */
@keyframes checkmark {
    0% {
        stroke-dashoffset: 100;
        opacity: 0;
    }

    100% {
        stroke-dashoffset: 0;
        opacity: 1;
    }
}

.checkmark-animate {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    animation: checkmark 0.6s ease-in-out forwards;
}

/* Loading Spinner */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.spinner {
    animation: spin 1s linear infinite;
}

/* Glass Effect Enhancement */
.backdrop-blur-lg {
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .form-section {
        padding: 0 1rem;
    }
}

@media (max-width: 640px) {
    .max-w-5xl {
        margin: 1rem;
        min-height: auto;
    }

    .lg\:w-5\/12 {
        padding: 2rem;
    }
}

/* Left panel BG image with blur (matte) */
.left-panel {
    position: relative;
}

    .left-panel::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image: url("/img/BG.png");
        background-size: cover;
        background-position: center;
        filter: blur(1px);
        transform: scale(1.08);
        z-index: 0;
    }

    .left-panel::after {
        content: "";
        position: absolute;
        inset: 0;
        /* background: rgba(110, 108, 108, 0.6); */
        z-index: 0;
    }

    .left-panel > * {
        position: relative;
        z-index: 1;
    }

/* Make "خوش آمدید" readable on image */
.welcome-badge {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
