/* ============================================
   assets/css/login.css
   ============================================ */

:root {
    --primary: #5B46F7;
    --primary-dark: #4338ca;
    --primary-light: #7C3AED;
    --primary-soft: rgba(91, 70, 247, 0.1);
    --primary-glow: rgba(91, 70, 247, 0.25);
    --success: #10b981;
    --text-dark: #0f172a;
    --text-gray: #475569;
    --text-light: #64748b;
    --border-light: #e2e8f0;
    --bg-glass: rgba(255, 255, 255, 0.98);
    --bg-card: rgba(255, 255, 255, 0.96);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 40px -12px rgba(0, 0, 0, 0.15);
    --shadow-primary: 0 20px 35px -10px rgba(91, 70, 247, 0.25);
    --shadow-card: 0 25px 50px -12px rgba(0, 0, 0, 0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'vazir', 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 50%, #f1f5f9 100%);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== پس‌زمینه داینامیک ===== */
.particle-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    background: rgba(91, 70, 247, 0.12);
    border-radius: 50%;
    pointer-events: none;
    animation: floatParticle linear infinite;
}

@keyframes floatParticle {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.5; }
    90% { opacity: 0.5; }
    100% { transform: translateY(-100vh) rotate(360deg); opacity: 0; }
}

/* ===== اشکال متحرک (Morphing) ===== */
.animated-shape {
    position: fixed;
    z-index: 0;
    pointer-events: none;
    opacity: 0.3;
}

.shape-1 {
    top: -50px;
    left: -50px;
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #5B46F7, #C084FC);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    animation: morphing1 15s ease-in-out infinite;
}

.shape-2 {
    bottom: -80px;
    left: 10%;
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
    animation: morphing2 12s ease-in-out infinite reverse;
}

.shape-3 {
    top: 40%;
    left: -30px;
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    border-radius: 40% 60% 70% 30% / 40% 50% 50% 60%;
    animation: morphing3 18s ease-in-out infinite;
}

.shape-4 {
    bottom: 20%;
    left: 15%;
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #ec4899, #f472b6);
    border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%;
    animation: morphing1 20s ease-in-out infinite;
}

@keyframes morphing1 {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    25% { border-radius: 58% 42% 75% 25% / 76% 46% 54% 24%; }
    50% { border-radius: 50% 50% 33% 67% / 55% 27% 73% 45%; }
    75% { border-radius: 33% 67% 58% 42% / 63% 68% 32% 37%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

@keyframes morphing2 {
    0% { border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; }
    50% { border-radius: 45% 55% 48% 52% / 51% 41% 59% 49%; }
    100% { border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%; }
}

@keyframes morphing3 {
    0% { border-radius: 40% 60% 70% 30% / 40% 50% 50% 60%; }
    50% { border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%; }
    100% { border-radius: 40% 60% 70% 30% / 40% 50% 50% 60%; }
}

/* ===== کانتینر اصلی ===== */
.login-container {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
}

/* ===== کادر سمت چپ (لوگو و آیکون‌های متحرک) ===== */
.hero-card {
    position: fixed;
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    width: 380px;
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 48px;
    padding: 40px 32px;
    text-align: center;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(91, 70, 247, 0.15);
    z-index: 20;
}

/* لوگو */
.logo-wrapper {
    width: 140px;
    height: 140px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, var(--primary-soft), rgba(124, 58, 237, 0.05));
    border-radius: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(91, 70, 247, 0.2);
    box-shadow: 0 10px 25px -5px rgba(91, 70, 247, 0.2);
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 28px;
}

.logo-placeholder {
    font-size: 4rem;
    color: var(--primary);
}

/* عنوان */
.hero-title {
    font-family: 'lalezar', 'vazir', sans-serif;
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 8px;
    letter-spacing: 1px;
}

.hero-subtitle {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 500;
    margin-bottom: 32px;
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

.hero-subtitle::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 25%;
    width: 50%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* ===== آیکون‌های متحرک در کادر ===== */
.floating-icons {
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.float-icon-item {
    font-size: 1.8rem;
    color: var(--primary);
    background: var(--primary-soft);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    transition: all 0.3s ease;
    animation: floatIconRandom 4s ease-in-out infinite;
    cursor: default;
}

.float-icon-item:nth-child(1) { animation-delay: 0s; animation-duration: 3.5s; }
.float-icon-item:nth-child(2) { animation-delay: 0.5s; animation-duration: 4.2s; }
.float-icon-item:nth-child(3) { animation-delay: 1s; animation-duration: 3.8s; }
.float-icon-item:nth-child(4) { animation-delay: 1.5s; animation-duration: 4.5s; }

@keyframes floatIconRandom {
    0% {
        transform: translate(0, 0) rotate(0deg);
    }
    20% {
        transform: translate(5px, -8px) rotate(3deg);
    }
    40% {
        transform: translate(-4px, -3px) rotate(-2deg);
    }
    60% {
        transform: translate(3px, 5px) rotate(2deg);
    }
    80% {
        transform: translate(-5px, 2px) rotate(-3deg);
    }
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
}

.float-icon-item:hover {
    transform: scale(1.05);
    background: var(--primary);
    color: white;
    box-shadow: 0 8px 20px rgba(91, 70, 247, 0.3);
}

/* ===== فرم سمت راست ===== */
.login-wrapper {
    max-width: 550px;
    width: 100%;
    margin-right: 5%;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border-radius: 48px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.3);
    overflow: hidden;
}

/* ===== هدر فرم ===== */
.form-header {
    text-align: center;
    padding: 32px 32px 0 32px;
}

.form-header h1 {
    font-family: 'lalezar', 'vazir', sans-serif;
    font-size: 2rem;
    color: var(--text-dark);
    margin-bottom: 8px;
}
.form-header h1 span {
    font-family: 'lalezar', 'vazir', sans-serif;
    font-size: 2rem;
    color: #5B46F7;
    margin-bottom: 8px;
}
.form-header p {
    color: var(--text-gray);
    font-size: 0.85rem;
}

/* ===== تب‌ها ===== */
.tabs {
    display: flex;
    gap: 12px;
    background: #f1f5f9;
    margin: 24px 32px;
    padding: 6px;
    border-radius: 60px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px 20px;
    border-radius: 60px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    color: var(--text-gray);
    background: transparent;
    border: none;
    font-family: 'vazir', sans-serif;
}

.tab-btn i {
    margin-left: 8px;
}

.tab-active {
    background: white;
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ===== فرم‌ها ===== */
.form-container {
    display: none;
    padding: 0 32px 32px 32px;
    animation: fadeInUp 0.4s ease;
}

.form-container.active {
    display: block;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== گروه‌های ورودی ===== */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.input-group label i {
    color: var(--primary);
    margin-left: 8px;
}

.input-wrapper {
    position: relative;
}

.input-wrapper i.input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-gray);
    font-size: 1rem;
    pointer-events: none;
}

.input-modern {
    width: 100%;
    padding: 14px 48px 14px 16px;
    border: 2px solid var(--border-light);
    border-radius: 16px;
    font-family: 'vazir', sans-serif;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: #fafcff;
}

.input-modern:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 4px var(--primary-glow);
    background: white;
}

/* ===== دکمه مرا به خاطر بسپار ===== */
.remember-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    gap: 10px;
}

