/* ===== شاشات الدخول/الهوية (Identity) — مشهد كحلي كامل بلمسة ذهبية ===== */
html:has(.am-auth-body) { height: 100%; }
.am-auth-body {
    margin: 0;
    height: 100%;
    overflow: hidden;
    background: #081a2c;
    font-family: 'Cairo', 'Segoe UI', Tahoma, sans-serif;
}

.am-auth-scene {
    position: relative;
    height: 100vh;
    overflow: hidden;
    background: radial-gradient(120% 100% at 50% -10%, #163958 0%, #0d2439 45%, #081726 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    box-sizing: border-box;
}

.am-auth-glow { position: absolute; border-radius: 50%; filter: blur(70px); pointer-events: none; animation: am-glow-pulse 7s ease-in-out infinite; }
.am-auth-glow-1 { width: 520px; height: 520px; top: -180px; right: -120px; background: radial-gradient(circle, rgba(206,172,92,0.22), transparent 70%); animation-delay: 0s; }
.am-auth-glow-2 { width: 460px; height: 460px; bottom: -200px; left: -140px; background: radial-gradient(circle, rgba(77,123,163,0.28), transparent 70%); animation-delay: 2.2s; }
@keyframes am-glow-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.12); }
}

.am-auth-motif {
    position: absolute;
    width: 460px; height: 460px;
    bottom: -60px; left: 50%;
    transform: translateX(-50%);
    color: #cbae5c;
    opacity: 0.5;
    pointer-events: none;
    animation: am-motif-drift 12s ease-in-out infinite;
}
@keyframes am-motif-drift {
    0%, 100% { transform: translateX(-50%) translateY(0); opacity: 0.45; }
    50% { transform: translateX(-50%) translateY(-14px); opacity: 0.6; }
}
@media (max-width: 640px) { .am-auth-motif { display: none; } }

@keyframes am-fade-up {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
.am-auth-brandmark, .am-auth-tagline, .am-auth-card, .am-auth-foot {
    animation: am-fade-up 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.am-auth-brandmark { animation-delay: 0.02s; }
.am-auth-tagline { animation-delay: 0.10s; }
.am-auth-card { animation-delay: 0.16s; }
.am-auth-foot { animation-delay: 0.30s; }

@media (prefers-reduced-motion: reduce) {
    .am-auth-glow, .am-auth-motif, .am-auth-brandmark, .am-auth-tagline, .am-auth-card, .am-auth-foot {
        animation: none !important;
    }
}

.am-auth-lang {
    position: absolute; top: 20px; inset-inline-end: 20px; z-index: 2;
    width: 36px; height: 36px; border-radius: 10px;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.14);
    color: rgba(255,255,255,0.85); font-size: 0.72rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    text-decoration: none; transition: background 0.15s;
}
.am-auth-lang:hover { background: rgba(255,255,255,0.16); color: #fff; }

.am-auth-wrap {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 408px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.am-auth-brandmark {
    display: flex; align-items: center; gap: 12px;
    color: #fff; font-size: 1.4rem; font-weight: 800;
    margin-bottom: 4px;
}
.am-auth-brandmark img { border-radius: 13px; box-shadow: 0 6px 20px rgba(0,0,0,0.35); }
.am-auth-tagline { color: rgba(255,255,255,0.55); font-size: 0.82rem; font-weight: 600; margin-bottom: 18px; letter-spacing: 0.02em; }

.am-auth-card {
    width: 100%;
    background: rgba(21,35,52,0.72);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 20px;
    padding: 28px 30px;
    box-shadow: 0 24px 60px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.06);
}

.am-auth-card .row { display: block; }
.am-auth-card .row > div { width: 100%; border: none !important; padding: 0 !important; }
.am-auth-card .row > div:nth-child(2) { display: none; }

.am-auth-card h1, .am-auth-card h2 {
    font-size: 1.3rem; font-weight: 800; color: #fff; text-align: center; margin-bottom: 4px;
}
.am-auth-card > h1 { margin-bottom: 18px; }
.am-auth-card h2 + h2, .am-auth-card section > h2:only-child { margin-bottom: 22px; }
.am-auth-card section > form > h2 { margin-bottom: 22px; }
.am-auth-card > p { color: rgba(255,255,255,0.6); text-align: center; margin-bottom: 22px; font-size: 0.9rem; }

.am-auth-card .form-floating { position: relative; margin-bottom: 12px; }
.am-auth-card .form-control {
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.14);
    color: #fff;
    border-radius: 12px;
    height: 54px;
    padding: 1.2rem 1rem 0.3rem;
    transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}
.am-auth-card .form-floating > label { color: rgba(255,255,255,0.5) !important; padding: 1rem; background: transparent !important; }
.am-auth-card .form-control:focus ~ label,
.am-auth-card .form-control:not(:placeholder-shown) ~ label {
    color: #cbae5c !important;
    background: transparent !important;
    transform: scale(0.8) translateY(-0.6rem);
}
.am-auth-card .form-control:focus {
    background: rgba(255,255,255,0.09);
    border-color: #cbae5c;
    box-shadow: 0 0 0 3px rgba(203,174,92,0.18);
    color: #fff;
}
.am-auth-card .form-control::placeholder { color: transparent; }
/* Chromium يفرض LTR على input[type=email]/[type=password] بغض النظر عن اتجاه الصفحة —
   بنعيد فرض RTL يدويًا هون لما الصفحة عربي، عشان النص المعروض (الـ label العائم) يترصف صح. */
html[dir="rtl"] .am-auth-card .form-control,
html[dir="rtl"] .am-auth-card .form-floating > label {
    direction: rtl;
    text-align: right;
}
.am-auth-card .form-control:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px rgba(21,35,52,0.95) inset;
    transition: background-color 9999s ease-in-out 0s;
}

