/* =========================================
   تنسيقات لوحة تحكم المركز (CPanel Auth) - Responsive
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;800;900&display=swap');

:root {
    --primary: #0056b3;
    --primary-dark: #004494;
    --secondary: #c5a059;
    --bg-light: #f4f6f9;
    --text-dark: #333;
    --text-light: #6c757d;
    --border: #ddd;
}

@media (max-width: 768px) {
    body { align-items: flex-start; padding-block: 20px; min-width: 320px; }
    .auth-container { padding: 12px; }
    .auth-box { max-width: 100%; padding: 30px 20px; border-radius: 12px; }
    .modal { padding: 10px; }
    .modal-content { max-height: calc(100dvh - 20px); overflow-y: auto; padding: 24px 16px; }
    input, select, textarea { font-size: 16px !important; }
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Cairo', sans-serif; }

body { 
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%); 
    min-height: 100vh; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    overflow-x: hidden; 
}

/* Comment translated to English. */
.auth-container { 
    width: 100%; 
    padding: 20px; 
    display: flex; 
    justify-content: center; 
}

.auth-box { 
    background: #fff; 
    width: 100%; 
    max-width: 420px; 
    padding: 40px; 
    border-radius: 15px; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.3); 
    text-align: center; 
    animation: slideUp 0.5s ease; 
}

/* Comment translated to English. */
.auth-logo { width: 85px; margin-bottom: 15px; }
.auth-header h2 { color: var(--primary); font-size: 1.5rem; font-weight: 900; margin-bottom: 5px; }
.auth-header p { color: var(--text-light); font-size: 0.95rem; margin-bottom: 30px; font-weight: 600;}

/* Comment translated to English. */
.input-group { text-align: right; margin-bottom: 20px; }
.input-group label { display: block; font-weight: 800; color: var(--text-dark); margin-bottom: 8px; font-size: 0.95rem; }

.input-icon { position: relative; display: flex; align-items: center; }
.input-icon i { position: absolute; right: 15px; color: var(--text-light); font-size: 1.1rem; }
.input-icon input { 
    width: 100%; padding: 12px 15px 12px 40px; padding-right: 45px; 
    border: 1px solid var(--border); border-radius: 8px; 
    font-family: inherit; font-size: 1rem; transition: 0.3s; 
    background: #f8f9fa; outline: none; font-weight: 600;
}
.input-icon input:focus { border-color: var(--primary); background: #fff; box-shadow: 0 0 0 4px rgba(0, 86, 179, 0.1); }

.captcha-group { margin-bottom: 18px; }
.captcha-row { display: flex; align-items: stretch; gap: 10px; margin-bottom: 10px; }
.captcha-question {
    flex: 1;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed #9fb5ca;
    border-radius: 8px;
    background: #eef5fb;
    color: var(--primary-dark);
    font-size: 1.15rem;
    font-weight: 900;
    letter-spacing: 1px;
}
.captcha-refresh {
    width: 48px;
    min-height: 48px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    font-size: 1rem;
}
.captcha-refresh:hover { background: #eef5fb; }
.captcha-refresh:focus-visible,
.captcha-answer:focus-visible { outline: 3px solid rgba(0, 86, 179, 0.25); outline-offset: 2px; }
.captcha-refresh:disabled { cursor: wait; opacity: 0.6; }
.captcha-answer {
    width: 100%;
    min-height: 48px;
    padding: 11px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #f8f9fa;
    color: var(--text-dark);
    font: 700 1rem 'Cairo', sans-serif;
    text-align: center;
}
.captcha-answer:focus { border-color: var(--primary); background: #fff; }
.captcha-help { display: block; margin-top: 6px; color: var(--text-light); font-size: 0.78rem; }
.btn-primary:disabled { cursor: not-allowed; opacity: 0.7; transform: none; box-shadow: none; }

/* Comment translated to English. */
.auth-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; font-size: 0.9rem; }
.remember { display: flex; align-items: center; gap: 8px; color: var(--text-dark); font-weight: 700; cursor: pointer; }
.auth-actions a { color: var(--primary); text-decoration: none; font-weight: 800; transition: 0.3s; }
.auth-actions a:hover { color: var(--secondary); }

.btn-primary { 
    width: 100%; padding: 14px; border: none; border-radius: 8px; 
    font-family: inherit; font-size: 1.1rem; font-weight: 900; 
    cursor: pointer; transition: 0.3s; display: flex; align-items: center; justify-content: center; gap: 10px; 
    background: var(--primary); color: #fff; 
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0, 86, 179, 0.3);}

/* Comment translated to English. */
.back-home-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: var(--text-light);
    text-decoration: none;
    font-weight: 800;
    font-size: 0.95rem;
    transition: 0.3s;
    width: 100%;
}
.back-home-link:hover {
    color: var(--primary);
    transform: translateY(-2px);
}

/* Comment translated to English. */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 1000; align-items: center; justify-content: center; padding: 20px; }
.modal-content { background: #fff; width: 100%; max-width: 400px; padding: 30px; border-radius: 12px; position: relative; animation: slideUp 0.3s ease; box-shadow: 0 10px 30px rgba(0,0,0,0.2); text-align: center;}
.close-modal { position: absolute; top: 15px; left: 15px; font-size: 1.5rem; cursor: pointer; color: var(--text-light); transition: 0.3s; background: none; border: none; }
.close-modal:hover { color: #dc3545; }
.modal-title { color: var(--primary); margin-bottom: 10px; font-size: 1.4rem;}
.modal-desc { color: var(--text-light); font-size: 0.95rem; margin-bottom: 20px; line-height: 1.5;}
.full-input { width: 100%; padding: 12px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; font-size: 1rem; outline: none; margin-bottom: 15px; font-weight: 600;}
.full-input:focus { border-color: var(--primary); }
.full-width-btn { width: 100%; }

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

/* Comment translated to English. */
@media (max-width: 480px) {
    .auth-box { padding: 30px 20px; }
    .auth-header h2 { font-size: 1.3rem; }
    .btn-primary { font-size: 1rem; padding: 12px; }
    .auth-actions { flex-direction: column; gap: 15px; }
    .captcha-question { font-size: 1.05rem; }
}

@media (max-width: 768px) {
    body { align-items: flex-start; padding-block: 20px; min-width: 320px; }
    .auth-container { padding: 12px; }
    .auth-box { max-width: 100%; padding: 30px 20px; border-radius: 12px; }
    .modal { padding: 10px; }
    .modal-content { max-height: calc(100dvh - 20px); overflow-y: auto; padding: 24px 16px; }
    input, select, textarea { font-size: 16px !important; }
}


/* CSP hardening: migrated from inline <style>. */
/* تنسيق بسيط لزر العين ورسالة الخطأ إذا لم تكن موجودة في cpanel.css */
        .password-container { position: relative; }
        #togglePassBtn {
            position: absolute;
            left: 10px; /* مكان العين على اليسار */
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            cursor: pointer;
            color: #666;
        }
        #loginMsg {
            background-color: #ffebee;
            color: #c62828;
            padding: 10px;
            border-radius: 5px;
            margin-bottom: 15px;
            font-size: 14px;
            text-align: center;
        }
