/*
 * Login page: split-screen layout (resources/views/auth/login.blade.php + layouts/auth-split).
 * Everything is scoped under .al-* so no other page is affected.
 * The brand panel is always on the physical left and the form on the physical right;
 * text direction inside each follows <html dir> (rtl for Arabic, ltr otherwise).
 */

:root {
    --al-ink: #0b1f4b;
    --al-muted: #52627f;
    --al-placeholder: #66748f;
    --al-line: #bcc6d8;
    --al-line-hover: #9eafca;
    --al-blue: #1677e6;
    --al-blue-700: #0b5dc0;
    --al-blue-900: #0a4ea8;
    --al-danger: #c62839;
    --al-radius: 12px;
    --al-ease: cubic-bezier(.22, .8, .26, 1);
}

.al-body {
    margin: 0;
    min-height: 100vh;
    background: #fff;
    color: var(--al-ink);
    font-family: "Cairo", "Alexandria", Tahoma, "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    text-align: start; /* the project's RTL Bootstrap build keeps body text-align: left */
}

.al-auth {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100vh;
    min-height: 100dvh;
    direction: ltr; /* keeps the brand panel on the left in every language */
}

html[dir="rtl"] .al-panel,
html[dir="rtl"] .al-lang {
    direction: rtl;
}

.al-panel,
.al-lang {
    text-align: start;
}

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

.al-icon {
    flex: none;
    width: 20px;
    height: 20px;
    display: block;
}

.al-icon--fill {
    fill: currentColor;
}

