/* واجهة تسجيل الدخول - نمط داكن فاخر مع لوحات زجاجية */
.login-page {
    --gold: #d4af6a;
    --gold-soft: #b8935a;
    --ink: #11161b;
    --text: #e8ecef;
    --muted: #8b97a1;
    position: relative;
    min-height: 100vh;
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    color: var(--text);
    background:
        radial-gradient(ellipse 60% 50% at 50% 35%, rgba(70, 92, 112, 0.35), transparent 70%),
        radial-gradient(ellipse 40% 40% at 10% 90%, rgba(212, 175, 106, 0.07), transparent 70%),
        linear-gradient(160deg, #1d252c 0%, #141a20 55%, #0e1216 100%);
}

/* خطوط الدوائر الإلكترونية الخلفية */
.login-page::before,
.login-page::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 34%;
    opacity: 0.5;
    pointer-events: none;
    background-repeat: no-repeat;
    background-size: cover;
}

.login-page::before {
    left: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 800' fill='none' stroke='%23788896' stroke-width='1.2' stroke-opacity='0.35'><path d='M0 120h120l40 40h120'/><path d='M0 200h90l50 50h160l30 30'/><path d='M0 330h150l40-40h110'/><path d='M0 430h70l60 60h200'/><path d='M0 560h130l40 40h150l40 40'/><path d='M0 660h100l50-50h140'/><circle cx='280' cy='160' r='4' fill='%23a9b7c3' stroke='none'/><circle cx='300' cy='280' r='4' fill='%23a9b7c3' stroke='none'/><circle cx='300' cy='290' r='3' fill='%23a9b7c3' stroke='none'/><circle cx='330' cy='490' r='4' fill='%23a9b7c3' stroke='none'/><circle cx='320' cy='640' r='4' fill='%23a9b7c3' stroke='none'/><circle cx='290' cy='610' r='3' fill='%23a9b7c3' stroke='none'/></svg>");
    background-position: left center;
}

.login-page::after {
    right: 0;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 800' fill='none' stroke='%23788896' stroke-width='1.2' stroke-opacity='0.35'><path d='M400 100h-120l-40 40h-120'/><path d='M400 210h-90l-50 50h-160l-30 30'/><path d='M400 320h-150l-40-40h-110'/><path d='M400 450h-70l-60 60h-200'/><path d='M400 570h-130l-40 40h-150l-40 40'/><path d='M400 690h-100l-50-50h-140'/><circle cx='120' cy='140' r='4' fill='%23a9b7c3' stroke='none'/><circle cx='100' cy='260' r='4' fill='%23a9b7c3' stroke='none'/><circle cx='130' cy='290' r='3' fill='%23a9b7c3' stroke='none'/><circle cx='130' cy='510' r='4' fill='%23a9b7c3' stroke='none'/><circle cx='110' cy='610' r='4' fill='%23a9b7c3' stroke='none'/></svg>");
    background-position: right center;
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 780px;
}

/* الشعار العلوي */
.login-logo-outside {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-logo-outside img,
.login-brand img {
    display: block;
    height: auto;
    margin: 0 auto;
    filter: hue-rotate(195deg) saturate(0.95) brightness(1.15) drop-shadow(0 6px 14px rgba(0, 0, 0, 0.35));
}

.login-logo-outside img {
    width: 100%;
    max-width: 190px;
}

/* البطاقة الزجاجية */
.login-card {
    display: flex;
    align-items: center;
    gap: 0;
    border-radius: 18px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.12);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    backdrop-filter: blur(18px) saturate(120%);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.45),
        0 0 80px rgba(120, 160, 190, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

/* لوحة العلامة التجارية (الجانب الأيسر) */
.login-brand {
    flex: 0 0 40%;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1rem;
    padding: 1.25rem;
    border-radius: 14px;
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 10px 24px rgba(0, 0, 0, 0.25);
}

.login-brand img {
    width: 100%;
    max-width: 200px;
}

/* نموذج الدخول (الجانب الأيمن) */
.login-page .login-form {
    flex: 1;
    min-width: 0;
    padding: 2rem 1.75rem;
    background: rgba(22, 28, 34, 0.55);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    margin: -0.5rem 0;
}

.login-page .logo {
    margin-bottom: 1.5rem;
}

.login-page .logo .logo-text {
    color: var(--gold);
    font-size: 1.7rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 12px rgba(212, 175, 106, 0.25);
}

.login-page .form-group {
    margin-bottom: 1.1rem;
}

.login-page .form-group > label:not(.checkbox-label) {
    display: block;
    margin-bottom: 0.45rem;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 500;
}

.input-wrap {
    position: relative;
}

.input-wrap .input-icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 14px;
    width: 18px;
    height: 18px;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
    transition: color 0.2s;
}

