:root {
    color-scheme: light;
    --brand: #16677d;
    --brand-dark: #0a4556;
    --brand-deep: #062d37;
    --brand-mid: #1b849c;
    --gold: #d4a05a;
    --gold-dark: #9a6f2f;
    --gold-soft: #f3e6d0;
    --ink: #0f2430;
    --muted: #4d636e;
    --line: #d5e2e7;
    --font: "Qomra", "Segoe UI", "Geeza Pro", "Traditional Arabic", "Noto Sans Arabic", Tahoma, sans-serif;
    --ease: cubic-bezier(.22, 1, .36, 1);
    font-family: var(--font);
}

* { box-sizing: border-box; }

body.auth-body {
    margin: 0;
    min-height: 100vh;
    position: relative;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    color: var(--ink);
    font-family: inherit;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    background: var(--brand-deep);
}

.auth-stage {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}
.auth-stage__banner {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 35%;
    transform: scale(1.06);
    animation: authKen 22s ease-in-out infinite alternate;
}
.auth-stage__shade {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 70% 55% at 50% 40%, rgba(6, 45, 55, .35), transparent 70%),
        linear-gradient(180deg, rgba(6, 32, 40, .58) 0%, rgba(10, 55, 66, .78) 48%, rgba(6, 35, 42, .94) 100%);
}
.auth-stage__mesh {
    position: absolute;
    inset: 0;
    opacity: .2;
    background-image:
        linear-gradient(rgba(212, 160, 90, .18) 1px, transparent 1px),
        linear-gradient(90deg, rgba(212, 160, 90, .18) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: radial-gradient(ellipse 65% 55% at 50% 45%, #000 20%, transparent 75%);
}
.auth-stage__frame {
    position: absolute;
    inset: clamp(.85rem, 2vw, 1.4rem);
    border: 1px solid rgba(212, 160, 90, .28);
    border-radius: 1.2rem;
}
.auth-stage__frame::before,
.auth-stage__frame::after {
    content: "";
    position: absolute;
    width: 2.4rem;
    height: 2.4rem;
    border: 2px solid var(--gold);
}
.auth-stage__frame::before {
    inset-block-start: -.35rem;
    inset-inline-start: -.35rem;
    border-inline-end: 0;
    border-block-end: 0;
}
.auth-stage__frame::after {
    inset-block-end: -.35rem;
    inset-inline-end: -.35rem;
    border-inline-start: 0;
    border-block-start: 0;
}

.auth-home-link {
    position: fixed;
    z-index: 5;
    inset-block-start: 1.1rem;
    inset-inline-start: 1.1rem;
    padding: .55rem .95rem;
    border: 1px solid rgba(255, 255, 255, .35);
    border-radius: .5rem;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
    backdrop-filter: blur(8px);
    transition: background .2s ease, transform .2s var(--ease);
}
.auth-home-link:hover {
    background: rgba(255, 255, 255, .2);
    transform: translateY(-1px);
}

.auth-card {
    position: relative;
    z-index: 1;
    width: min(100%, 28.5rem);
    padding: clamp(1.45rem, 4.5vw, 2.15rem);
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 1.25rem;
    background:
        linear-gradient(165deg, rgba(255, 255, 255, .98), #f3fafb 70%, #e8f3f6);
    box-shadow: 0 24px 50px rgba(4, 28, 36, .35);
    overflow: hidden;
}

.auth-card::before {
    content: "";
    position: absolute;
    inset-block-start: 0;
    inset-inline: 0;
    height: .35rem;
    background: linear-gradient(90deg, var(--brand), var(--gold), var(--brand-mid));
}

.auth-brand {
    position: relative;
    z-index: 1;
    text-align: center;
}
.auth-brand img {
    width: min(15.5rem, 86%);
    height: auto;
    aspect-ratio: 666 / 375;
    margin-inline: auto;
    object-fit: contain;
    filter: drop-shadow(0 10px 22px rgba(22, 103, 125, .18));
}
.auth-brand h1 {
    margin: .7rem 0 .35rem;
    color: var(--brand-dark);
    font-size: clamp(1.3rem, 4vw, 1.5rem);
    letter-spacing: -.02em;
}
.auth-brand p {
    margin: 0 0 1.35rem;
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.65;
}

label {
    display: block;
    margin: 1rem 0 .4rem;
    font-size: .8rem;
    font-weight: 700;
    color: var(--muted);
}

input[type="email"],
input[type="password"] {
    width: 100%;
    padding: .82rem .9rem;
    border: 1px solid #b9ccd2;
    border-radius: .65rem;
    background: #fff;
    color: var(--ink);
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}

input[type="email"]:hover,
input[type="password"]:hover { border-color: #9bb4bc; }

input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(22, 103, 125, .16);
}

.remember {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-top: .85rem;
    font-weight: 400;
    color: var(--muted);
}

.submit-button {
    width: 100%;
    margin-top: 1.3rem;
    padding: .95rem;
    border: 0;
    border-radius: .65rem;
    background: linear-gradient(135deg, #dfb06f, var(--gold) 48%, #c08a3f);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(154, 111, 47, .28);
    transition: filter .18s ease, transform .18s var(--ease), box-shadow .18s ease;
}

.submit-button:hover {
    filter: brightness(1.04);
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(154, 111, 47, .34);
}

.submit-button:focus-visible {
    outline: 3px solid rgba(22, 103, 125, .45);
    outline-offset: 2px;
}

.alert,
.errors {
    margin: 0 0 1rem;
    padding: .8rem 1rem;
    border-radius: .65rem;
    font-size: .84rem;
    border: 1px solid transparent;
}

.alert {
    background: #eaf7f1;
    color: #1f6a51;
    border-color: #cfe9dc;
}

.errors {
    padding-inline-start: 2rem;
    background: #fdf1f0;
    color: #963d3d;
    border-color: #f0d4d2;
}

@keyframes authKen {
    from { transform: scale(1.06) translate3d(0, 0, 0); }
    to { transform: scale(1.12) translate3d(0, -1.5%, 0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
    }
}
