/*
 * Sign-in pages (_AuthLayout: Login and the Super Admin code), part of the admin design system
 * (docs/markdown/back-office/admin-home/admin-design-system-lists-and-home-2026-10-22.md). Logical properties only, so
 * the page's dir="rtl" mirrors it.
 */

:root {
    --au-ink: #2f4050;
    --au-muted: #5f6b7a;
    --au-line: #dfe3e8;
    --au-surface: #ffffff;
    --au-page: #f3f3f4;
    --au-rail: #2f4050;
    --au-rail-text: #a7b1c2;
    --au-accent: #7f0d0d;
    --au-accent-hover: #651010;
    --au-accent-soft: #f6e9e9;
    --au-good: #1c7c54;
    --au-warn: #b36b12;
    --au-warn-soft: #fdf3e6;
    --au-bad: #c0392b;
    --au-bad-soft: #fbeaea;
    --au-info: #23628f;
    --au-info-soft: #e6f0f7;
}

.auth-body {
    min-height: 100vh;
    margin: 0;
    padding: 24px 16px;
    display: grid;
    place-items: center;
    background: var(--au-page);
    color: var(--au-ink);
    font-size: 14px;
}

.auth-frame {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
    width: 100%;
    max-width: 920px;
    min-height: 540px;
    overflow: hidden;
    border: 1px solid var(--au-line);
    border-radius: 10px;
    background: var(--au-surface);
    box-shadow: 0 10px 28px rgba(16, 24, 40, 0.1);
}

/* ------------------------------------------------------------------ brand panel */

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 28px;
    background: var(--au-rail) radial-gradient(circle at 85% 90%, rgba(127, 13, 13, 0.55), transparent 55%);
    color: #ffffff;
}

.auth-brand-name {
    display: flex;
    align-items: center;
    gap: 12px;
}

.auth-brand-name b {
    display: block;
    font-size: 20px;
}

.auth-brand-name span span {
    color: var(--au-rail-text);
    font-size: 13px;
}

.auth-mark {
    display: grid;
    flex: none;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--au-accent);
    color: #ffffff;
    font-size: 22px;
    font-weight: 700;
}

.auth-brand-line {
    max-width: 30ch;
    margin: auto 0 0;
    color: var(--au-rail-text);
    font-size: 14px;
}

/* Which environment this is (none in Production), so nobody tests on production by mistake. */
.auth-env {
    position: absolute;
    top: 14px;
    inset-inline-end: 14px;
    padding: 2px 8px;
    border-radius: 4px;
    background: #f8ac59;
    color: #2f2a20;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.auth-steps {
    display: grid;
    gap: 8px;
    margin: auto 0 0;
    padding: 0;
    list-style: none;
    counter-reset: auth-step;
}

.auth-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--au-rail-text);
    font-size: 13px;
    counter-increment: auth-step;
}

.auth-steps li::before {
    content: counter(auth-step);
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--au-rail-text);
    border-radius: 50%;
    font-size: 12px;
}

.auth-steps li.auth-step-done::before {
    content: "\2713";
    border-color: var(--au-good);
    background: var(--au-good);
    color: #ffffff;
}

.auth-steps li.auth-step-current {
    color: #ffffff;
    font-weight: 600;
}

.auth-steps li.auth-step-current::before {
    border-color: #ffffff;
    background: #ffffff;
    color: var(--au-ink);
}

/* ------------------------------------------------------------------ form side */

.auth-side {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 18px 24px 28px;
}

.auth-top {
    display: flex;
    justify-content: flex-end;
    margin: 0;
}

.auth-lang {
    padding: 3px 12px;
    border: 1px solid var(--au-line);
    border-radius: 999px;
    background: none;
    color: var(--au-ink);
    font-size: 13px;
}

.auth-lang:hover,
.auth-lang:focus {
    border-color: var(--au-accent);
    color: var(--au-accent);
}

.auth-card {
    display: grid;
    gap: 14px;
    width: 100%;
    max-width: 380px;
    margin: auto;
    padding-top: 12px;
}

.auth-card h1 {
    margin: 0;
    color: var(--au-ink);
    font-size: 22px;
    font-weight: 700;
}

.auth-card form {
    display: grid;
    gap: 14px;
    margin: 0;
}

.auth-sub {
    margin: 0;
    color: var(--au-muted);
    font-size: 13.5px;
}

.auth-sub b {
    color: var(--au-ink);
}

.auth-field {
    display: grid;
    gap: 5px;
}

.auth-field label {
    margin: 0;
    color: var(--au-ink);
    font-size: 13px;
    font-weight: 700;
}

/* 16px or more, so iPhone does not zoom in on focus. */
.auth-field .form-control {
    height: auto;
    padding: 10px 12px;
    border-color: var(--au-line);
    border-radius: 6px;
    font-size: 16px;
}

.auth-field .form-control:focus,
.auth-pass:focus-within {
    border-color: var(--au-accent);
    box-shadow: 0 0 0 3px var(--au-accent-soft);
}

.auth-field .field-validation-error {
    font-size: 12.5px;
}

.auth-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 10px;
}

.auth-link,
.auth-linkbtn {
    padding: 0;
    border: 0;
    background: none;
    color: var(--au-accent);
    font-size: 13px;
    font-weight: 600;
    text-align: start;
}

