/* ==========================================================================
   يلا — Admin Login (Liquid Glass + Brand Identity)
   Burgundy #581225 · Olive #6B7B5C · Beige #E2D9C5
   ========================================================================== */

@font-face {
    font-family: "Mawhebah";
    src: url("../../mawhebah-font.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --y-font: "Mawhebah", "Almarai", "Segoe UI", system-ui, sans-serif;
    --y-burgundy: #581225;
    --y-burgundy-700: #43101f;
    --y-burgundy-400: #8c2a45;
    --y-olive: #6B7B5C;
    --y-olive-400: #8b9a7d;
    --y-beige: #E2D9C5;
    --y-beige-100: #f6f2e9;
    --y-sand: #d9cbb0;
    --y-ink: #33232a;
    --y-muted: #7d6b72;
    --y-grad-brand: linear-gradient(135deg, #581225 0%, #7a1a33 55%, #8c2a45 100%);
    --y-glass: rgba(255, 255, 255, .58);
    --y-glass-line: rgba(255, 255, 255, .5);
}

* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: var(--y-font);
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
    color: var(--y-ink);
    background:
        radial-gradient(900px 560px at 88% -8%, rgba(107, 123, 92, .42), transparent 62%),
        radial-gradient(760px 480px at 2% 6%, rgba(88, 18, 37, .22), transparent 62%),
        radial-gradient(700px 620px at 50% 116%, rgba(226, 217, 197, .95), transparent 66%),
        linear-gradient(180deg, #f7f3ea 0%, #efe8da 55%, #e8dfcd 100%);
    background-attachment: fixed;
}

/* ── Background slideshow (kept, tinted to the identity) ── */
.bg-login {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.bg-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.6s ease-in-out;
}

.bg-slide.active { opacity: 1; }

.bg-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(88, 18, 37, .34) 0%, rgba(88, 18, 37, .12) 45%, rgba(226, 217, 197, .5) 100%),
        rgba(226, 217, 197, .3);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

/* floating light blobs */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(260px 260px at 12% 24%, rgba(255, 255, 255, .5), transparent 70%),
        radial-gradient(340px 340px at 80% 66%, rgba(226, 217, 197, .5), transparent 72%),
        radial-gradient(200px 200px at 60% 8%, rgba(140, 42, 69, .16), transparent 70%);
    filter: none;
    animation: y-drift 18s ease-in-out infinite alternate;
}

@keyframes y-drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(0, -14px, 0) scale(1.03); }
}

@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
}

/* ── Language switcher ── */
.language-switcher {
    position: fixed;
    top: 22px;
    right: 22px;
    z-index: 40;
}

[dir="rtl"] .language-switcher {
    right: auto;
    left: 22px;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 50px;
    cursor: pointer;
    font-size: 13px;
    color: #fff;
    background: rgba(88, 18, 37, .35);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 10px 26px -14px rgba(40, 6, 17, .9), inset 0 1px 0 rgba(255, 255, 255, .28);
    transition: background-color .25s, box-shadow .25s, transform .25s;
}

.lang-btn:hover {
    background: rgba(88, 18, 37, .6);
    transform: translateY(-1px);
}

.flag-icon {
    width: 22px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
}

.lang-btn-text { font-weight: 500; }
.lang-btn-arrow { font-size: 11px; opacity: .8; }

.lang-menu {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    inset-inline-end: 0;
    min-width: 170px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 14px;
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow: 0 22px 44px -22px rgba(40, 6, 17, .7);
    z-index: 999;
    overflow: hidden;
}

.lang-menu.show { display: block; }

.lang-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 13px;
    color: var(--y-ink);
    text-decoration: none;
    transition: background-color .15s, color .15s;
}

.lang-menu a:hover {
    background: rgba(107, 123, 92, .16);
    color: var(--y-burgundy);
}

.lang-menu a.is-active {
    background: rgba(88, 18, 37, .1);
    color: var(--y-burgundy);
    font-weight: 700;
    cursor: default;
}

.lang-menu-text { font-weight: 500; }
.lang-menu a.is-active .lang-menu-text { font-weight: 700; }

.check-icon {
    margin-inline-start: auto;
    font-size: 12px;
    color: var(--y-olive);
}

