/* Authentication UI: customer-facing login and password-change screens. */
.fix-auth-body {
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 12% 12%, rgb(205 197 255 / 0.28), transparent 28rem),
        linear-gradient(135deg, #fbfbff, #f5f7ff 58%, #fdf7fc);
    color: #17154f;
    font-family: 'Instrument Sans', 'Noto Sans Arabic', ui-sans-serif, system-ui, sans-serif;
}

.fix-auth-body button,
.fix-auth-body input {
    font: inherit;
}

.fix-auth-skip {
    position: fixed;
    z-index: 20;
    inset-block-start: 1rem;
    inset-inline-start: 1rem;
    padding: 0.7rem 1rem;
    border-radius: 0.8rem;
    background: #17154f;
    color: #fff;
    transform: translateY(-160%);
}

.fix-auth-skip:focus {
    transform: translateY(0);
}

.fix-auth-shell {
    display: grid;
    width: min(1180px, calc(100% - 2rem));
    min-height: min(760px, calc(100svh - 2rem));
    margin: 1rem auto;
    grid-template-columns: minmax(0, 1.05fr) minmax(24rem, 0.95fr);
    overflow: hidden;
    direction: rtl;
    border: 1px solid rgb(68 55 216 / 0.12);
    border-radius: 2rem;
    background: #fff;
    box-shadow: 0 2rem 5rem rgb(39 28 126 / 0.12);
}

[dir='ltr'] .fix-auth-shell {
    direction: ltr;
}

.fix-auth-form-panel {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    padding: clamp(1.5rem, 5vw, 4.5rem);
    background: rgb(255 255 255 / 0.97);
}

.fix-auth-brand {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.7rem;
    color: #17154f;
    text-decoration: none;
}

.fix-auth-brand img {
    width: 3rem;
    height: 3rem;
    object-fit: contain;
}

.fix-auth-brand span {
    display: grid;
    gap: 0.1rem;
}

.fix-auth-brand strong {
    font-size: 1.2rem;
    letter-spacing: 0.08em;
}

.fix-auth-brand small {
    color: #79799d;
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.14em;
}

