/* ============================================================
   Sign in / sign up (Views/Authentication, layout Views/Shared/Site/_AuthLayout): one card in the middle of the
   site's background, Ajebhom peeking over its top edge; for a password it ducks behind the edge (auth.js).
   The fields, the six code boxes, the password meter, Google and the legal note. Classes start with au-.
   ============================================================ */

.au-body {
    min-height: 100vh;
    background-color: var(--ds-bg);
    background-image:
        radial-gradient(620px 420px at 88% -6%, rgba(201, 29, 19, .11), transparent 70%),
        radial-gradient(560px 420px at 6% 104%, rgba(201, 29, 19, .08), transparent 70%),
        linear-gradient(var(--ds-grid) 1px, transparent 1px),
        linear-gradient(90deg, var(--ds-grid) 1px, transparent 1px);
    background-size: auto, auto, 40px 40px, 40px 40px;
}

.au-main {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 26px clamp(20px, 5vw, 72px) 30px;
}

.au-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.au-logo img {
    height: 30px;
    width: auto;
}

.au-top-end {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* the card */
.au-box {
    position: relative;
    width: min(100%, 444px);
    margin: 124px auto 0;
    padding: 34px 32px 28px;
    border-radius: 28px;
    background: var(--ds-surface);
    border: 1px solid var(--ds-line-soft);
    border-top: 4px solid var(--ds-red);
    box-shadow: var(--ds-shadow-lg);
    animation: au-in .5s ease both;
}

    .au-box h1 {
        margin: 0 0 6px !important;
        font-size: 27px;
        font-weight: 800;
        line-height: 1.4;
        color: var(--ds-ink);
    }

@keyframes au-in {
    from { opacity: 0; transform: translateY(10px); }
}

.au-sub {
    margin: 0 0 22px !important;
    font-size: 15.5px;
    line-height: 1.9;
    color: var(--ds-text);
}

/* sign up: the three steps */
.au-steps {
    display: flex;
    gap: 8px;
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
}

    .au-steps li {
        flex: 1;
        display: flex;
        align-items: center;
        gap: 8px;
        padding-bottom: 8px;
        border-bottom: 3px solid var(--ds-line);
        font-size: 13px;
        font-weight: 700;
        color: var(--ds-muted);
    }

        .au-steps li i {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            border-radius: 50%;
            background: var(--ds-line-soft);
            font-size: 12px;
            font-style: normal;
        }

        .au-steps li.is-on {
            border-color: var(--ds-red);
            color: var(--ds-red);
        }

            .au-steps li.is-on i {
                background: var(--ds-red);
                color: #FFF;
            }

        .au-steps li.is-done {
            border-color: var(--ds-ok-bright);
            color: var(--ds-ok);
        }

            .au-steps li.is-done i {
                background: var(--ds-ok-soft);
                color: transparent;
                position: relative;
            }

                .au-steps li.is-done i::after {
                    content: "\f00c";
                    position: absolute;
                    font-family: "Font Awesome 5 Free";
                    font-weight: 900;
                    font-size: 10px;
                    color: var(--ds-ok);
                }

/* the email the flow is about */
.au-who {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 20px;
    padding: 10px 14px;
    border-radius: 14px;
    background: var(--ds-tint);
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ds-ink);
}

    .au-who i {
        color: var(--ds-red);
    }

    .au-who a {
        margin-inline-start: auto;
        font-size: 13px;
        color: var(--ds-red) !important;
    }

/* fields */
.au-form {
    display: grid;
    gap: 16px;
}

.au-field label {
    display: block;
    margin-bottom: 7px;
    font-size: 14px;
    font-weight: 700;
    color: var(--ds-ink);
}