.al-icon--stroke {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.al-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ------------------------------------------------------------------ */
/* Brand panel (left)                                                  */
/* ------------------------------------------------------------------ */

.al-brand {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px clamp(20px, 4vw, 56px);
    color: #fff;
    /* colours sampled from the reference design: lighter top-left, darker towards the bottom-right */
    background:
        radial-gradient(55% 38% at 4% 27%, rgba(40, 145, 248, .6) 0%, rgba(40, 145, 248, 0) 72%),
        linear-gradient(135deg, #0a69cc 0%, #045bb5 30%, #02479c 62%, #003a85 100%);
}

.al-glow {
    position: absolute;
    z-index: -1;
    top: -18%;
    left: -22%;
    width: 78%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(120, 190, 255, .28), rgba(120, 190, 255, 0));
    pointer-events: none;
}

.al-wave {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    pointer-events: none;
}

/* two big ellipses whose upper-left arcs rise towards the right edge and cross near the bottom */
.al-wave--a {
    left: -4.8%;
    top: 65%;
    width: 239%;
    height: 199%;
    background: linear-gradient(180deg, rgba(30, 138, 252, .34) 0%, rgba(14, 108, 222, .12) 24%, rgba(0, 70, 160, 0) 50%);
    box-shadow: inset 0 1.5px 0 rgba(150, 208, 255, .36);
}

.al-wave--b {
    left: -21.5%;
    top: 79%;
    width: 263%;
    height: 115%;
    background: linear-gradient(180deg, rgba(26, 130, 248, .30) 0%, rgba(12, 100, 214, .10) 40%, rgba(0, 60, 140, 0) 82%);
    box-shadow: inset 0 2px 0 rgba(170, 218, 255, .5);
}

/*
 * The project's own white logo (assets/icons/logo_w.svg, 531x416) shown as is.
 * It is placed twice and clipped inside the blank gap between the mark (y 0-233.5) and the name (y 275.7-402.6),
 * so the mark and the name can fade in one after the other without altering the artwork.
 */
.al-logo {
    flex: none;
    width: min(100%, clamp(210px, 23vw, 410px));
}

.al-logo__float {
    position: relative;
    aspect-ratio: 531 / 416;
}

.al-logo__float img {
    display: block;
    width: 100%;
    height: auto;
}

.al-logo__mark {
    clip-path: inset(0 0 38.9% 0); /* keeps y 0 - 254 */
    transform-origin: 50% 28%;
}

.al-logo__name {
    position: absolute;
    top: 0;
    left: 0;
    clip-path: inset(61.1% 0 0 0); /* keeps y 254 - 416 */
}

/* the white logo uploaded in Settings: shown whole, in its own proportions */
.al-logo__float--custom {
    aspect-ratio: auto;
    display: flex;
    justify-content: center;
}

.al-logo__float .al-logo__custom {
    width: auto;
    max-width: 100%;
    max-height: 320px;
    object-fit: contain;
}

/* ------------------------------------------------------------------ */
/* Language switcher (top right of the page)                           */
/* ------------------------------------------------------------------ */

.al-topbar {
    position: absolute;
    z-index: 30;
    top: 32px;
    right: 34px;
    display: flex;
    align-items: center;
    gap: 10px;
}

html[dir="rtl"] .al-topbar {
    direction: rtl; /* the first item (language menu) sits at the right, anything added after it (logout) at the end */
}

.al-lang {
    position: relative;
}

.al-lang__btn {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    height: 46px;
    padding: 0 16px;
    border: 1px solid #dfe5ee;
    border-radius: 999px;
    background: #fff;
    color: var(--al-ink);
    font-size: .95rem;
    font-weight: 700;
    line-height: 1;
    list-style: none;
    cursor: pointer;
    user-select: none;
    box-shadow: 0 1px 2px rgba(11, 31, 75, .04);
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.al-lang__btn::-webkit-details-marker {
    display: none;
}

.al-lang__btn:hover {
    border-color: var(--al-line-hover);
    box-shadow: 0 3px 10px -4px rgba(11, 31, 75, .18);
}

.al-lang__btn:focus-visible,
.al-lang[open] .al-lang__btn {
    outline: 0;
    border-color: var(--al-blue);
    box-shadow: 0 0 0 4px rgba(22, 119, 230, .16);
}

.al-lang__globe {
    width: 21px;
    height: 21px;
}

.al-lang__chev {
    width: 16px;
    height: 16px;
    transition: transform .25s var(--al-ease);
}

.al-lang[open] .al-lang__chev {
    transform: rotate(180deg);
}

.al-lang__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 192px;
    padding: 6px;
    border: 1px solid #e3e8f1;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 34px -14px rgba(11, 31, 75, .32);
}

.al-lang__item {
    display: flex;
    align-items: center;
    gap: .7rem;
    padding: .6rem .75rem;
    border-radius: 10px;
    color: var(--al-ink);
    font-size: .98rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}

.al-lang__item:hover,
.al-lang__item:focus-visible {
    outline: 0;
    background: #f0f5fc;
    color: var(--al-blue-900);
    text-decoration: none;
}

.al-lang__item[aria-current="true"] {
    background: #e8f1fd;
    color: var(--al-blue-900);
    font-weight: 800;
}

.al-flag {
    flex: none;
    width: 24px;
    height: auto;
    border-radius: 3px;
}

/* Dark / light switch next to the language menu (same choice as the admin shell: localStorage ds.theme) */
.al-theme {
    display: inline-grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 1px solid #dfe5ee;
    border-radius: 50%;
    background: #fff;
    color: var(--al-ink);
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(11, 31, 75, .04);
    transition: border-color .2s ease, background-color .2s ease, color .2s ease;
}

.al-theme .al-icon {
    width: 20px;
    height: 20px;
}

.al-theme:hover {
    border-color: var(--al-line-hover);
    color: var(--al-blue-700);
}

.al-theme:focus-visible {
    outline: 0;
    border-color: var(--al-blue);
    box-shadow: 0 0 0 4px rgba(22, 119, 230, .18);
}

.al-theme__sun,
html[data-theme="dark"] .al-theme__moon {
    display: none;
}

html[data-theme="dark"] .al-theme__sun {
    display: block;
}

/* ------------------------------------------------------------------ */
/* Login panel (right)                                                 */
/* ------------------------------------------------------------------ */

.al-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 96px clamp(20px, 5vw, 64px) 56px;
    background: #fff;
}

.al-card {
    width: 100%;
    max-width: 480px;
}

.al-head {
    margin-bottom: 2.5rem;
    text-align: center;
}