.auth-link:hover,
.auth-linkbtn:hover:not(:disabled) {
    color: var(--au-accent-hover);
    text-decoration: underline;
}

.auth-linkbtn:disabled {
    color: var(--au-muted);
    font-weight: 400;
    cursor: default;
}

.auth-pass {
    display: flex;
    overflow: hidden;
    border: 1px solid var(--au-line);
    border-radius: 6px;
    background: var(--au-surface);
}

.auth-pass .form-control,
.auth-pass .form-control:focus {
    flex: 1;
    min-width: 0;
    border: 0;
    box-shadow: none;
}

.auth-eye {
    padding: 0 12px;
    border: 0;
    background: none;
    color: var(--au-muted);
}

.auth-eye[aria-pressed="true"] {
    color: var(--au-accent);
}

.auth-caps {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--au-warn);
    font-size: 12.5px;
    font-weight: 600;
}

.auth-caps[hidden] {
    display: none;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 11px;
    border: 1px solid var(--au-accent);
    border-radius: 6px;
    background: var(--au-accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
}

.auth-submit:hover:not(:disabled),
.auth-submit:focus:not(:disabled) {
    background: var(--au-accent-hover);
    border-color: var(--au-accent-hover);
    color: #ffffff;
}

.auth-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.auth-spin {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

.auth-spin[hidden] {
    display: none;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

.auth-alert {
    margin: 0;
    padding: 9px 12px;
    border-radius: 6px;
    background: var(--au-bad-soft);
    color: var(--au-bad);
    font-size: 13px;
    font-weight: 600;
}

.auth-alert ul {
    margin: 0;
    padding-inline-start: 18px;
}

.auth-alert-success {
    background: #e5f4ec;
    color: var(--au-good);
}

.auth-alert-info {
    background: var(--au-info-soft);
    color: var(--au-info);
}

.auth-alert-warning {
    background: var(--au-warn-soft);
    color: var(--au-warn);
}

/* The validation summary renders even when empty; hide it until it holds an error. */
.auth-alert.validation-summary-valid {
    display: none;
}

.auth-foot {
    margin: 0;
    color: var(--au-muted);
    font-size: 12px;
    text-align: center;
}

.auth-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: var(--au-accent-soft);
    color: var(--au-accent);
    font-size: 20px;
}

/* ------------------------------------------------------------------ the emailed code */

.auth-otp {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    direction: ltr;
}

.auth-otp[hidden] {
    display: none;
}

.auth-otp input {
    width: 46px;
    min-width: 0;
    height: 54px;
    padding: 0;
    border: 1px solid var(--au-line);
    border-radius: 8px;
    background: var(--au-surface);
    color: var(--au-ink);
    font: 600 22px Consolas, "Courier New", monospace;
    text-align: center;
}

.auth-otp input:focus {
    border-color: var(--au-accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--au-accent-soft);
}

.auth-otp.auth-otp-error input {
    border-color: var(--au-bad);
}

.auth-otp-gap {
    flex: none;
    width: 6px;
    height: 2px;
    background: var(--au-line);
}

.auth-code-input {
    font-family: Consolas, "Courier New", monospace;
    letter-spacing: 0.12em;
    text-align: center;
}

/* The trust-this-browser switch. */
.auth-trust {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

.auth-trust b {
    display: block;
    font-size: 13px;
}

.auth-trust small {
    display: block;
    color: var(--au-muted);
    font-size: 12px;
}

.auth-switch {
    position: relative;
    flex: none;
    width: 38px;
    height: 22px;
    margin-top: 1px;
}

.auth-switch input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.auth-switch input + span {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: #c9ced6;
    pointer-events: none;
    transition: background 0.15s;
}

.auth-switch input + span::after {
    content: "";
    position: absolute;
    top: 3px;
    inset-inline-start: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.25);
    transition: inset-inline-start 0.15s;
}

.auth-switch input:checked + span {
    background: var(--au-accent);
}

.auth-switch input:checked + span::after {
    inset-inline-start: 19px;
}

.auth-switch input:focus-visible + span {
    outline: 2px solid var(--au-accent);
    outline-offset: 2px;
}

.auth-step[hidden] {
    display: none;
}

.auth-step {
    display: grid;
    gap: 14px;
}

.auth-card form.auth-row {
    display: flex;
    gap: 4px 6px;
}

.auth-back {
    justify-self: center;
    margin-top: 4px;
}

/* ------------------------------------------------------------------ phone: the brand shrinks to a strip */

@media (max-width: 768px) {
    .auth-body {
        padding: 0;
        place-items: stretch;
        background: var(--au-surface);
    }

    .auth-frame {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto 1fr;
        min-height: 100vh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .auth-brand {
        flex-direction: row;
        align-items: center;
        padding: 12px 16px;
    }

    .auth-mark {
        width: 30px;
        height: 30px;
        border-radius: 7px;
        font-size: 15px;
    }

    .auth-brand-name b {
        font-size: 16px;
    }

    .auth-brand-name span span,
    .auth-brand-line,
    .auth-steps {
        display: none;
    }

    .auth-env {
        position: static;
        margin-inline-start: auto;
    }

    .auth-side {
        padding: 12px 16px 24px;
    }

    .auth-card {
        margin-top: 8px;
    }

    .auth-otp input {
        width: 42px;
        height: 50px;
    }
}
