/**
 * تنسيقات صفحات المصادقة (تسجيل الدخول والتسجيل)
 * Authentication Pages Styles
 */

.auth-page {
    padding: 60px 0;
    min-height: calc(100vh - 300px);
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
}

.auth-page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="50" cy="50" r="40" fill="rgba(255,255,255,0.05)"/></svg>') repeat;
    opacity: 0.1;
}

.auth-container {
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.5s ease;
}

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

/* شعار الصفحة */
.auth-logo {
    text-align: center;
    margin-bottom: 30px;
}

.auth-logo i {
    font-size: 50px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 15px;
    display: inline-block;
}

.auth-logo h2 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 8px;
    font-weight: 700;
}

.auth-logo p {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
}

/* رسائل التنبيه */
.alert {
    padding: 15px 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.alert i {
    font-size: 18px;
}

.alert-error {
    background: #fee;
    color: #c33;
    border: 1px solid #fcc;
}

.alert-success {
    background: #efe;
    color: #2a2;
    border: 1px solid #cfc;
}

/* النموذج */
.auth-form {
    margin-bottom: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-label i {
    color: #667eea;
    font-size: 16px;
}

.form-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e0e6ed;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    font-family: inherit;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-input::placeholder {
    color: #a0a6ab;
}

/* خيارات النموذج */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    font-size: 14px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

.checkbox-label span {
    color: #555;
}

.forgot-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.forgot-link:hover {
    color: #764ba2;
}

/* checkbox للشروط */
.form-checkbox {
    margin-bottom: 25px;
}

.form-checkbox .checkbox-label {
    font-size: 14px;
    color: #555;
}

.form-checkbox a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.form-checkbox a:hover {
    text-decoration: underline;
}

/* الأزرار */
.btn {
    padding: 14px 30px;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-full {
    width: 100%;
}

/* تذييل الصفحة */
.auth-footer {
    text-align: center;
    padding-top: 25px;
    border-top: 1px solid #e0e6ed;
    margin-top: 25px;
}

.auth-footer p {
    color: #7f8c8d;
    font-size: 15px;
    margin: 0;
}

.auth-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* تأثيرات إضافية */
.form-input:invalid:not(:placeholder-shown) {
    border-color: #e74c3c;
}

.form-input:valid:not(:placeholder-shown) {
    border-color: #27ae60;
}

/* تحسينات التصميم المتجاوب */
@media (max-width: 768px) {
    .auth-page {
        padding: 30px 0;
    }
    
    .auth-card {
        padding: 30px 20px;
        border-radius: 15px;
        margin: 0 15px;
    }
    
    .auth-logo i {
        font-size: 40px;
    }
    
    .auth-logo h2 {
        font-size: 24px;
    }
    
    .form-input {
        padding: 12px 15px;
    }
    
    .btn {
        padding: 12px 25px;
    }
    
    .form-options {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .auth-card {
        padding: 25px 15px;
    }
    
    .auth-logo h2 {
        font-size: 22px;
    }
    
    .form-label {
        font-size: 13px;
    }
    
    .form-input {
        font-size: 14px;
    }
}

/* تحميل (Loading) */
.btn.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* تحسينات إضافية */
.auth-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.auth-card:hover::before {
    opacity: 0.1;
}

/* مؤشر قوة كلمة المرور */
.password-strength {
    margin-top: 8px;
    height: 4px;
    background: #e0e6ed;
    border-radius: 2px;
    overflow: hidden;
    display: none;
}

.password-strength.active {
    display: block;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
}

.password-strength.weak .password-strength-bar {
    width: 33%;
    background: #e74c3c;
}

.password-strength.medium .password-strength-bar {
    width: 66%;
    background: #f39c12;
}

.password-strength.strong .password-strength-bar {
    width: 100%;
    background: #27ae60;
}

/* رسالة المساعدة */
.form-help {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-help i {
    font-size: 10px;
}

/* تحسينات الوصولية */
.form-input:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.3);
    outline-offset: 2px;
}

.btn:focus-visible {
    outline: 3px solid rgba(102, 126, 234, 0.5);
    outline-offset: 2px;
}