.am-auth-card .checkbox { margin-bottom: 18px; }
.am-auth-card .checkbox label { color: rgba(255,255,255,0.75); font-weight: 500; font-size: 0.88rem; display: flex; align-items: center; gap: 8px; }
.am-auth-card .checkbox input[type="checkbox"] { width: 16px; height: 16px; accent-color: #cbae5c; }

.am-auth-card .btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #cbae5c, #a9843a);
    border: none;
    color: #0d2036;
    font-weight: 800;
    padding: 13px;
    font-size: 0.98rem;
    border-radius: 12px;
    margin-top: 4px;
    box-shadow: 0 10px 24px rgba(203,174,92,0.25);
    transition: transform 0.12s, box-shadow 0.15s;
}
.am-auth-card .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 30px rgba(203,174,92,0.35); }
.am-auth-card .btn-primary:active { transform: translateY(0); }

.am-auth-card hr { border-color: rgba(255,255,255,0.12); margin: 16px 0 12px; }

.am-auth-card a { color: #d9c079; font-weight: 700; text-decoration: none; font-size: 0.88rem; }
.am-auth-card a:hover { text-decoration: underline; color: #ecd696; }
.am-auth-card p a { display: block; text-align: center; margin-top: 8px; }
.am-auth-card a[href*="Register"],
.am-auth-card p:has(> a[href*="Register"]) { display: none !important; }

.am-auth-card .text-danger { color: #f0897d !important; font-size: 0.8rem; display: block; }
.am-auth-card span.text-danger:empty { display: none; }
.am-auth-card .validation-summary-errors {
    color: #f0897d !important; font-size: 0.82rem; background: rgba(224,102,90,0.12);
    border: 1px solid rgba(224,102,90,0.3); border-radius: 10px; padding: 8px 12px; margin-bottom: 14px;
}
.am-auth-card .validation-summary-errors:empty,
.am-auth-card .validation-summary-valid { display: none; }
.am-auth-card .validation-summary-errors ul { margin: 0; padding-inline-start: 18px; }

.am-auth-foot { color: rgba(255,255,255,0.35); font-size: 0.75rem; margin-top: 16px; }
