/* assets/css/auth.css */

:root {
    --auth-primary: #4361ee;
    --auth-secondary: #3a0ca3;
    --auth-success: #4cc9f0;
    --auth-warning: #f72585;
    --auth-light: #f8f9fa;
    --auth-dark: #212529;
    --auth-gradient: linear-gradient(135deg, var(--auth-primary), var(--auth-secondary));
    --auth-radius: 15px;
    --auth-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Peyda', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}

/* انیمیشن پس‌زمینه */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    animation: float 15s infinite ease-in-out;
}

.bubble:nth-child(1) {
    width: 100px;
    height: 100px;
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.bubble:nth-child(2) {
    width: 150px;
    height: 150px;
    top: 60%;
    left: 80%;
    animation-delay: 2s;
}

.bubble:nth-child(3) {
    width: 80px;
    height: 80px;
    top: 80%;
    left: 20%;
    animation-delay: 4s;
}

.bubble:nth-child(4) {
    width: 120px;
    height: 120px;
    top: 20%;
    left: 70%;
    animation-delay: 6s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    33% {
        transform: translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateY(20px) rotate(240deg);
    }
}

/* کانتینر اصلی */
.login-container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    min-height: 700px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--auth-radius);
    overflow: hidden;
    box-shadow: var(--auth-shadow);
    animation: slideUp 0.8s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* باکس سمت چپ (فرم) */
.login-box {
    flex: 1;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: white;
    position: relative;
    overflow: hidden;
}

.login-box::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    background: var(--auth-gradient);
}

.login-header {
    text-align: center;
    margin-bottom: 40px;
}

.login-header h1 {
    font-size: 2.5rem;
    background: var(--auth-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
    font-weight: bold;
}

.login-header p {
    color: #666;
    font-size: 1.1rem;
}

/* فرم */
.login-form {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--auth-dark);
    font-size: 1rem;
}

.form-group input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-family: 'Peyda', sans-serif;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