/* ── Login card ── */
.login-card {
    position: relative;
    z-index: 20;
    width: 92%;
    max-width: 440px;
    margin: 20px auto;
    padding: 42px 40px 26px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 28px;
    background: rgba(255, 255, 255, .88);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    box-shadow:
        0 34px 70px -30px rgba(40, 6, 17, .6),
        inset 0 1px 0 rgba(255, 255, 255, .85);
    animation: y-rise .7s cubic-bezier(.2, .8, .25, 1) both;
}

@keyframes y-rise {
    from { opacity: 0; transform: translateY(22px) scale(.985); }
    to   { opacity: 1; transform: none; }
}

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

/* top brand ribbon */
.login-card::before {
    content: "";
    position: absolute;
    inset-block-start: -1px;
    inset-inline: 34px;
    height: 3px;
    border-radius: 3px;
    background: var(--y-grad-brand);
    box-shadow: 0 6px 18px -8px rgba(88, 18, 37, .9);
}

.login-card img.logo {
    display: block;
    max-height: 96px;
    max-width: 210px;
    margin: 0 auto 18px;
    object-fit: contain;
}

.login-card h1 {
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    color: var(--y-burgundy);
    letter-spacing: -.2px;
}

.login-card h1 + .alert-error + .form-group,
.login-card h1 + .form-group { margin-top: 18px; }

.alert-error {
    display: block;
    margin-top: 14px;
    padding: 11px 16px;
    border: 1px solid rgba(88, 18, 37, .35);
    border-radius: 12px;
    background: rgba(88, 18, 37, .9);
    color: #fff;
    font-size: 14px;
    box-shadow: 0 14px 28px -18px rgba(88, 18, 37, .9);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin: 24px 0 18px;
    text-align: start;
}

.input-field label {
    display: block;
    margin-bottom: 8px;
    color: var(--y-burgundy);
    font-size: 13.5px;
    font-weight: 700;
}

.input-field input {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 14px;
    outline: none;
    background: rgba(255, 255, 255, .62);
    color: var(--y-ink);
    font-size: 15px;
    box-shadow: inset 0 1px 2px rgba(40, 6, 17, .06);
    transition: border-color .2s, box-shadow .2s, background-color .2s;
}

.input-field input::placeholder { color: #a1909a; }

.input-field input:focus {
    border-color: var(--y-olive);
    background: rgba(255, 255, 255, .85);
    box-shadow: 0 0 0 4px rgba(107, 123, 92, .22), 0 10px 22px -16px rgba(40, 6, 17, .8);
}

.check-field {
    margin-top: 4px;
    text-align: start;
}

.check-field div {
    display: flex;
    align-items: center;
    gap: 9px;
}

.check-field input {
    width: 17px;
    height: 17px;
    cursor: pointer;
    accent-color: var(--y-burgundy);
}

.check-field label {
    color: var(--y-ink);
    font-size: 14px;
    cursor: pointer;
}

form button {
    width: 100%;
    height: 52px;
    margin-top: 26px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 14px;
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    background: var(--y-grad-brand);
    box-shadow: 0 16px 30px -16px rgba(88, 18, 37, .95), inset 0 1px 0 rgba(255, 255, 255, .3);
    transition: transform .2s, box-shadow .2s, filter .2s;
}

form button:hover {
    transform: translateY(-2px);
    filter: saturate(115%);
    box-shadow: 0 22px 38px -16px rgba(88, 18, 37, 1), inset 0 1px 0 rgba(255, 255, 255, .35);
}

form button:active { transform: translateY(0); }

.footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    margin-top: 26px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, .5);
    color: var(--y-muted);
    font-size: 13px;
    text-align: center;
}

.footer a {
    color: var(--y-burgundy);
    font-weight: 700;
    text-decoration: none;
}

.footer a:hover { text-decoration: underline; }

.footer-logo {
    height: 26px;
    vertical-align: middle;
}

.margin { margin-inline-start: 3px; }

/* ── Responsive ── */
@media (max-width: 576px) {
    .language-switcher {
        top: 14px;
        right: 14px;
    }

    [dir="rtl"] .language-switcher {
        right: auto;
        left: 14px;
    }

    .login-card {
        padding: 34px 22px 20px;
        border-radius: 24px;
        background: rgba(255, 255, 255, .93);
    }

    .login-card h1 { font-size: 21px; }

    .input-field input {
        padding: 12px 14px;
        font-size: 13px;
    }

    form button { height: 48px; font-size: 15px; }
}

@media (max-height: 620px) {
    .login-card { margin: 12px auto; padding-block: 28px 18px; }
    .login-card img.logo { max-height: 60px; }
}
