/* MAJD ERP — Auth & Login v3 */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --navy: #0f2744;
    --navy-deep: #0a1628;
    --blue: #2d6cdf;
    --gold: #c9a227;
    --gold-light: #f0d78c;
    --glass: rgba(255, 255, 255, 0.1);
    --glass-border: rgba(201, 162, 39, 0.28);
}

.auth-body {
    font-family: 'Tajawal', sans-serif;
    background: var(--navy-deep);
    -webkit-font-smoothing: antialiased;
}

.brand-logo {
    display: block;
    width: min(240px, 82%);
    height: auto;
    margin: 0 auto 18px;
    object-fit: contain;
    filter: brightness(0) saturate(100%)
        invert(78%) sepia(38%) saturate(620%) hue-rotate(6deg) brightness(1.05)
        drop-shadow(0 2px 14px rgba(201, 162, 39, 0.45));
}

.brand-logo--splash {
    width: min(260px, 85vw);
    margin-bottom: 24px;
    animation: logoFloat 4s ease-in-out infinite;
}

@keyframes logoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.splash-screen {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--navy-deep);
    transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash-screen.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-aurora {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 50% 40%, rgba(45, 108, 223, 0.22) 0%, transparent 65%),
        radial-gradient(ellipse 50% 40% at 80% 80%, rgba(201, 162, 39, 0.12) 0%, transparent 55%),
        linear-gradient(165deg, #060f1a, #0f2744 50%, #0a1a2e);
}

.splash-logo-wrap { position: relative; z-index: 2; text-align: center; animation: fadeUp 0.8s ease forwards; }
.splash-tagline { margin-top: 22px; color: rgba(255,255,255,0.92); font-size: 1.05rem; font-weight: 700; }
.splash-sub { margin-top: 6px; color: rgba(255,255,255,0.5); font-size: 0.82rem; }

.splash-loader {
    margin-top: 32px;
    width: 80px;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
    z-index: 2;
}
.splash-loader::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 45%;
    background: linear-gradient(90deg, transparent, var(--gold-light), transparent);
    animation: loaderSlide 1.2s ease-in-out infinite;
}

.splash-version {
    position: absolute;
    bottom: 24px;
    color: rgba(255,255,255,0.3);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    z-index: 2;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.login-page.show { opacity: 1; }

.login-bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; }
.login-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    filter: saturate(1.08) contrast(1.04);
    transform: scale(1.02);
}

.login-bg-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 22, 40, 0.35) 0%, rgba(10, 22, 40, 0.55) 45%, rgba(8, 14, 28, 0.82) 100%),
        linear-gradient(135deg, rgba(15, 39, 68, 0.45) 0%, transparent 55%),
        radial-gradient(ellipse 70% 50% at 50% 20%, rgba(201, 162, 39, 0.08) 0%, transparent 60%);
}

.login-wrapper {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 460px;
    animation: fadeUp 0.55s ease 0.1s both;
}

.login-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.12) 0%, rgba(255,255,255,0.06) 100%);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 36px 32px 28px;
    box-shadow: 0 28px 70px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.15);
    position: relative;
    overflow: hidden;
}
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}

.login-brand { text-align: center; padding: 4px 0 2px; }
.login-company-line { font-size: 0.92rem; font-weight: 600; color: rgba(255,255,255,0.88); line-height: 1.65; margin: 0 0 12px; }
.login-erp-tag {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    color: var(--gold-light);
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid rgba(201, 162, 39, 0.45);
    background: rgba(201, 162, 39, 0.12);
}

.login-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 24px 0 18px;
    color: rgba(255,255,255,0.5);
    font-size: 0.75rem;
}
.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(201, 162, 39, 0.5), transparent);
}
.login-divider span { color: #fff; font-size: 1.02rem; font-weight: 800; white-space: nowrap; }

.login-welcome { text-align: center; font-size: 0.9rem; color: rgba(255,255,255,0.62); margin-bottom: 20px; }

.login-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 14px;
    margin-bottom: 16px;
    border-radius: 12px;
    background: rgba(234, 67, 53, 0.18);
    border: 1px solid rgba(252, 165, 165, 0.35);
    color: #fecaca;
    font-size: 0.86rem;
}

.login-field { margin-bottom: 16px; }
.login-label { display: block; font-size: 0.88rem; font-weight: 700; color: #fff; margin-bottom: 8px; }
.login-input-wrap { position: relative; }
.login-input-wrap i {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(201, 162, 39, 0.75);
    font-size: 1rem;
    pointer-events: none;
}
[dir="rtl"] .login-input-wrap i { right: 14px; }
[dir="ltr"] .login-input-wrap i { left: 14px; }

.login-input {
    width: 100%;
    padding: 14px 14px;
    padding-inline-start: 44px;
    border-radius: 12px;
    border: 1.5px solid rgba(255,255,255,0.22);
    background: rgba(0, 0, 0, 0.25);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.login-input:focus {
    outline: none;
    border-color: rgba(201, 162, 39, 0.65);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}
.login-input::placeholder { color: rgba(255,255,255,0.32); }

.login-remember { display: flex; align-items: center; gap: 8px; margin-bottom: 22px; font-size: 0.9rem; color: rgba(255,255,255,0.72); }
.login-remember label { cursor: pointer; }

.login-btn {
    width: 100%;
    padding: 15px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--navy) 0%, var(--blue) 55%, #1a4a9e 100%);
    color: #fff;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 6px 22px rgba(45, 108, 223, 0.4);
    transition: transform 0.15s, box-shadow 0.2s;
    border-top: 1px solid rgba(255,255,255,0.12);
}
[dir="ltr"] .login-btn i { transform: scaleX(-1); }
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(45, 108, 223, 0.5); }

.login-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(201, 162, 39, 0.2);
    font-size: 0.76rem;
    color: rgba(255,255,255,0.48);
    line-height: 1.65;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes loaderSlide {
    0% { left: -50%; }
    100% { left: 100%; }
}

@media (min-width: 900px) {
    .login-page {
        justify-content: flex-end;
        padding-inline: 8vw 6vw;
    }
    .login-wrapper { max-width: 420px; }
    .login-bg img { object-position: center center; }
}

@media (max-width: 480px) {
    .login-card { padding: 28px 22px 24px; border-radius: 20px; }
    .brand-logo { width: min(200px, 78vw); }
}

/* ── Install wizard ── */
.install-card { max-width: 620px; }
.install-section { margin-bottom: 22px; }
.install-section__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255,255,255,0.92);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}
.install-hint {
    font-size: 0.88rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 12px;
}
.install-req-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
}
.install-req-list__item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    font-size: 0.88rem;
    color: rgba(255,255,255,0.85);
}
.install-req-list__item:last-child { border-bottom: none; }
.install-card .form-label { color: rgba(255,255,255,0.75); }
.install-card .form-control {
    background: rgba(0,0,0,0.25);
    border-color: rgba(255,255,255,0.2);
    color: #fff;
}
.install-card .form-control:focus {
    border-color: rgba(201, 162, 39, 0.65);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}
.install-card .text-muted { color: rgba(255,255,255,0.45) !important; }
.install-card .text-success { color: #6dd58c !important; }
.install-card .text-danger { color: #ff8a80 !important; }
.install-card .alert { margin-bottom: 16px; }
.install-card code {
    background: rgba(201, 162, 39, 0.15);
    color: #f0d78c;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}