.form-group input:focus {
    border-color: var(--auth-primary);
    outline: none;
    background: white;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.form-group input::placeholder {
    color: #aaa;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

/* دکمه */
.btn {
    padding: 15px 30px;
    border: none;
    border-radius: 12px;
    font-family: 'Peyda', sans-serif;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--auth-gradient);
    color: white;
    box-shadow: 0 5px 20px rgba(67, 97, 238, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(67, 97, 238, 0.4);
}

.btn-block {
    width: 100%;
}

/* فوتر فرم */
.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.login-footer p {
    margin-bottom: 10px;
    color: #666;
}

.login-footer a {
    color: var(--auth-primary);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.login-footer a:hover {
    color: var(--auth-secondary);
    gap: 10px;
}

/* بخش سمت راست */
.login-side, .register-side {
    flex: 1;
    background: var(--auth-gradient);
    color: white;
    padding: 50px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.login-side::before, .register-side::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000" opacity="0.05"><path d="M0,0V1000H1000V0ZM500,800C300,800,200,600,200,500S300,200,500,200,800,400,800,500,700,800,500,800Z"/></svg>');
    background-size: 300px;
    opacity: 0.3;
}

.side-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.side-content h2 {
    font-size: 2.2rem;
    margin-bottom: 20px;
    font-weight: bold;
}

.side-content p {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
}

/* ویژگی‌های سیستم */
.features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.feature:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-5px);
}

.feature .icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.feature span {
    font-size: 0.95rem;
    font-weight: bold;
}

/* لیست ویژگی‌های ثبت‌نام */
.features-list {
    list-style: none;
    margin-bottom: 40px;
    text-align: right;
}

.features-list li {
    padding: 12px 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.features-list li:last-child {
    border-bottom: none;
}

.features-list li::before {
    content: '✓';
    background: white;
    color: var(--auth-primary);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* نیازمندی‌ها */
.requirements {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    margin-top: 30px;
}

.requirements h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: white;
}

.requirements p {
    font-size: 0.95rem;
    margin-bottom: 8px;
    opacity: 0.9;
    text-align: right;
}

.requirements p::before {
    content: '•';
    margin-left: 10px;
    color: var(--auth-success);
}

/* هشدارها */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: fadeIn 0.5s ease;
    border: 2px solid transparent;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.alert-success {
    background: rgba(76, 201, 240, 0.1);
    border-color: rgba(76, 201, 240, 0.3);
    color: var(--auth-success);
}

.alert-error {
    background: rgba(247, 37, 133, 0.1);
    border-color: rgba(247, 37, 133, 0.3);
    color: var(--auth-warning);
}

.alert i {
    font-size: 1.2rem;
}

/* نمایش قدرت رمز عبور */
.password-strength {
    margin-top: 10px;
}

.strength-meter {
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 5px;
}

.strength-bar {
    height: 100%;
    width: 0;
    border-radius: 3px;
    transition: all 0.3s ease;
}

.strength-text {
    font-size: 0.85rem;
    color: #666;
    margin-top: 5px;
    text-align: left;
}

/* ولیدیشن */
.is-invalid {
    border-color: var(--auth-warning) !important;
}

.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(247, 37, 133, 0.1) !important;
}

/* نمایش/مخفی کردن رمز عبور */
.password-input {
    position: relative;
}

.password-toggle {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

.password-toggle:hover {
    color: var(--auth-primary);
}

.password-input input {
    padding-left: 45px;
}

/* لودر */
.loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* لینک فراموشی رمز */
.forgot-password {
    text-align: left;
    margin-top: 10px;
}

.forgot-password a {
    font-size: 0.9rem;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.forgot-password a:hover {
    color: var(--auth-primary);
}

/* رسپانسیو */
@media (max-width: 992px) {
    .login-container {
        flex-direction: column;
        max-width: 500px;
    }
    
    .login-side, .register-side {
        order: -1;
        padding: 30px 20px;
    }
    
    .login-box {
        padding: 40px 30px;
    }
    
    .features {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 576px) {
    .login-header h1 {
        font-size: 2rem;
    }
    
    .side-content h2 {
        font-size: 1.8rem;
    }
    
    .login-box, .login-side, .register-side {
        padding: 30px 20px;
    }
    
    .features-list li {
        font-size: 1rem;
    }
}

@media (max-width: 400px) {
    .features {
        grid-template-columns: 1fr;
    }
    
    .feature {
        padding: 15px;
    }
}

/* انیمیشن موج */
.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120" preserveAspectRatio="none"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25"/><path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35,6.36,119.13-6.25,32.76-10.64,65.27-27.45,95.94-48.8,27.72-19.25,58.9-40.41,94.87-45.67,39.79-5.83,79.6,4.18,118.59,16.57,32.12,10.27,66.55,22.09,98.67,37.22,23.27,10.89,48.63,23.82,71.82,37.22,20.1,11.58,40.45,23.33,60.85,34.94,40.7,23.05,82.39,44.71,124.08,66.35,19.12,10.07,38.34,20.13,57.54,30.2V0Z" opacity=".5"/><path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z"/></svg>');
    background-size: 1200px 100px;
    animation: wave 12s linear infinite;
}

@keyframes wave {
    0% {
        background-position-x: 0;
    }
    100% {
        background-position-x: 1200px;
    }
}

/* دکمه بازگشت */
.back-button {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--auth-primary);
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

/* وضعیت سیستم */
.system-status {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(76, 175, 80, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0);
    }
}

/* ترم زبان */
.language-switcher {
    position: absolute;
    top: 20px;
    left: 20px;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-family: 'Peyda', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* پیش‌نمایش آواتار */
.avatar-preview {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 0 auto 20px;
    overflow: hidden;
    border: 3px solid #e0e0e0;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.avatar-preview:hover {
    border-color: var(--auth-primary);
    transform: scale(1.05);
}

.avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-preview .placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #666;
    font-size: 48px;
}

.avatar-upload {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
    padding: 5px;
    font-size: 0.8rem;
    opacity: 0;
    transition: all 0.3s ease;
}

.avatar-preview:hover .avatar-upload {
    opacity: 1;
}