.auth-page {
    --p: 275 100% 25%;
    --p-light: 274 74% 41%;
    --p-glow: 261 100% 62%;
    --fg: 270 50% 10%;
    --muted: 270 15% 45%;
    --bg: 270 20% 98%;
    --card: 0 0% 100%;
    --line: 270 20% 90%;
    --accent: 267 75% 92%;
    min-height: 100vh;
    background: hsl(var(--bg));
    color: hsl(var(--fg));
    font-family: "Cairo", "Noto Kufi Arabic", "Traditional Arabic", "Segoe UI", sans-serif;
}

.auth-page *,
.auth-page *::before,
.auth-page *::after {
    box-sizing: border-box;
}

.auth-page a {
    color: inherit;
    text-decoration: none;
}

.auth-page h1,
.auth-page h2,
.auth-page p {
    margin: 0;
}

.auth-page button,
.auth-page input,
.auth-page select {
    font: inherit;
}

.auth-page input,
.auth-page select {
    color: inherit;
}

.auth-page :focus-visible {
    outline: 2px solid hsl(var(--p-light));
    outline-offset: 2px;
}

.auth-top {
    position: sticky;
    top: 0;
    z-index: 60;
    background: hsl(var(--bg) / 0.95);
    border-bottom: 1px solid hsl(var(--line) / 0.5);
    backdrop-filter: blur(12px);
}

.auth-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    width: 100%;
    height: 3rem;
    margin-inline: auto;
    padding-inline: 0.75rem;
}

.auth-brand-link,
.auth-top-nav,
.auth-top-end,
.auth-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auth-brand-link img {
    height: 1.75rem;
    width: auto;
    border-radius: 0.5rem;
}

.auth-brand-link span,
.auth-word {
    font-size: 0.875rem;
    font-weight: 700;
}

.auth-top-nav {
    display: none;
    gap: 0.25rem;
}

.auth-top-nav a {
    padding: 0.375rem 0.625rem;
    border-radius: 0.375rem;
    color: hsl(var(--muted));
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-top-nav a:hover {
    color: hsl(var(--fg));
    background: hsl(var(--accent) / 0.6);
}

.auth-back {
    gap: 0.375rem;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    color: hsl(var(--muted));
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-back:hover {
    color: hsl(var(--fg));
    background: hsl(var(--accent) / 0.6);
}

.auth-back .glyph {
    font-size: 1rem;
}

.auth-back .back-label-short {
    display: none;
}

.auth-crumbs {
    background: hsl(var(--accent) / 0.35);
    border-bottom: 1px solid hsl(var(--line) / 0.4);
}

.auth-crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem 0.75rem;
    list-style: none;
    color: hsl(var(--muted));
    font-size: 0.875rem;
}

.auth-crumbs a,
.auth-crumbs span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.auth-crumbs a:hover {
    color: hsl(var(--fg));
}

.auth-crumbs [aria-current="page"] {
    color: hsl(var(--fg));
    font-weight: 500;
}

.crumb-sep {
    display: inline-flex;
    opacity: 0.6;
    font-size: 0.875rem;
}

[dir="rtl"] .auth-page .crumb-sep,
[dir="rtl"] .auth-page .back-arrow {
    transform: scaleX(-1);
}

.auth-split {
    display: flex;
    min-height: calc(100vh - 5.25rem);
}

.auth-hero {
    display: none;
    width: 50%;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: linear-gradient(135deg, hsl(var(--p)), hsl(var(--p-glow)));
    color: white;
    text-align: center;
}

.auth-hero img {
    width: 6rem;
    height: 6rem;
    margin: 0 auto 1.5rem;
    border-radius: 1rem;
    object-fit: contain;
    background: white;
}

.auth-hero h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 900;
}

.auth-hero p {
    max-width: 28rem;
    color: rgb(255 255 255 / 0.7);
    line-height: 1.7;
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.auth-card {
    width: min(100%, 28rem);
}

.auth-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.auth-mobile-mark {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.auth-mobile-mark img {
    width: 3rem;
    height: 3rem;
    border-radius: 0.75rem;
    object-fit: contain;
    background: white;
}

.auth-mobile-mark strong {
    font-size: 1.125rem;
}

.auth-lang {
    position: relative;
}

.auth-lang summary {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    border-radius: 0.375rem;
    color: hsl(var(--muted));
    font-size: 0.75rem;
}

.auth-lang summary::-webkit-details-marker {
    display: none;
}

.auth-lang summary:hover {
    background: hsl(var(--accent));
}

.auth-lang summary .glyph {
    font-size: 0.875rem;
}

.auth-lang-menu {
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 0.25rem);
    z-index: 50;
    min-width: 140px;
    padding: 0.25rem 0;
    background: white;
    border: 1px solid hsl(var(--line));
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px hsl(var(--p) / 0.12);
}

.auth-lang-menu a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
}

.auth-lang-menu a:hover,
.auth-lang-menu a[aria-current="true"] {
    background: hsl(var(--p) / 0.1);
    color: hsl(var(--p));
    font-weight: 600;
}