.login-page .input-wrap input {
    width: 100%;
    box-sizing: border-box;
    padding: 0.8rem 2.7rem 0.8rem 1rem;
    color: var(--text);
    font-size: 0.95rem;
    background: rgba(10, 14, 18, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.login-page .input-wrap input::placeholder {
    color: var(--muted);
}

.login-page .input-wrap input:focus {
    border-color: var(--gold);
    background: rgba(10, 14, 18, 0.75);
    box-shadow: 0 0 0 3px rgba(212, 175, 106, 0.18);
}

.login-page .input-wrap:focus-within .input-icon {
    color: var(--gold);
}

/* منع لون الإكمال التلقائي الفاتح */
.login-page .input-wrap input:-webkit-autofill {
    -webkit-text-fill-color: var(--text);
    -webkit-box-shadow: 0 0 0 100px #12181d inset;
    caret-color: var(--text);
}

/* خانة تذكرني */
.login-page .checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--text);
    font-size: 0.9rem;
    cursor: pointer;
}

.login-page .checkbox-label .checkmark {
    display: none;
}

.login-page .checkbox-label input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    margin: 0;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(10, 14, 18, 0.55);
    display: grid;
    place-content: center;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.login-page .checkbox-label input[type="checkbox"]::after {
    content: "";
    width: 9px;
    height: 5px;
    border: solid #1a1a1a;
    border-width: 0 0 2px 2px;
    transform: rotate(-45deg) translate(1px, -1px);
    opacity: 0;
}

.login-page .checkbox-label input[type="checkbox"]:checked {
    background: var(--gold);
    border-color: var(--gold);
}

.login-page .checkbox-label input[type="checkbox"]:checked::after {
    opacity: 1;
}

.login-page .checkbox-label input[type="checkbox"]:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

/* زر الدخول */
.login-page .btn-login {
    position: relative;
    width: 100%;
    padding: 0.85rem 1rem;
    color: #f4e6c8;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    overflow: hidden;
    border: 1px solid var(--gold-soft);
    border-radius: 10px;
    background: linear-gradient(90deg, #0f2d46 0%, #1c557c 50%, #0f2d46 100%);
    box-shadow: 0 8px 22px rgba(28, 85, 124, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.18);
    transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
}

.login-page .btn-login::before {
    content: "";
    position: absolute;
    top: 0;
    left: -60%;
    width: 40%;
    height: 100%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.22), transparent);
    transform: skewX(-20deg);
    transition: left 0.6s;
}

.login-page .btn-login:hover:not(:disabled) {
    transform: translateY(-1px);
    filter: brightness(1.12);
    box-shadow: 0 12px 28px rgba(28, 85, 124, 0.5), 0 0 18px rgba(212, 175, 106, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.login-page .btn-login:hover:not(:disabled)::before {
    left: 120%;
}

.login-page .btn-login:active:not(:disabled) {
    transform: translateY(0);
}

.login-page .btn-login:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.login-page .btn-login:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* التنبيهات */
.login-page .alert {
    margin-bottom: 1rem;
    padding: 0.7rem 0.9rem;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: opacity 0.3s;
}

.login-page .alert-error {
    color: #ffb4b4;
    background: rgba(200, 60, 60, 0.15);
    border: 1px solid rgba(220, 90, 90, 0.4);
}

.login-page .alert-success {
    color: #b8f0c8;
    background: rgba(60, 170, 100, 0.15);
    border: 1px solid rgba(80, 190, 120, 0.4);
}

/* الشاشات الصغيرة */
@media (max-width: 720px) {
    .login-page::before,
    .login-page::after {
        display: none;
    }

    .login-brand {
        display: none;
    }

    .login-container {
        max-width: 440px;
    }

    .login-page .login-form {
        margin: 0.75rem;
        padding: 1.5rem 1.25rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-page * {
        transition: none !important;
    }
}