.al-title {
    margin: 0 0 .65rem;
    font-size: clamp(1.6rem, 1.2rem + .95vw, 2.25rem);
    font-weight: 800;
    line-height: 1.3;
    color: var(--al-ink);
    text-wrap: balance;
}

.al-subtitle {
    margin: 0;
    font-size: clamp(1rem, .9rem + .3vw, 1.22rem);
    font-weight: 700;
    color: var(--al-muted);
    text-wrap: balance;
}

.al-note {
    margin: 0 0 1.5rem;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.7;
    color: var(--al-muted);
    text-align: center;
}

.al-flash {
    margin-bottom: 1.1rem;
}

.al-flash .col-12 {
    max-width: 100%;
    padding: 0;
}

.al-flash .alert {
    margin: 0 0 .6rem;
    padding: .7rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--al-radius);
    font-size: .95rem;
}

.al-flash .alert-success {
    background: #eaf8f0;
    border-color: #bfe8d0;
    color: #12633a;
}

.al-flash .alert-danger {
    background: #fdf0f1;
    border-color: #f6c9ce;
    color: #9d1f2e;
}

.al-field {
    margin-bottom: 1.35rem;
}

.al-label {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 .7rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--al-ink);
    transition: color .2s ease;
}

.al-label .al-icon {
    color: var(--al-ink);
    transition: color .2s ease, transform .3s var(--al-ease);
}

.al-field:focus-within .al-label,
.al-field:focus-within .al-label .al-icon {
    color: var(--al-blue-700);
}

.al-field:focus-within .al-label .al-icon {
    transform: scale(1.1);
}

.al-input,
.al-select__control {
    display: block;
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 1.5px solid var(--al-line);
    border-radius: var(--al-radius);
    background: #fff;
    color: var(--al-ink);
    font: inherit;
    font-size: 1rem;
    font-weight: 600;
    outline: 0;
    -webkit-appearance: none;
    -moz-appearance: textfield;
    appearance: none;
    transition: border-color .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.al-input--ltr {
    direction: ltr; /* emails, tokens */
}

html[dir="rtl"] .al-input--ltr {
    text-align: right;
}

.al-input--ltr::placeholder {
    direction: rtl;
}

.al-input--file {
    height: auto;
    padding: 10px 12px;
    cursor: pointer;
}

.al-input--file::file-selector-button {
    margin-inline-end: 12px;
    padding: 8px 14px;
    border: 0;
    border-radius: 9px;
    background: #eaf2fd;
    color: var(--al-blue-700);
    font: inherit;
    font-size: .92rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.al-input--file:hover::file-selector-button {
    background: var(--al-blue);
    color: #fff;
}

.al-input::placeholder {
    color: var(--al-placeholder);
    font-weight: 500;
    opacity: 1;
}

.al-input::-webkit-outer-spin-button,
.al-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.al-input:hover,
.al-select__control:hover {
    border-color: var(--al-line-hover);
}

.al-input:focus,
.al-select__control:focus {
    border-color: var(--al-blue);
    box-shadow: 0 0 0 4px rgba(22, 119, 230, .15);
}

.al-input.is-invalid,
.al-select__control.is-invalid {
    border-color: var(--al-danger);
}

.al-input.is-invalid:focus,
.al-select__control.is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(198, 40, 57, .14);
}

.al-input:-webkit-autofill,
.al-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--al-ink);
    -webkit-box-shadow: 0 0 0 1000px #fff inset;
}

.al-phone {
    display: flex;
    gap: 10px;
}

.al-phone .al-input {
    flex: 1 1 auto;
    min-width: 0;
}

html[dir="ltr"] .al-phone .al-select {
    order: -1; /* country code first when reading left to right */
}

.al-select {
    position: relative;
    flex: 0 0 clamp(104px, 25%, 132px);
}

.al-select__control {
    direction: ltr; /* a leading "+" resolves to the right of the digits in an RTL context ("218+") */
    font-weight: 700;
    cursor: pointer;
}

html[dir="rtl"] .al-select__control {
    padding: 0 14px 0 36px;
    text-align: right;
    text-align-last: right;
}