.fix-auth-home-link {
    display: inline-flex;
    width: fit-content;
    align-items: center;
    gap: 0.45rem;
    margin-block-start: 1.25rem;
    padding: 0.65rem 1rem;
    border: 1px solid rgb(101 77 226 / 0.22);
    border-radius: 999px;
    background: linear-gradient(135deg, #f5f2ff, #eefaff);
    box-shadow: 0 0.5rem 1.2rem rgb(74 57 180 / 0.1);
    color: #5140c9;
    font-size: 0.8rem;
    font-weight: 850;
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.fix-auth-home-link:hover {
    border-color: rgb(101 77 226 / 0.42);
    background: linear-gradient(135deg, #eee9ff, #e4f7ff);
    box-shadow: 0 0.75rem 1.5rem rgb(74 57 180 / 0.16);
    color: #382a9f;
    transform: translateY(-1px);
}

.fix-auth-heading {
    max-width: 34rem;
    margin-block: 2.75rem 2rem;
}

.fix-auth-kicker {
    margin: 0 0 0.75rem;
    color: #18a9dc;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.fix-auth-welcome {
    margin: 0 0 0.45rem;
    color: #654de2;
    font-size: 0.9rem;
    font-weight: 800;
}

.fix-auth-heading h1 {
    margin: 0;
    color: #17154f;
    font-size: clamp(2rem, 4vw, 3.15rem);
    line-height: 1.15;
    letter-spacing: -0.04em;
}

.fix-auth-heading > p:last-child {
    margin: 1rem 0 0;
    color: #696b90;
    font-size: 0.98rem;
    line-height: 1.9;
}

.fix-auth-alert {
    margin-block: 0 1.25rem;
    padding: 0.9rem 1rem;
    border: 1px solid;
    border-radius: 0.9rem;
    font-size: 0.86rem;
    line-height: 1.7;
}

.fix-auth-alert strong,
.fix-auth-alert p {
    margin: 0;
}

.fix-auth-alert p {
    margin-top: 0.25rem;
}

.fix-auth-alert--error {
    border-color: rgb(190 63 83 / 0.22);
    background: #fff5f6;
    color: #a12f4d;
}

.fix-auth-alert--success {
    border-color: rgb(38 155 119 / 0.24);
    background: #f0fcf7;
    color: #197457;
}

.fix-auth-form {
    display: grid;
    max-width: 34rem;
    gap: 1.15rem;
}

.fix-auth-field {
    display: grid;
    min-width: 0;
    gap: 0.45rem;
}

.fix-auth-field label,
.fix-auth-check {
    color: #25245c;
    font-size: 0.82rem;
    font-weight: 800;
}

.fix-auth-field input {
    box-sizing: border-box;
    width: 100%;
    min-height: 3.35rem;
    padding: 0.8rem 1rem;
    border: 1px solid #dfdff0;
    border-radius: 0.95rem;
    outline: 0;
    background: #fff;
    color: #17154f;
    transition: border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.fix-auth-field input::placeholder {
    color: #aaa9bf;
}

.fix-auth-field input:hover {
    border-color: #bcb8ed;
}

.fix-auth-field input:focus {
    border-color: #654de2;
    background: #fff;
    box-shadow: 0 0 0 4px rgb(101 77 226 / 0.12);
}

.fix-auth-field input[aria-invalid='true'] {
    border-color: #c74b65;
}

.fix-auth-help {
    color: #8889a7;
    font-size: 0.72rem;
}

.fix-auth-field-error {
    margin: 0;
    color: #b12f4d;
    font-size: 0.75rem;
    line-height: 1.6;
}

.fix-auth-password-wrap {
    position: relative;
}

.fix-auth-password-wrap input {
    padding-inline-end: 4.5rem;
}

.fix-auth-password-toggle {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-end: 0.65rem;
    min-width: 3rem;
    padding: 0.3rem;
    border: 0;
    background: transparent;
    color: #654de2;
    cursor: pointer;
    font-size: 0.72rem;
    font-weight: 800;
    transform: translateY(-50%);
}

.fix-auth-password-toggle:hover,
.fix-auth-password-toggle:focus-visible {
    color: #18a9dc;
}

.fix-auth-form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.fix-auth-check {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.fix-auth-check input {
    width: 1rem;
    height: 1rem;
    accent-color: #654de2;
}

.fix-auth-secure-note {
    color: #9999b0;
    font-size: 0.72rem;
}

.fix-auth-submit {
    display: inline-flex;
    min-height: 3.5rem;
    align-items: center;
    justify-content: center;
    gap: 0.7rem;
    border: 0;
    border-radius: 1rem;
    background: #211f26;
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    transition: background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.fix-auth-submit:hover {
    background: #3f3656;
    box-shadow: 0 0.75rem 1.5rem rgb(33 31 38 / 0.14);
    transform: translateY(-1px);
}

.fix-auth-submit:focus-visible,
.fix-auth-logout:focus-visible,
.fix-auth-back-link:focus-visible,
.fix-auth-brand:focus-visible,
.fix-auth-password-toggle:focus-visible {
    outline: 3px solid rgb(24 169 220 / 0.45);
    outline-offset: 3px;
}

.fix-auth-support {
    margin: 1.35rem 0 0;
    color: #8889a7;
    font-size: 0.8rem;
    line-height: 1.8;
}

.fix-auth-support a,
.fix-auth-back-link {
    color: #654de2;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 0.2em;
}

.fix-auth-secondary-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    max-width: 34rem;
    margin-top: 1.5rem;
}

.fix-auth-logout {
    padding: 0.55rem 0.85rem;
    border: 1px solid #e2e1ee;
    border-radius: 0.75rem;
    background: #fff;
    color: #6f6f93;
    cursor: pointer;
    font-size: 0.78rem;
}

.fix-auth-logout:hover {
    border-color: #bcb8ed;
    color: #654de2;
}

.fix-auth-visual-panel {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 30rem;
    align-items: flex-end;
    overflow: hidden;
    padding: clamp(1.5rem, 5vw, 4.5rem);
    isolation: isolate;
    background: #221b72;
    color: #fff;
}

.fix-auth-visual-panel > img,
.fix-auth-visual-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.fix-auth-visual-panel > img {
    z-index: -2;
    object-fit: cover;
    object-position: center;
    opacity: 0.56;
}

.fix-auth-visual-overlay {
    z-index: -1;
    background: linear-gradient(145deg, rgb(50 27 151 / 0.88), rgb(13 158 211 / 0.45) 52%, rgb(237 141 210 / 0.48));
}

.fix-auth-visual-content {
    position: relative;
    z-index: 1;
    max-width: 24rem;
}

.fix-auth-visual-logo {
    display: grid;
    width: 4.5rem;
    height: 4.5rem;
    margin-bottom: 1.25rem;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 0.42);
    border-radius: 1.35rem 0.45rem 1.35rem 0.45rem;
    background: rgb(255 255 255 / 0.13);
    color: #fff;
    font-size: 1.65rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.fix-auth-visual-content .fix-auth-kicker {
    color: #a9f1ff;
}

.fix-auth-visual-content h2 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.fix-auth-visual-content > p:not(.fix-auth-kicker) {
    max-width: 22rem;
    margin: 1rem 0 0;
    color: rgb(255 255 255 / 0.84);
    line-height: 1.9;
}

.fix-auth-visual-line {
    display: block;
    width: 4rem;
    height: 0.25rem;
    margin-top: 2rem;
    border-radius: 999px;
    background: #a9f1ff;
}

@media (max-width: 760px) {
    .fix-auth-shell {
        grid-template-columns: 1fr;
        width: min(100% - 1rem, 34rem);
        min-height: calc(100svh - 1rem);
        margin: 0.5rem auto;
        border-radius: 1.35rem;
    }

    .fix-auth-form-panel {
        order: 1;
        padding: 1.5rem 1.25rem 1.75rem;
    }

    .fix-auth-visual-panel {
        order: 2;
        min-height: 15rem;
        padding: 1.5rem 1.25rem;
    }

    .fix-auth-heading {
        margin-block: 2rem 1.5rem;
    }

    .fix-auth-heading h1 {
        font-size: clamp(1.9rem, 9vw, 2.5rem);
    }

    .fix-auth-visual-content h2 {
        font-size: 2rem;
    }
}

/* Login redesign: intentionally scoped so the password-change screen keeps its existing layout. */
.fix-auth-shell:has(.fix-auth-login-panel) {
    width: min(1280px, calc(100% - clamp(1.25rem, 5vw, 4rem)));
    min-height: min(820px, calc(100svh - clamp(1.5rem, 5vw, 4rem)));
    grid-template-columns: minmax(0, 1.12fr) minmax(28rem, 0.88fr);
    border: 1px solid rgb(24 94 176 / 0.14);
    border-radius: 2.25rem;
    background: #fff;
    box-shadow: 0 2rem 5rem rgb(16 57 112 / 0.14);
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-form-panel {
    box-sizing: border-box;
    padding: clamp(2rem, 5vw, 5rem);
    background: #fff;
}

.fix-auth-login-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
}

.fix-auth-login-topbar .fix-auth-home-link {
    margin-block-start: 0;
    white-space: nowrap;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-heading {
    max-width: 31rem;
    margin-block: clamp(3rem, 7vh, 5.5rem) 2.25rem;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-heading h1 {
    font-size: clamp(2.25rem, 4vw, 3.65rem);
    letter-spacing: -0.045em;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-heading > p:last-child {
    max-width: 27rem;
    margin-top: 1.15rem;
    color: #667b9d;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-login-form {
    max-width: 31rem;
    gap: 1.35rem;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-field input {
    min-height: 3.65rem;
    border-color: #d9e2f0;
    border-radius: 0.9rem;
    background: #fbfdff;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-field input:hover {
    border-color: #9bbadd;
    background: #fff;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-field input:focus {
    border-color: #2877c8;
    box-shadow: 0 0 0 4px rgb(40 119 200 / 0.13);
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-login-submit {
    min-height: 3.8rem;
    margin-top: 0.2rem;
    border-radius: 0.9rem;
    background: linear-gradient(115deg, #1559a8, #168fc7);
    box-shadow: 0 0.9rem 1.75rem rgb(23 105 183 / 0.2);
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-login-submit:hover {
    background: linear-gradient(115deg, #104887, #127cae);
    box-shadow: 0 1.1rem 2rem rgb(23 105 183 / 0.28);
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-support {
    max-width: 31rem;
    margin-top: 1.65rem;
    color: #7d8eaa;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-support a,
.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-back-link {
    color: #1768b5;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-panel {
    box-sizing: border-box;
    min-height: 0;
    align-items: flex-end;
    padding: clamp(2rem, 5vw, 5rem);
    background: #0e4c91;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-panel > img {
    object-position: center 58%;
    opacity: 0.94;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-overlay {
    background:
        linear-gradient(180deg, rgb(6 36 78 / 0.05) 20%, rgb(6 36 78 / 0.78) 100%),
        linear-gradient(135deg, rgb(11 67 137 / 0.48), rgb(17 161 207 / 0.08) 58%, rgb(8 44 89 / 0.48));
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-content {
    max-width: 28rem;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-logo {
    width: 4.25rem;
    height: 4.25rem;
    margin-bottom: 1.4rem;
    border-color: rgb(255 255 255 / 0.62);
    border-radius: 1.2rem 0.45rem 1.2rem 0.45rem;
    background: rgb(8 54 111 / 0.3);
    box-shadow: 0 0.9rem 2rem rgb(3 27 63 / 0.18);
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-content h2 {
    font-size: clamp(2rem, 4vw, 3.8rem);
    text-wrap: balance;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-line {
    width: 5rem;
    background: #8ee9ff;
}

@keyframes fix-auth-login-rise {
    from {
        opacity: 0;
        transform: translateY(0.75rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fix-auth-login-image-in {
    from {
        opacity: 0.72;
        transform: scale(1.035);
    }

    to {
        opacity: 0.94;
        transform: scale(1);
    }
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-login-panel > *,
.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-content {
    animation: fix-auth-login-rise 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-login-panel > *:nth-child(2) {
    animation-delay: 80ms;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-login-panel > *:nth-child(3) {
    animation-delay: 150ms;
}

.fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-panel > img {
    animation: fix-auth-login-image-in 800ms ease-out both;
}

@media (max-width: 1080px) {
    .fix-auth-shell:has(.fix-auth-login-panel) {
        width: min(100% - 2rem, 64rem);
        min-height: 0;
        grid-template-columns: 1fr;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-panel {
        order: -1;
        min-height: clamp(15rem, 34vw, 22rem);
        padding: clamp(1.75rem, 5vw, 3.5rem);
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-form-panel {
        min-height: 0;
        padding: clamp(2rem, 6vw, 4rem);
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-heading {
        margin-block: 2.75rem 2rem;
    }
}

@media (max-width: 600px) {
    .fix-auth-shell:has(.fix-auth-login-panel) {
        width: calc(100% - 1rem);
        margin: 0.5rem auto;
        border-radius: 1.35rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-login-topbar {
        align-items: flex-start;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-brand img {
        width: 2.65rem;
        height: 2.65rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-brand small {
        max-width: 8rem;
        font-size: 0.5rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-home-link {
        padding: 0.55rem 0.7rem;
        font-size: 0.72rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-panel {
        min-height: clamp(13rem, 48vw, 17rem);
        padding: 1.5rem 1.25rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-content {
        max-width: 18rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-logo {
        width: 3rem;
        height: 3rem;
        margin-bottom: 0.7rem;
        border-radius: 0.85rem 0.3rem 0.85rem 0.3rem;
        font-size: 1.1rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-content h2 {
        font-size: clamp(1.45rem, 7vw, 2rem);
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-content > p:not(.fix-auth-kicker) {
        margin-top: 0.55rem;
        font-size: 0.82rem;
        line-height: 1.7;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-heading {
        margin-block: 2.25rem 1.5rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-heading h1 {
        font-size: clamp(1.85rem, 10vw, 2.55rem);
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-heading > p:last-child {
        margin-top: 0.85rem;
        font-size: 0.9rem;
        line-height: 1.8;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-form-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.7rem;
    }
}

@media (min-width: 1081px) {
    .fix-auth-body:has(.fix-auth-login-panel) {
        min-height: 0;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) {
        box-sizing: border-box;
        min-height: calc(100svh - 2rem);
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-form-panel {
        padding: clamp(1.5rem, 3vw, 2.75rem);
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-brand img {
        width: 2.7rem;
        height: 2.7rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-brand strong {
        font-size: 1.05rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-heading {
        margin-block: clamp(1.25rem, 3.5vh, 2.25rem) 1.35rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-heading h1 {
        font-size: clamp(2rem, 3vw, 2.85rem);
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-heading > p:last-child {
        margin-top: 0.75rem;
        font-size: 0.9rem;
        line-height: 1.7;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-login-form {
        gap: 0.85rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-field input {
        min-height: 3.15rem;
        padding-block: 0.65rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-login-submit {
        min-height: 3.25rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-support {
        margin-top: 0.85rem;
        font-size: 0.75rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-panel {
        padding: clamp(1.5rem, 3vw, 2.75rem);
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-logo {
        width: 3.75rem;
        height: 3.75rem;
        margin-bottom: 0.9rem;
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-content h2 {
        font-size: clamp(1.8rem, 3vw, 3rem);
    }

    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-content > p:not(.fix-auth-kicker) {
        margin-top: 0.7rem;
        font-size: 0.9rem;
        line-height: 1.7;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fix-auth-field input,
    .fix-auth-submit,
    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-login-panel > *,
    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-content,
    .fix-auth-shell:has(.fix-auth-login-panel) .fix-auth-visual-panel > img {
        transition: none;
        animation: none;
    }
}
