/* ============================================
   ADMIN LOGIN - Al-Eman Group
   ============================================ */

:root {
    --login-charcoal: #1f2528;
    --login-charcoal-soft: #30383c;
    --login-red: #b92025;
    --login-red-dark: #94191d;
    --login-gold: #c8a24b;
    --login-border: #dfe2e3;
    --login-muted: #6c7478;
    --login-surface: #ffffff;
}

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

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px;
    position: relative;
    overflow-x: hidden;
    color: var(--login-charcoal);
    font-family: 'Cairo', Arial, sans-serif;
    background: #141718;
}

body::before {
    content: '';
    position: fixed;
    inset: -16px;
    pointer-events: none;
    background: url('/assets/catalog/factory-line-wide.webp') center / cover no-repeat;
    filter: blur(8px);
    opacity: 0.62;
    transform: scale(1.03);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(rgba(15, 18, 19, 0.5), rgba(15, 18, 19, 0.82));
}

.login-container {
    width: min(920px, 100%);
    min-height: 590px;
    display: grid;
    grid-template-columns: minmax(310px, 0.88fr) minmax(390px, 1.12fr);
    overflow: hidden;
    position: relative;
    z-index: 1;
    background: var(--login-surface);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
    animation: loginEnter 0.45s ease-out both;
}

@keyframes loginEnter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    min-width: 0;
    padding: 56px 36px 44px;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #ffffff;
    text-align: center;
    background:
        linear-gradient(rgba(27, 32, 34, 0.9), rgba(27, 32, 34, 0.96)),
        url('/assets/catalog/factory-floor-wide.webp') center / cover no-repeat;
}

.login-header::before {
    content: '';
    width: 56px;
    height: 4px;
    margin: 0 auto 24px;
    background: var(--login-gold);
}

.login-header .logo-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 108px;
    margin-bottom: 30px;
    padding: 16px 18px;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 6px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.login-header .logo-container img {
    display: block;
    width: 100%;
    height: 76px;
    object-fit: contain;
    filter: none;
}

.login-header h1 {
    margin: 0;
    position: relative;
    z-index: 1;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1.35;
}

.login-header h1 i {
    color: var(--login-gold);
}

.login-header p {
    max-width: 300px;
    margin: 12px auto 0;
    position: relative;
    z-index: 1;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.95rem;
    line-height: 1.8;
}

.login-body {
    min-width: 0;
    padding: 58px 54px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #ffffff;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    color: var(--login-charcoal);
    font-size: 0.92rem;
    font-weight: 700;
}

.form-label i {
    color: var(--login-red);
}

.mb-3 {
    margin-bottom: 18px;
}

.input-group {
    display: flex;
    width: 100%;
}

.input-group-text {
    min-width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 13px 15px;
    color: var(--login-red);
    background: #f4f5f5;
    border: 1px solid var(--login-border);
    border-right: 0;
    border-radius: 6px 0 0 6px;
}

[dir='rtl'] .input-group-text {
    border-right: 1px solid var(--login-border);
    border-left: 0;
    border-radius: 0 6px 6px 0;
}

.form-control {
    width: 100%;
    min-width: 0;
    padding: 13px 15px;
    color: var(--login-charcoal);
    background: #ffffff;
    border: 1px solid var(--login-border);
    border-left: 0;
    border-radius: 0 6px 6px 0;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[dir='rtl'] .form-control {
    border-right: 0;
    border-left: 1px solid var(--login-border);
    border-radius: 6px 0 0 6px;
}

.input-group:focus-within .input-group-text,
.form-control:focus {
    border-color: var(--login-gold);
}

.form-control:focus {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(200, 162, 75, 0.16);
}

.form-control::placeholder {
    color: #9aa0a3;
    opacity: 1;
}

.forgot-password-link {
    margin: 2px 0 20px;
    text-align: start;
}

.forgot-password-link a {
    color: var(--login-charcoal-soft);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.forgot-password-link a:hover {
    color: var(--login-red);
}

.btn-login {
    width: 100%;
    min-height: 50px;
    padding: 13px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    color: #ffffff;
    background: var(--login-red);
    border: 1px solid var(--login-red);
    border-radius: 6px;
    box-shadow: 0 8px 20px rgba(185, 32, 37, 0.18);
    cursor: pointer;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 800;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-login:hover {
    background: var(--login-red-dark);
    border-color: var(--login-red-dark);
    box-shadow: 0 10px 24px rgba(148, 25, 29, 0.26);
    transform: translateY(-1px);
}

.btn-login:active {
    transform: translateY(0);
}

.alert {
    margin-bottom: 22px;
    padding: 13px 15px;
    display: flex;
    align-items: center;
    gap: 9px;
    border: 1px solid transparent;
    border-radius: 6px;
    font-size: 0.9rem;
}

.alert-success {
    color: #245b37;
    background: #edf7f0;
    border-color: #cfe7d5;
}

.alert-danger {
    color: #7b191d;
    background: #fff1f1;
    border-color: #edc5c7;
}

.back-to-website {
    margin-top: 28px;
    padding-top: 24px;
    text-align: center;
    border-top: 1px solid var(--login-border);
}

.back-to-website a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--login-muted);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 700;
    transition: color 0.2s ease;
}

.back-to-website a:hover {
    color: var(--login-red);
}

.language-switcher-login {
    margin-top: 28px;
    padding-top: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.language-switcher-login .lang-link {
    padding: 7px 12px;
    color: rgba(255, 255, 255, 0.72);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 700;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.language-switcher-login .lang-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.language-switcher-login .lang-link.active {
    color: var(--login-charcoal);
    background: var(--login-gold);
}

.language-switcher-login .lang-separator {
    color: rgba(255, 255, 255, 0.28);
}

@media (max-width: 760px) {
    body {
        align-items: flex-start;
        padding: 18px;
        background-position: 64% center;
    }

    .login-container {
        width: min(460px, 100%);
        min-height: 0;
        display: block;
        margin: auto;
    }

    .login-header {
        padding: 28px 24px 24px;
    }

    .login-header::before {
        width: 42px;
        height: 3px;
        margin-bottom: 18px;
    }

    .login-header .logo-container {
        min-height: 82px;
        margin-bottom: 20px;
        padding: 12px 14px;
    }

    .login-header .logo-container img {
        height: 56px;
    }

    .login-header h1 {
        font-size: 1.55rem;
    }

    .login-header p {
        margin-top: 8px;
        font-size: 0.86rem;
    }

    .language-switcher-login {
        margin-top: 18px;
        padding-top: 16px;
    }

    .login-body {
        padding: 30px 24px;
    }
}

@media (max-width: 390px) {
    body {
        padding: 10px;
    }

    .login-header {
        padding-inline: 18px;
    }

    .login-body {
        padding: 26px 18px;
    }

    .login-header .logo-container {
        gap: 8px;
    }

    .login-header .logo-container img {
        height: 50px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .login-container {
        animation: none;
    }

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
