/* صفحات التسجيل وتسجيل الدخول */
/* ================================= */

.auth-body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    font-family: 'Tajawal', sans-serif;
    overflow-x: hidden;
}

.auth-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
}

.auth-particles {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 200, 255, 0.3) 0%, transparent 50%);
    animation: particleMove 20s ease-in-out infinite alternate;
}

@keyframes particleMove {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-20px, -20px) rotate(5deg); }
}

.auth-container {
    position: relative;
    z-index: 2;
    padding: 2rem 0;
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 24px;
    padding: 3rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    animation: slideInUp 0.6s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    margin-bottom: 2.5rem;
}

.auth-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.auth-title {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.auth-subtitle {
    color: #718096;
    font-size: 1rem;
    margin-bottom: 0;
}

/* طرق التسجيل */
.auth-methods {
    margin-bottom: 2rem;
}

.method-tabs {
    display: flex;
    background: #f7fafc;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.method-tab {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 8px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #718096;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.method-tab.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.method-tab:hover {
    color: var(--primary-color);
}

.method-tab i {
    font-size: 1.2rem;
}

/* طرق التسجيل */
.auth-method {
    display: none;
}

.auth-method.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* الحقول */
.form-label {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.input-group {
    margin-bottom: 0;
}

.input-group-text {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-left: none;
    color: #718096;
    font-size: 1rem;
}

[dir="rtl"] .input-group-text {
    border-left: 2px solid #e2e8f0;
    border-right: none;
}

.form-control {
    border: 2px solid #e2e8f0;
    border-radius: 0 12px 12px 0;
    padding: 12px 16px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

[dir="rtl"] .form-control {
    border-radius: 12px 0 0 12px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    background: white;
}

.form-select {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    transition: all 0.3s ease;
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* قوة كلمة المرور */
.password-strength {
    margin-top: 0.5rem;
}

.strength-meter {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.25rem;
}

.strength-bar {
    height: 100%;
    background: #e53e3e;
    border-radius: 2px;
    transition: all 0.3s ease;
    width: 0%;
}

.strength-bar.weak {
    background: #e53e3e;
    width: 25%;
}

.strength-bar.fair {
    background: #f56500;
    width: 50%;
}

.strength-bar.good {
    background: #38a169;
    width: 75%;
}

.strength-bar.strong {
    background: #22543d;
    width: 100%;
}

.strength-text {
    font-size: 0.8rem;
    color: #718096;
}

/* رمز التحقق */
.otp-inputs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.otp-input {
    width: 50px;
    height: 50px;
    text-align: center;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.otp-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.otp-input.filled {
    border-color: var(--success-color);
    background: rgba(72, 187, 120, 0.1);
}

/* رفع الصورة الشخصية */
.profile-upload {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.upload-preview {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.upload-preview:hover {
    transform: scale(1.05);
}

.upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.upload-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 0.8rem;
    text-align: center;
}

.upload-preview:hover .upload-overlay {
    opacity: 1;
}

.upload-overlay i {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

/* أزرار التسجيل السريع */
.quick-login {
    margin-bottom: 2rem;
}

.btn-google {
    background: #4285f4;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
}

.btn-google:hover {
    background: #3367d6;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(66, 133, 244, 0.4);
}

.divider {
    text-align: center;
    position: relative;
    margin: 1.5rem 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #e2e8f0;
}

.divider span {
    background: white;
    padding: 0 1rem;
    color: #718096;
    font-size: 0.9rem;
}

/* مبدل تسجيل الدخول */
.login-toggle {
    margin-bottom: 1.5rem;
}

.login-toggle .btn-group {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
}

.login-toggle .btn {
    border: none;
    padding: 12px 16px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.login-toggle .btn-check:checked + .btn {
    background: var(--primary-color);
    color: white !important;
    text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* أزرار الإرسال */
.btn-text,
.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: flex;
}

/* روابط التسجيل */
.auth-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.auth-link:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.auth-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 1.5rem;
    margin-top: 2rem;
}

/* النماذج المودال */
.modal-content {
    border: none;
    border-radius: 20px;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
}

.modal-body {
    padding: 2rem;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem 2rem;
}

/* رسوم النجاح */
.success-animation {
    text-align: center;
    margin-bottom: 1.5rem;
}

.success-animation i {
    font-size: 4rem;
    animation: checkmarkScale 0.6s ease-out;
}

@keyframes checkmarkScale {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.countdown {
    font-size: 0.9rem;
    color: #718096;
    margin-top: 1rem;
}

/* الاستجابة للجوال */
@media (max-width: 768px) {
    .auth-card {
        margin: 1rem;
        padding: 2rem;
        border-radius: 16px;
    }
    
    .auth-title {
        font-size: 1.75rem;
    }
    
    .method-tab {
        font-size: 0.8rem;
        padding: 10px 6px;
    }
    
    .method-tab i {
        font-size: 1rem;
    }
    
    .otp-inputs {
        gap: 0.25rem;
    }
    
    .otp-input {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .upload-preview {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 576px) {
    .auth-container {
        padding: 1rem 0;
    }
    
    .auth-card {
        margin: 0.5rem;
        padding: 1.5rem;
    }
    
    .method-tabs {
        flex-direction: column;
        gap: 2px;
    }
    
    .method-tab {
        flex-direction: row;
        justify-content: center;
        gap: 0.5rem;
    }
}

/* مظهر داكن للنماذج */
@media (prefers-color-scheme: dark) {
    .auth-card {
        background: rgba(45, 55, 72, 0.95);
        color: #e2e8f0;
    }
    
    .auth-title {
        color: #e2e8f0;
    }
    
    .form-label {
        color: #e2e8f0;
    }
    
    .form-control,
    .form-select {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .form-control:focus,
    .form-select:focus {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .input-group-text {
        background: #4a5568;
        border-color: #4a5568;
        color: #a0aec0;
    }
    
    .method-tabs {
        background: #4a5568;
    }
    
    .method-tab.active {
        background: #2d3748;
    }
}

/* أزرار التحميل */
.btn.loading {
    position: relative;
    pointer-events: none;
}

.btn-loading {
    display: none;
    align-items: center;
    justify-content: center;
}

.btn.loading .btn-text {
    opacity: 0;
}

.btn.loading .btn-loading {
    display: flex;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* رسائل التحميل */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.loading-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    text-align: center;
    max-width: 300px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.loading-spinner-large {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-radius: 50%;
    border-top-color: #667eea;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

.loading-text {
    color: #333;
    font-weight: 500;
    margin: 0;
}