/* =========================================
   1. الخطوط والمتغيرات
   ========================================= */

@font-face {
    font-family: 'KOSans';
    src: url('../fonts/KOSans/KOSans-Regular.otf') format('opentype');
    font-weight: 400;
}

@font-face {
    font-family: 'KOSans';
    src: url('../fonts/KOSans/KOSans-Bold.otf') format('opentype');
    font-weight: 700;
}

:root {
    --primary-color: #316595;
    --primary-hover: #264d73;
    --accent-color: #d63638;

    /* ألوان الزجاج */
    --glass-bg: rgba(255, 255, 255, 0.70);
    --glass-border: rgba(255, 255, 255, 0.9);
    --glass-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);

    --bg-light: #f3f5f9;
}

/* =========================================
   2. الخلفية والهيكل العام
   ========================================= */

body.login {
    background-color: var(--bg-light);
    background-image:
        radial-gradient(circle at 10% 10%, rgba(49, 101, 149, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(49, 101, 149, 0.05) 0%, transparent 40%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'KOSans', sans-serif;
    min-height: 100vh;
    height: auto;
    /* مهم للتجاوب */
    padding: 20px;
    box-sizing: border-box;
}

/* الكرة الزجاجية الخلفية */
body.login::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -60%);
    width: 60vh;
    /* استخدام وحدات نسبية */
    height: 60vh;
    background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
    border-radius: 50%;
    z-index: -1;
    opacity: 0.6;
}

/* =========================================
   3. الشعار والرسالة الترحيبية
   ========================================= */

/* تعريف الحركات */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }
}

/* الشعار مع Animation */
body.login div#login h1 a {
    background-image: url('../images/logo-login.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
    width: 250px;
    height: 70px;
    margin: 0 auto 20px auto;
    /* Animation */
    animation: fadeInDown 0.8s ease-out forwards;
}

/* Hover effect للشعار */
body.login div#login h1 a:hover {
    animation: pulse 0.5s ease-in-out;
}

/* الرسالة الترحيبية مع Animation */
.alborsagia-welcome {
    text-align: center;
    color: #444;
    font-size: 16px;
    font-weight: 400;
    margin-bottom: 25px;
    line-height: 1.6;
    /* Animation */
    animation: fadeInDown 0.8s ease-out 0.2s forwards;
    opacity: 0;
}

.alborsagia-welcome strong {
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 700;
    display: block;
    margin-top: 5px;
}

/* =========================================
   4. بطاقة الدخول
   ========================================= */

body.login div#login {
    width: 100%;
    max-width: 420px;
    padding: 0;
    /* إزالة البادينغ الافتراضي */
}

.login form {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-top: 1px solid #fff;
    border-left: 1px solid #fff;
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
    padding: 40px 35px;
    margin-top: 0;
    width: 100%;
    /* ضمان العرض الكامل */
    box-sizing: border-box;
    /* احتواء البادينغ داخل العرض */
    /* Animation */
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
    opacity: 0;
}

/* =========================================
   5. الحقول والأزرار
   ========================================= */

.login label {
    color: #555;
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 8px;
    display: block;
}

.login input[type="text"],
.login input[type="password"] {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e1e5ea;
    border-radius: 12px;
    height: 50px;
    font-size: 16px;
    /* 16px يمنع التكبير التلقائي في آيفون */
    padding: 0 20px;
    width: 100%;
    margin-bottom: 20px;
    color: #333;
    transition: all 0.3s;
    box-sizing: border-box;
}

.login input[type="text"]:focus,
.login input[type="password"]:focus {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(49, 101, 149, 0.1);
    outline: none;
}

.wp-core-ui .button-primary {
    background: var(--primary-color);
    border: none;
    color: #fff;
    height: 50px;
    border-radius: 12px;
    width: 100%;
    font-size: 16px;
    font-weight: 700;
    margin-top: 10px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(49, 101, 149, 0.25);
    transition: all 0.3s;
}

.wp-core-ui .button-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

/* =========================================
   6. العناصر الإضافية
   ========================================= */

.login .forgetmenot {
    float: none;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.login .forgetmenot input[type="checkbox"] {
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    height: 20px;
    width: 20px;
    margin-left: 10px;
}

.login .forgetmenot input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.login #nav,
.login #backtoblog {
    padding: 0;
    margin-top: 25px;
    text-align: center;
}

.login #nav a,
.login #backtoblog a {
    color: #8898aa;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.3s;
}

.login #nav a:hover {
    color: var(--primary-color);
}

/* رسائل التنبيه */
.login #login_error,
.login .message {
    border-radius: 12px;
    border-right: 4px solid var(--accent-color);
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
    padding: 15px;
    color: #333;
    width: 100%;
    box-sizing: border-box;
}


/* =========================================
   7. إصلاحات الهاتف (Mobile Responsiveness)
   ========================================= */

@media screen and (max-width: 500px) {
    body.login {
        display: block;
        /* إلغاء التوسيط العمودي للسماح بالتمرير */
        padding: 30px 15px;
        height: auto;
        min-height: 100%;
    }

    /* إصلاح موضع الكرة الخلفية في الموبايل */
    body.login::before {
        width: 100%;
        height: 300px;
        top: 0;
        left: 0;
        transform: none;
        border-radius: 0 0 50% 50%;
        /* نصف دائرة علوية */
    }

    body.login div#login {
        margin: 20px auto 0;
        padding: 0;
        width: 100%;
    }

    body.login div#login h1 a {
        width: 200px;
        height: 60px;
        margin-bottom: 20px;
    }

    .login form {
        padding: 30px 20px;
        /* تقليل الحواف الداخلية */
        margin-bottom: 30px;
        /* مسافة أسفل البطاقة للتمرير */
    }

    .alborsagia-welcome {
        font-size: 15px;
        padding: 0 10px;
    }

    .alborsagia-welcome strong {
        font-size: 17px;
    }

    /* تحسين زر الدخول للموبايل */
    .wp-core-ui .button-primary {
        margin-bottom: 10px;
    }

    /* الروابط السفلية */
    .login #nav,
    .login #backtoblog {
        margin-top: 15px;
    }
}