.checkbox-wrapper input {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border-light);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    background: white;
}

.checkbox-custom i {
    font-size: 12px;
    color: white;
    opacity: 0;
    transition: all 0.2s ease;
}

.checkbox-wrapper input:checked + .checkbox-custom {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-wrapper input:checked + .checkbox-custom i {
    opacity: 1;
}

.checkbox-wrapper span {
    font-size: 0.85rem;
    color: var(--text-gray);
    font-weight: 500;
}

.forgot-link {
    font-size: 0.8rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.forgot-link:hover {
    color: var(--primary-dark);
}

/* ===== دکمه‌ها ===== */
.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: 16px;
    color: white;
    font-weight: 700;
    font-family: 'vazir', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-primary);
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 35px -12px rgba(91, 70, 247, 0.4);
}

.btn-register {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--success), #34d399);
    border: none;
    border-radius: 16px;
    color: white;
    font-weight: 700;
    font-family: 'vazir', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 20px 35px -10px rgba(16, 185, 129, 0.3);
}

.btn-register:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 35px -12px rgba(16, 185, 129, 0.4);
}

/* ===== نقش‌ها ===== */
.role-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.role-radio {
    display: none;
}

.role-box {
    border: 2px solid var(--border-light);
    border-radius: 16px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #fafcff;
}

.role-box i {
    font-size: 1.3rem;
    margin-bottom: 8px;
    display: block;
    color: var(--text-gray);
}

.role-box span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-gray);
}

.role-radio:checked + .role-box {
    background: #eff6ff;
    border-color: var(--primary);
    transform: translateY(-2px);
}

.role-radio:checked + .role-box i,
.role-radio:checked + .role-box span {
    color: var(--primary);
}

/* ===== فیلدهای داینامیک ===== */
.role-fields {
    animation: fadeInUp 0.3s ease;
}

.hidden {
    display: none !important;
}

.hint {
    font-size: 0.7rem;
    color: var(--text-gray);
    margin-top: 4px;
    display: block;
}

/* ===== ریسپانسیو ===== */
@media (max-width: 1200px) {
    .hero-card {
        width: 340px;
        left: 3%;
    }
    .login-wrapper {
        margin-right: 3%;
    }
}

@media (max-width: 992px) {
    .hero-card, .animated-shape {
        display: none;
    }
    .login-container {
        justify-content: center;
    }
    .login-wrapper {
        margin-right: 0;
        max-width: 500px;
    }
}

@media (max-width: 576px) {
    .form-container {
        padding: 0 20px 24px 20px;
    }
    .tabs {
        margin: 20px 20px;
    }
    .form-header {
        padding: 24px 24px 0 24px;
    }
    .role-grid {
        gap: 8px;
    }
    .role-box {
        padding: 8px;
    }
    .role-box i {
        font-size: 1rem;
    }
    .role-box span {
        font-size: 0.65rem;
    }
}