/*
 * login.css
 * يعتمد متغيرات الألوان من theme.css (وضع فاتح/داكن).
 */

/*
 * لا استيراد خطوط خارجية — سياسة المحتوى تحجبه ويسجّل خطأً في الكونسول.
 * خط Cairo مرفق محلياً ويُعرَّف في fonts.css.
 */

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Cairo', 'Tajawal', Tahoma, sans-serif;
    direction: rtl;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    color: var(--text-main);
    background:
        radial-gradient(circle at 15% 20%, rgba(2, 132, 199, 0.35) 0%, transparent 45%),
        radial-gradient(circle at 85% 80%, rgba(24, 138, 89, 0.35) 0%, transparent 45%),
        linear-gradient(135deg, #073b24 0%, #0d5c3a 45%, #0c4a6e 100%);
    position: relative;
    overflow: hidden;
}

/* قطرات المطر - لمسة خريف ظفار */
body::before,
body::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle, rgba(255,255,255,0.16) 1px, transparent 1.5px),
        radial-gradient(circle, rgba(255,255,255,0.10) 1px, transparent 1.5px);
    background-size: 90px 90px, 140px 140px;
    background-position: 0 0, 45px 45px;
    animation: drift 22s linear infinite;
    pointer-events: none;
}
body::after { animation-duration: 34s; opacity: 0.6; }

@keyframes drift {
    from { transform: translateY(-140px); }
    to   { transform: translateY(0); }
}

.login-shell {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 960px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--card-solid);
    color: var(--text-main);
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 30px 70px rgba(3, 30, 20, 0.45);
}

/* الجانب التعريفي */
.login-brand {
    background: linear-gradient(160deg, var(--sidebar-from) 0%, var(--sidebar-to) 100%);
    color: var(--on-dark);
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.brand-logos {
    display: flex;
    gap: 14px;
    margin-bottom: 8px;
}

/* الشعارات بحدودها الطبيعية — بلا إطار دائري ولا خلفية */
.brand-logo {
    width: 72px;
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; }

.login-brand h1 { font-size: 24px; font-weight: 800; line-height: 1.45; }
.login-brand p  { font-size: 13.5px; color: rgba(255, 255, 255, 0.75); line-height: 1.9; }

.brand-features {
    list-style: none;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.brand-features li {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-features li span {
    width: 26px; height: 26px;
    border-radius: 8px;
    background: rgba(56, 189, 248, 0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 13px;
}

.season-tag {
    margin-top: 14px;
    align-self: flex-start;
    background: rgba(56, 189, 248, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #bae6fd;
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
}

/* نموذج الدخول */
.login-form-side {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.login-form-side h2 { font-size: 22px; font-weight: 800; margin-bottom: 6px; }
.login-form-side .sub { font-size: 13px; color: var(--text-muted); margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 8px;
}
.form-group input {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    transition: all 0.25s ease;
    background: var(--bg-subtle);
    color: var(--text-main);
}
.form-group input:focus {
    outline: none;
    border-color: var(--primary-light);
    background: var(--card-solid);
    box-shadow: 0 0 0 4px rgba(24, 138, 89, 0.12);
}

.btn-login {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
    color: var(--on-brand);
    font-family: inherit;
    font-size: 15.5px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.25s ease;
    margin-top: 6px;
}
.btn-login:hover {
    box-shadow: 0 10px 24px rgba(13, 92, 58, 0.3);
    filter: brightness(1.06);
}

.alert {
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 700;
    margin-bottom: 18px;
}
.alert-danger  { background: var(--danger-bg);  border: 1px solid rgba(239, 68, 68, 0.35); color: var(--danger-text); }
.alert-success { background: var(--success-bg); border: 1px solid rgba(34, 197, 94, 0.35); color: var(--success-text); }
.alert-warning { background: var(--warning-bg); border: 1px solid rgba(234, 179, 8, 0.35); color: var(--warning-text); }
.alert-info    { background: var(--info-bg);    border: 1px solid rgba(56, 189, 248, 0.35); color: var(--info-text); }

.login-help {
    margin-top: 22px;
    text-align: center;
    font-size: 12.5px;
    color: var(--text-muted);
    line-height: 1.9;
}

.install-link {
    display: block;
    text-align: center;
    margin-top: 18px;
    font-size: 12.5px;
    color: var(--text-muted);
    text-decoration: none;
}
.install-link:hover { color: var(--primary); }

@media (max-width: 860px) {
    .login-shell { grid-template-columns: 1fr; max-width: 460px; }
    .login-brand { padding: 32px 28px; }
    .login-brand .brand-features, .login-brand p { display: none; }
    .login-form-side { padding: 32px 28px; }
}

/* ==========================================================================
   الوضع الداكن لصفحة الدخول
   ========================================================================== */

:root[data-theme="dark"] body {
    background: linear-gradient(135deg, #04120c 0%, #071a12 45%, #061826 100%);
}

:root[data-theme="dark"] .login-shell {
    background: var(--card-solid);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
}

:root[data-theme="dark"] .login-form-side {
    background: var(--card-solid);
}

:root[data-theme="dark"] .form-group input {
    background: var(--bg-subtle);
    color: var(--text-main);
    border-color: var(--border-strong);
}

:root[data-theme="dark"] .form-group input::placeholder {
    color: rgba(148, 166, 189, 0.65);
}