html[dir="ltr"] .al-select__control {
    padding: 0 36px 0 14px;
    text-align: left;
    text-align-last: left;
}

.al-select__chev {
    position: absolute;
    top: 50%;
    inset-inline-end: 12px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    color: var(--al-ink);
    pointer-events: none;
    transition: color .2s ease, transform .25s var(--al-ease);
}

.al-select__control:focus + .al-select__chev {
    color: var(--al-blue);
    transform: translateY(1px);
}

.al-pass {
    position: relative;
}

.al-input--pass {
    padding-inline-end: 56px;
}

.al-eye {
    position: absolute;
    top: 50%;
    inset-inline-end: 9px;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    padding: 0;
    margin-top: -20px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: #5b6b8c;
    cursor: pointer;
    transition: color .2s ease, background-color .2s ease;
}

.al-eye:hover {
    background: #eef4fc;
    color: var(--al-blue-700);
}

.al-eye:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(22, 119, 230, .25);
    color: var(--al-blue-700);
}

.al-eye .al-icon {
    grid-area: 1 / 1;
    width: 22px;
    height: 22px;
    transition: opacity .2s ease, transform .3s var(--al-ease);
}

.al-eye__off {
    opacity: 0;
    transform: scale(.6) rotate(-25deg);
}

.al-eye.is-on .al-eye__on {
    opacity: 0;
    transform: scale(.6) rotate(25deg);
}

.al-eye.is-on .al-eye__off {
    opacity: 1;
    transform: none;
}

.al-error {
    display: flex;
    align-items: flex-start;
    gap: .4rem;
    margin: .5rem 0 0;
    font-size: .9rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--al-danger);
}

.al-error .al-icon {
    width: 17px;
    height: 17px;
    margin-top: 2px;
}

.al-remember {
    position: relative;
    margin: .4rem 0 1.8rem;
}

.al-check__input {
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    width: 24px;
    height: 24px;
    margin: 0;
    opacity: 0;
}

.al-check {
    display: inline-flex;
    align-items: center;
    gap: .7rem;
    min-height: 40px; /* comfortable touch target */
    margin: 0;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--al-ink);
    cursor: pointer;
    user-select: none;
}

.al-check__box {
    display: grid;
    place-items: center;
    flex: none;
    width: 24px;
    height: 24px;
    border: 1.5px solid var(--al-line);
    border-radius: 7px;
    background: #fff;
    transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.al-check__box .al-icon {
    width: 16px;
    height: 16px;
    stroke-width: 3;
    color: #fff;
    opacity: 0;
    transform: scale(.4);
    transition: opacity .15s ease, transform .25s var(--al-ease);
}

.al-check:hover .al-check__box {
    border-color: var(--al-line-hover);
}

.al-check__input:checked + .al-check .al-check__box {
    background: var(--al-blue);
    border-color: var(--al-blue);
}

.al-check__input:checked + .al-check .al-check__box .al-icon {
    opacity: 1;
    transform: none;
}

.al-check__input:focus-visible + .al-check .al-check__box {
    border-color: var(--al-blue);
    box-shadow: 0 0 0 4px rgba(22, 119, 230, .2);
}

.al-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .7rem;
    width: 100%;
    height: 62px;
    padding: 0 24px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #0673da 0%, #0a5fc4 50%, #084ca6 100%);
    background-size: 170% 100%;
    background-position: 0 0;
    color: #fff;
    font: inherit;
    font-size: 1.12rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 18px -9px rgba(10, 78, 168, .65);
    transition: background-position .5s var(--al-ease), box-shadow .25s ease, transform .2s var(--al-ease);
}

.al-btn:hover {
    background-position: 100% 0;
    transform: translateY(-1px);
    box-shadow: 0 13px 24px -11px rgba(10, 78, 168, .7);
}

.al-btn:active {
    transform: translateY(0) scale(.985);
    box-shadow: 0 5px 10px -7px rgba(10, 78, 168, .65);
}

.al-btn:focus-visible {
    outline: 3px solid rgba(22, 119, 230, .38);
    outline-offset: 3px;
}