.auth-card h1 {
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.auth-page p.auth-lead {
    margin-bottom: 1.5rem;
    color: hsl(var(--muted));
    font-size: 0.875rem;
}

.auth-form {
    display: grid;
    gap: 1rem;
}

.auth-form label,
.auth-field {
    display: grid;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.auth-form input,
.auth-form select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid hsl(var(--line));
    border-radius: 0.75rem;
    background: white;
    font-size: 0.875rem;
    font-weight: 400;
    outline: none;
}

.auth-form input:focus,
.auth-form select:focus {
    border-color: transparent;
    box-shadow: 0 0 0 2px hsl(var(--p));
}

.auth-password {
    position: relative;
}

.auth-password input {
    padding-left: 2.5rem;
}

.auth-eye {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: inline-flex;
    border: 0;
    background: transparent;
    color: hsl(var(--muted));
    cursor: pointer;
    padding: 0;
}

.auth-eye .glyph {
    font-size: 1.125rem;
}

.auth-eye .eye-off {
    display: none;
}

.auth-eye.is-shown .eye-on {
    display: none;
}

.auth-eye.is-shown .eye-off {
    display: block;
}

.auth-submit,
.auth-next,
.auth-guest {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    border: 0;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
}

.auth-page button.auth-submit,
.auth-page a.auth-next {
    color: #fff;
    background: linear-gradient(135deg, hsl(var(--p)), hsl(var(--p-glow)));
}

.auth-page button.auth-guest {
    color: hsl(var(--p));
    background: hsl(var(--p) / 0.05);
    border: 1px solid hsl(var(--p) / 0.4);
}

.auth-guest-form {
    margin: 0;
}

.auth-page button.auth-eye {
    color: hsl(var(--muted));
}

.auth-submit:hover,
.auth-next:hover {
    opacity: 0.92;
}

.auth-next {
    margin-top: 1rem;
}

.auth-next[aria-disabled="true"] {
    opacity: 0.5;
    pointer-events: none;
}

.auth-guest {
    margin-top: 1rem;
    border: 1px solid hsl(var(--p) / 0.4);
    background: hsl(var(--p) / 0.05);
    color: hsl(var(--p));
}

.auth-guest:hover {
    background: hsl(var(--p) / 0.1);
}

.auth-page p.auth-switch {
    margin-top: 1.5rem;
    text-align: center;
    color: hsl(var(--muted));
    font-size: 0.875rem;
}

.auth-page a.auth-accent,
.auth-forgot a {
    color: hsl(var(--p));
    font-weight: 600;
}

.auth-page a.auth-accent:hover {
    text-decoration: underline;
}

.auth-forgot {
    text-align: end;
    font-size: 0.75rem;
    font-weight: 400;
}

.auth-page p.auth-note {
    margin-bottom: 1rem;
    padding: 0.75rem 0.9rem;
    border-radius: 0.75rem;
    background: hsl(var(--accent));
    color: hsl(var(--fg));
    font-size: 0.875rem;
}

.auth-roles {
    display: grid;
    gap: 0.75rem;
    max-height: 420px;
    overflow: auto;
    padding-inline-start: 0.25rem;
}

.auth-role {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border: 1px solid hsl(var(--line));
    border-radius: 0.75rem;
    background: white;
    text-align: start;
}

.auth-role:hover {
    border-color: hsl(var(--p) / 0.3);
}

.auth-role.is-on {
    border-color: hsl(var(--p));
    background: hsl(var(--p) / 0.05);
    box-shadow: 0 0 0 2px hsl(var(--p) / 0.3);
}

.auth-role > .auth-role-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    flex: none;
    border-radius: 0.5rem;
    background: hsl(var(--accent));
    color: hsl(var(--p));
    font-size: 1.25rem;
}

.auth-role.is-on .auth-role-icon {
    background: linear-gradient(135deg, hsl(var(--p)), hsl(var(--p-glow)));
    color: white;
}

.auth-role strong {
    display: block;
    font-size: 0.875rem;
}

.auth-role span {
    display: block;
    color: hsl(var(--muted));
    font-size: 0.75rem;
    font-weight: 400;
}

.auth-back-step {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1rem;
    color: hsl(var(--p));
    font-size: 0.875rem;
}

.auth-back-step:hover {
    text-decoration: underline;
}

@media (min-width: 640px) {
    .auth-bar,
    .auth-crumbs ol {
        padding-inline: 1rem;
    }

    .auth-brand-link img {
        height: 2rem;
    }

    .auth-back .back-label-short {
        display: none;
    }

    .auth-back .back-label {
        display: inline;
    }
}

@media (max-width: 639px) {
    .auth-back .back-label {
        display: none;
    }

    .auth-back .back-label-short {
        display: inline;
    }
}

@media (min-width: 768px) {
    .auth-top-nav {
        display: flex;
    }
}

@media (min-width: 1400px) {
    .auth-bar,
    .auth-crumbs ol {
        max-width: 1400px;
    }
}

@media (min-width: 1024px) {
    .auth-hero {
        display: flex;
    }

    .auth-tools,
    .auth-mobile-mark {
        display: none;
    }
}
