/* ========================================
   نظام تسجيل الدخول - التصميم الكامل
   ======================================== */

/* متغيرات الألوان */
:root {
    --primary-dark: #1a3c5e;
    --primary-light: #2c5a8c;
    --primary-lighter: #e8f0f8;
    --success: #27ae60;
    --success-light: #d4edda;
    --error: #e74c3c;
    --error-light: #f8d7da;
    --warning: #f39c12;
    --gray-100: #f8f9fa;
    --gray-200: #ecf0f1;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
}

/* إعادة تعيين واستيراد الخطوط */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

body {
    font-family: 'Tajawal', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    direction: rtl;
    padding: 20px;
}

/* حاوية تسجيل الدخول */
.login-container {
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
}

/* بطاقة تسجيل الدخول */
.login-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    padding: 40px 30px;
    transition: transform 0.3s ease;
}

.login-card:hover {
    transform: translateY(-5px);
}

/* الشعار والعنوان */
.logo-container {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 15px;
}

.logo-container h1 {
    color: var(--primary-dark);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    color: var(--gray-600);
    font-size: 14px;
}

/* نماذج الإدخال */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--gray-700);
    font-weight: 500;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--gray-300);
    border-radius: 8px;
    font-size: 16px;
    font-family: 'Tajawal', sans-serif;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(44, 90, 140, 0.1);
}

.form-control::placeholder {
    color: var(--gray-500);
    font-size: 14px;
}

/* مجموعة checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: normal;
    margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
    margin-left: 8px;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    color: var(--gray-700);
    font-size: 14px;
}

/* أزرار */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Tajawal', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary-dark);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(26, 60, 94, 0.3);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary-dark);
    color: var(--primary-dark);
}

.btn-outline:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-block {
    width: 100%;
}

/* التنبيهات */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.alert-error {
    background: var(--error-light);
    color: var(--error);
    border-right: 4px solid var(--error);
}

.alert-success {
    background: var(--success-light);
    color: var(--success);
    border-right: 4px solid var(--success);
}

.alert-info {
    background: var(--primary-lighter);
    color: var(--primary-dark);
    border-right: 4px solid var(--primary-dark);
}

/* حاوية OTP */
.otp-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-top: 10px;
    flex-wrap: wrap;
}

.otp-input {
    width: 60px;
    height: 60px;
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    font-family: 'Tajawal', monospace;
    border: 2px solid var(--gray-300);
    border-radius: 12px;
    background: white;
    transition: all 0.2s ease;
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(26, 60, 94, 0.1);
    transform: scale(1.05);
}

.otp-input:disabled {
    background: var(--gray-200);
    cursor: not-allowed;
}

/* عداد الوقت */
.timer-container {
    text-align: center;
    margin: 25px 0;
}

.timer-label {
    font-size: 12px;
    color: var(--gray-600);
    margin-bottom: 5px;
}

.timer {
    font-size: 32px;
    font-weight: 700;
    font-family: monospace;
    color: var(--primary-dark);
    background: var(--primary-lighter);
    display: inline-block;
    padding: 8px 20px;
    border-radius: 50px;
    letter-spacing: 2px;
}

.timer-warning {
    color: var(--warning);
    background: #fff3e0;
}

.timer-expired {
    color: var(--error);
    background: var(--error-light);
}

/* حاوية إعادة الإرسال */
.resend-container {
    text-align: center;
    margin-top: 20px;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    background: var(--primary-dark);
    color: white;
    padding: 20px;
    text-align: center;
}

.modal-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
}

.modal-header p {
    font-size: 14px;
    opacity: 0.9;
}

.modal-body {
    padding: 30px;
}

.method-detail {
    display: block;
    font-size: 11px;
    color: var(--gray-500);
    margin-top: 5px;
    font-weight: normal;
}

/* استجابة للشاشات الصغيرة */
@media (max-width: 768px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .otp-input {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .otp-container {
        gap: 8px;
    }
    
    .timer {
        font-size: 24px;
        padding: 6px 16px;
    }
}

@media (max-width: 480px) {
    .otp-input {
        width: 40px;
        height: 40px;
        font-size: 18px;
    }
    
    .otp-container {
        gap: 6px;
    }
    
    .login-card h1 {
        font-size: 24px;
    }
}

/* reCAPTCHA تنسيق */
.g-recaptcha {
    display: flex;
    justify-content: center;
    transform: scale(0.95);
    transform-origin: center;
}

@media (max-width: 480px) {
    .g-recaptcha {
        transform: scale(0.85);
    }
}

/* تأثيرات إضافية */
.btn:active {
    transform: translateY(0);
}

.form-control.error {
    border-color: var(--error);
}

.form-control.success {
    border-color: var(--success);
}

/* شريط التحميل */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-top-color: var(--primary-dark);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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


/* تنسيق البيانات المقنعة */
.method-detail {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 5px;
    font-family: monospace;
    letter-spacing: 1px;
    direction: ltr; /* للأرقام والايميلات */
    text-align: center;
}

/* إضافة تأثير بسيط للبيانات المقنعة */
.method-detail::before {
    content: "🔒 ";
    font-size: 10px;
    opacity: 0.7;
}