.au-input {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 54px;
    padding-inline: 16px 8px;
    border-radius: 14px;
    background: var(--ds-surface);
    border: 1.5px solid var(--ds-input-line);
    transition: border-color .2s ease, box-shadow .2s ease;
}

    .au-input > i {
        width: 18px;
        text-align: center;
        color: var(--ds-muted);
    }

    .au-input input {
        flex: 1;
        min-width: 0;
        height: 100%;
        border: 0;
        outline: 0;
        background: transparent;
        font-size: 16px;
        color: var(--ds-ink);
    }

        /* the box shows the focus (its ring), not the input inside it */
        .au-input input:focus,
        .au-input input:focus-visible {
            outline: none;
            box-shadow: none;
        }

        .au-input input::placeholder {
            color: var(--ds-placeholder);
        }

    .au-input:focus-within {
        border-color: var(--ds-red);
        box-shadow: var(--ds-ring);
    }

        .au-input:focus-within > i {
            color: var(--ds-red);
        }

    .au-input.is-bad {
        border-color: #E5484D;
    }

.is-shake {
    animation: au-shake .4s ease;
}

@keyframes au-shake {
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.au-eye {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--ds-muted);
}

    .au-eye:hover {
        background: var(--ds-soft);
        color: var(--ds-ink);
    }

.au-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #D93036;
}

    .au-error[hidden] {
        display: none;
    }

.au-error-center {
    margin-top: -4px;
    text-align: center;
}

.au-hint {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: var(--ds-muted);
}

/* under the login button, centred */
.au-forgot {
    justify-self: center;
    margin-top: 2px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--ds-red) !important;
}

.au-submit {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
}