.al-btn__icon {
    width: 22px;
    height: 22px;
    transition: transform .25s var(--al-ease);
}

.al-btn:hover .al-btn__icon {
    transform: scale(1.1);
}

.al-btn__spinner {
    display: none;
    flex: none;
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
}

.al-btn.is-loading {
    pointer-events: none;
    cursor: progress;
    background-position: 100% 0;
}

.al-btn.is-loading .al-btn__icon {
    display: none;
}

.al-btn.is-loading .al-btn__spinner {
    display: block;
    animation: al-spin .75s linear infinite;
}

.al-or {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 2rem 0 1.4rem;
    color: var(--al-placeholder);
    font-weight: 600;
}

.al-or::before,
.al-or::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #dfe4ee;
}

.al-links {
    display: flex;
    align-items: center;
    justify-content: center;
}

.al-link {
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    padding: .55rem .5rem;
    border-radius: 10px;
    color: var(--al-ink);
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: color .2s ease, background-color .2s ease;
}

.al-link .al-icon {
    transition: transform .25s var(--al-ease);
}

.al-link:hover,
.al-link:focus-visible {
    outline: 0;
    background: #f0f5fc;
    color: var(--al-blue-700);
    text-decoration: none;
}

.al-link:hover .al-icon {
    transform: scale(1.12);
}

.al-link:focus-visible {
    box-shadow: 0 0 0 3px rgba(22, 119, 230, .22);
}

/* a POST action shown as a link (e.g. "resend the code") */
.al-link-form {
    display: flex;
    flex: 1 1 0;
    margin: 0;
}

button.al-link {
    border: 0;
    background: transparent;
    font-family: inherit; /* not the font shorthand: it would reset .al-link's size and weight */
    cursor: pointer;
}

/* links right under a form (no "or" divider between them) */
.al-form + .al-links {
    margin-top: 1.4rem;
}

.al-links__sep {
    flex: none;
    width: 1px;
    height: 34px;
    background: #c9d0de;
}

/* ------------------------------------------------------------------ */
/* Animations (only when the visitor has not asked for reduced motion) */
/* ------------------------------------------------------------------ */