/* the password's strength: four bars and a word */
.au-meter {
    display: grid;
    grid-template-columns: repeat(4, 1fr) auto;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

    .au-meter i {
        height: 5px;
        border-radius: 3px;
        background: var(--ds-line);
        transition: background .25s ease;
    }

    .au-meter span {
        min-width: 50px;
        font-size: 12px;
        font-weight: 800;
        text-align: end;
    }

    .au-meter[data-level="1"] i:nth-child(-n + 1) { background: #E5484D; }
    .au-meter[data-level="2"] i:nth-child(-n + 2) { background: var(--ds-warn); }
    .au-meter[data-level="3"] i:nth-child(-n + 3) { background: var(--ds-ok-bright); }
    .au-meter[data-level="4"] i { background: var(--ds-ok-bright); }
    .au-meter[data-level="1"] span { color: #E5484D; }
    .au-meter[data-level="2"] span { color: var(--ds-warn); }
    .au-meter[data-level="3"] span,
    .au-meter[data-level="4"] span { color: var(--ds-ok); }

/* the code: six boxes */
.au-otp {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 10px;
}

    .au-otp input {
        width: 100%;
        height: 62px;
        border-radius: 14px;
        background: var(--ds-surface);
        border: 1.5px solid var(--ds-input-line);
        outline: 0;
        font-family: var(--ds-mono);
        font-size: 26px;
        font-weight: 700;
        text-align: center;
        color: var(--ds-ink);
        transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
    }

        .au-otp input:focus,
        .au-otp input:focus-visible {
            outline: none;
        }

        .au-otp input:focus {
            border-color: var(--ds-red);
            box-shadow: var(--ds-ring);
            transform: translateY(-2px);
        }

    .au-otp.is-full input {
        border-color: var(--ds-ok-bright);
    }

    .au-otp.is-bad input {
        border-color: #E5484D;
    }

.au-resend {
    display: flex;
    justify-content: center;
    font-size: 13.5px;
    color: var(--ds-muted);
}

    .au-resend span[hidden],
    .au-resend button[hidden] {
        display: none;
    }

    .au-resend button {
        border: 0;
        background: none;
        font-weight: 800;
        color: var(--ds-red);
    }

/* or Google */
.au-or {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 16px;
    font-size: 13px;
    color: var(--ds-muted);
}

    .au-or::before,
    .au-or::after {
        content: "";
        flex: 1;
        height: 1px;
        background: var(--ds-line);
    }

.au-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 52px;
    border-radius: var(--ds-r-pill);
    background: var(--ds-surface);
    border: 1.5px solid var(--ds-line);
    font-size: 15px;
    font-weight: 700;
    color: var(--ds-ink) !important;
    transition: border-color .2s ease, background .2s ease;
}

    .au-google:hover {
        border-color: var(--ds-input-line);
        background: var(--ds-soft);
    }

.au-switch {
    margin: 20px 0 0 !important;
    font-size: 14.5px;
    text-align: center;
    color: var(--ds-text);
}

    .au-switch a {
        font-weight: 800;
        color: var(--ds-red) !important;
    }

.au-legal {
    margin: 14px 0 0 !important;
    font-size: 12.5px;
    line-height: 1.9;
    text-align: center;
    color: var(--ds-muted);
}

    .au-legal a {
        color: var(--ds-text) !important;
        text-decoration: underline;
    }

/* the robot over the card's top edge, at its inline-start side; its words beside it toward the middle */
.au-perch {
    position: absolute;
    bottom: 100%;
    inset-inline-start: 26px;
}

    .au-perch .ab-actor {
        --ab-size: 180px;
        --ab-peek: 118px;
        position: relative;
    }

    .au-perch .ab-say {
        bottom: 48px;
        inset-inline-start: 158px;
        max-width: min(240px, calc(100vw - 220px));
    }

    /* ducking: it slides down behind the edge, the antenna still showing */
    .au-perch .ab-float {
        transition: translate .38s cubic-bezier(.4, 0, .2, 1);
    }

    .au-perch .ab-actor.is-ducked .ab-float {
        translate: 0 46%;
    }

/* what an account gives, under the card */
.au-perks {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 22px;
    max-width: 680px;
    margin: 26px auto 8px;
    padding: 0;
    list-style: none;
}

    .au-perks li {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 13.5px;
        font-weight: 600;
        color: var(--ds-text);
    }

        .au-perks li i {
            color: var(--ds-red);
        }

/* the server's own messages (asp-validation-for), and a whole-form error (asp-validation-summary) */
.au-field .field-validation-error,
.au-form .validation-summary-errors {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
    color: #D93036;
}

    .au-form .validation-summary-errors ul {
        margin: 0;
        padding: 0;
        list-style: none;
    }

.au-form .input-validation-error {
    border-color: #D93036;
}

/* the captcha is still loading: the form waits (components/captcha) and says so */
.au-captcha-wait {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0 0 !important;
    padding: 9px 12px;
    border-radius: 10px;
    background: var(--ds-warn-soft);
    font-size: 13px;
    font-weight: 700;
    color: var(--ds-warn);
}

    .au-captcha-wait[hidden] {
        display: none;
    }

.is-captcha-wait .au-submit {
    opacity: .6;
    cursor: progress;
}

/* the forgot-password link is a button (it posts the email to send the code) */
button.au-forgot {
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    cursor: pointer;
}

/* ---------- responsive ---------- */
@media (max-width: 991px) {
    .au-main {
        padding-top: 22px;
    }
}

@media (max-width: 575px) {
    .au-box {
        margin-top: 100px;
        padding: 28px 20px 24px;
        border-radius: 24px;
    }

        .au-box h1 {
            font-size: 25px;
        }

    .au-otp {
        gap: 7px;
    }

        .au-otp input {
            height: 54px;
            font-size: 22px;
        }

    .au-perch {
        inset-inline-start: 12px;
    }

        .au-perch .ab-actor {
            --ab-size: 140px;
            --ab-peek: 92px;
        }

        .au-perch .ab-say {
            bottom: 38px;
            inset-inline-start: 122px;
            max-width: calc(100vw - 168px);
            padding: 7px 11px;
            font-size: 12.5px;
        }

    .au-perks {
        flex-direction: column;
        align-items: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    .is-shake,
    .au-box {
        animation: none;
    }

    .au-perch .ab-float {
        transition: none;
    }
}