@keyframes al-spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes al-panel-in {
    from {
        opacity: 0;
        transform: translate3d(-28px, 0, 0);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes al-scale-in {
    from {
        opacity: 0;
        transform: scale(.88);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes al-fade-up {
    from {
        opacity: 0;
        transform: translate3d(0, 14px, 0);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes al-card-in {
    from {
        opacity: 0;
        transform: translate3d(0, 26px, 0);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes al-float {
    from {
        transform: translate3d(0, 0, 0);
    }
    to {
        transform: translate3d(0, -7px, 0);
    }
}

@keyframes al-wave-a {
    from {
        transform: translate3d(-2.5%, 1.2%, 0);
    }
    to {
        transform: translate3d(2.5%, -1.2%, 0);
    }
}

@keyframes al-wave-b {
    from {
        transform: translate3d(2.5%, 0, 0);
    }
    to {
        transform: translate3d(-3%, -1.8%, 0);
    }
}

@keyframes al-glow {
    from {
        transform: translate3d(0, 0, 0);
        opacity: .55;
    }
    to {
        transform: translate3d(14%, 10%, 0);
        opacity: .95;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .al-brand {
        animation: al-panel-in .85s var(--al-ease) both;
    }

    .al-logo__mark,
    .al-logo__custom {
        animation: al-scale-in .85s var(--al-ease) .2s both;
    }

    .al-logo__name {
        animation: al-fade-up .8s var(--al-ease) .62s both;
    }

    .al-logo__float {
        animation: al-float 8s ease-in-out 1.5s infinite alternate;
        will-change: transform;
    }

    .al-wave--a {
        animation: al-wave-a 34s ease-in-out infinite alternate;
        will-change: transform;
    }

    .al-wave--b {
        animation: al-wave-b 42s ease-in-out infinite alternate;
        will-change: transform;
    }

    .al-glow {
        animation: al-glow 46s ease-in-out infinite alternate;
        will-change: transform;
    }

    .al-card {
        animation: al-card-in .85s var(--al-ease) .1s both;
    }

    .al-stagger {
        animation: al-fade-up .65s var(--al-ease) calc(.3s + var(--i, 0) * .07s) both;
    }

    .al-lang__menu {
        animation: al-fade-up .2s var(--al-ease) both;
    }
}

@media (prefers-reduced-motion: reduce) {
    .al-auth *,
    .al-auth *::before,
    .al-auth *::after {
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }

    /* the loading indicator is feedback, not decoration: keep it, but as a gentle pulse instead of a spin */
    .al-btn.is-loading .al-btn__spinner {
        animation: al-pulse 1.2s ease-in-out infinite !important;
        animation-duration: 1.2s !important;
        animation-iteration-count: infinite !important;
    }
}

@keyframes al-pulse {
    50% {
        opacity: .35;
    }
}

/* ------------------------------------------------------------------ */
/* Dark mode (html[data-theme="dark"], set from localStorage ds.theme  */
/* by layouts/auth-split before the first paint). Screen only: a      */
/* printed page stays light.                                           */
/* ------------------------------------------------------------------ */

@media screen {
    html[data-theme="dark"] {
        color-scheme: dark; /* native parts: scrollbars, <select> option lists, date pickers */
        --al-ink: #e6ecf6;
        --al-muted: #a1adc2;
        --al-placeholder: #7f8ba3;
        --al-line: #34415a;
        --al-line-hover: #4b5873;
        --al-blue-700: #8ab4ff; /* used as a text colour (focused label, links): must stay readable on dark */
        --al-blue-900: #b9cdfb;
        --al-danger: #ff7b86;
    }

    html[data-theme="dark"] .al-body,
    html[data-theme="dark"] .al-panel {
        background: #0e1420;
    }

    /* the brand panel keeps its blue identity, one step deeper so it does not glare next to the dark form */
    html[data-theme="dark"] .al-brand {
        background:
            radial-gradient(55% 38% at 4% 27%, rgba(40, 145, 248, .35) 0%, rgba(40, 145, 248, 0) 72%),
            linear-gradient(135deg, #0a4f9e 0%, #07448a 30%, #053672 62%, #032a5c 100%);
    }

    html[data-theme="dark"] .al-lang__btn,
    html[data-theme="dark"] .al-theme {
        border-color: #2c374d;
        background: #161e2d;
        box-shadow: none;
    }

    html[data-theme="dark"] .al-theme:hover {
        color: #ffd27a;
    }

    html[data-theme="dark"] .al-lang__menu {
        border-color: #2c374d;
        background: #161e2d;
        box-shadow: 0 14px 34px -14px rgba(0, 0, 0, .7);
    }

    html[data-theme="dark"] .al-lang__item:hover,
    html[data-theme="dark"] .al-lang__item:focus-visible {
        background: #1f2a3e;
        color: #ffffff;
    }

    html[data-theme="dark"] .al-lang__item[aria-current="true"] {
        background: #1e2b4d;
        color: var(--al-blue-900);
    }

    /* fields */
    html[data-theme="dark"] .al-input,
    html[data-theme="dark"] .al-select__control {
        background: #161e2d;
    }

    html[data-theme="dark"] .al-input:focus,
    html[data-theme="dark"] .al-select__control:focus {
        border-color: #4a8af0;
        box-shadow: 0 0 0 4px rgba(74, 138, 240, .22);
    }

    html[data-theme="dark"] .al-input:-webkit-autofill,
    html[data-theme="dark"] .al-input:-webkit-autofill:focus {
        -webkit-box-shadow: 0 0 0 1000px #161e2d inset;
    }

    html[data-theme="dark"] .al-input--file::file-selector-button {
        background: #1e2b4d;
    }

    html[data-theme="dark"] .al-eye {
        color: var(--al-muted);
    }

    html[data-theme="dark"] .al-eye:hover {
        background: #1f2a3e;
    }

    html[data-theme="dark"] .al-check__box {
        background: #161e2d;
    }

    /* messages */
    html[data-theme="dark"] .al-flash .alert-success {
        border-color: #1f5a3c;
        background: #12291e;
        color: #8fe0b2;
    }

    html[data-theme="dark"] .al-flash .alert-danger {
        border-color: #6a2a31;
        background: #2e1519;
        color: #ffa3ab;
    }

    html[data-theme="dark"] .al-flash .alert-warning,
    html[data-theme="dark"] .al-flash .alert-info {
        border-color: #2c374d;
        background: #161e2d;
        color: var(--al-ink);
    }

    /* links under the form */
    html[data-theme="dark"] .al-or::before,
    html[data-theme="dark"] .al-or::after {
        background: #2c374d;
    }

    html[data-theme="dark"] .al-link:hover,
    html[data-theme="dark"] .al-link:focus-visible {
        background: #1f2a3e;
    }

    html[data-theme="dark"] .al-links__sep {
        background: #34415a;
    }

    html[data-theme="dark"] .al-btn {
        box-shadow: 0 8px 18px -9px rgba(0, 0, 0, .8);
    }
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

/* Side by side layouts: the brand panel stays in view (and the logo centred in the window) while a long form scrolls */
@media (min-width: 768px) {
    .al-brand {
        position: sticky;
        top: 0;
        align-self: start;
        height: 100vh;
        height: 100dvh;
    }
}

/* Narrower desktops / tablets (landscape): smaller brand column, stacked lockup */
@media (max-width: 1099.98px) {
    .al-auth {
        grid-template-columns: minmax(280px, 40%) minmax(0, 1fr);
    }

    .al-logo {
        width: min(100%, clamp(170px, 25vw, 290px));
    }
}

/* Phones and small tablets: the brand panel becomes a compact header */
@media (max-width: 767.98px) {
    .al-auth {
        display: flex;
        flex-direction: column;
    }

    .al-brand {
        flex: none;
        padding: 58px 20px 30px;
        border-bottom-left-radius: 28px;
        border-bottom-right-radius: 28px;
    }

    .al-logo {
        width: 140px;
    }

    .al-wave--b,
    .al-glow {
        display: none;
    }

    .al-wave--a {
        top: 90%; /* only a sliver at the bottom edge, below the logo */
        animation: none;
    }

    .al-logo__float {
        animation: none;
    }

    .al-topbar {
        top: 14px;
        right: 14px;
    }

    .al-topbar--extra {
        left: 14px;
        justify-content: space-between;
    }

    .al-lang__btn {
        height: 40px;
        padding: 0 13px;
        border-color: rgba(255, 255, 255, .45);
        background: rgba(255, 255, 255, .14);
        color: #fff;
        box-shadow: none;
    }

    .al-lang__btn:hover {
        border-color: rgba(255, 255, 255, .7);
        box-shadow: none;
    }

    /* on phones the switches sit on the blue header: translucent white in both modes */
    .al-theme,
    html[data-theme="dark"] .al-theme,
    html[data-theme="dark"] .al-lang__btn {
        border-color: rgba(255, 255, 255, .45);
        background: rgba(255, 255, 255, .14);
        color: #fff;
        box-shadow: none;
    }

    .al-theme {
        width: 40px;
        height: 40px;
    }

    .al-lang__menu {
        min-width: 176px;
    }

    .al-panel {
        flex: 1 0 auto;
        align-items: flex-start;
        padding: 30px 20px 40px;
    }

    .al-head {
        margin-bottom: 1.5rem;
    }

    .al-input,
    .al-select__control {
        height: 52px;
        font-size: 16px; /* avoids the iOS zoom-on-focus */
    }
}

@media (max-width: 419.98px) {
    .al-links {
        flex-direction: column;
        align-items: stretch;
    }

    .al-links__sep {
        display: none;
    }

    .al-link {
        flex: none;
        padding: .7rem .5rem;
    }
}

/* Short landscape screens: do not stretch the brand panel, let the page scroll */
@media (max-height: 560px) and (min-width: 768px) {
    .al-panel {
        align-items: flex-start;
    }
}
