/* Auth pages (Nocturne): registration, login and the other account forms. Global (not scoped) so every account page shares it.
   Tokens: nocturne.css. Loaded after nocturne.css (see App.razor). */

.au-page {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: calc(var(--nx-pad) * 1.4) var(--nx-pad);
    background: radial-gradient(70% 80% at 50% 50%, rgba(22, 24, 38, .2), rgba(22, 24, 38, .7)),
                url('/img/home/auth-bg.webp') center / cover #161826;
}

.au-card {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 440px;
    overflow: hidden;
    border: 1px solid rgba(233, 233, 237, .16);
    border-radius: var(--nx-radius);
    background: rgba(22, 24, 38, .74);
    box-shadow: var(--nx-shadow-lg);
    color: #e9e9ed;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
}

.au-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 22px 28px 20px;
}

/* ---- logo + title: wide logo on desktop, round mark on tablet/phone --------------------------------- */

.au-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
}

/* Tablet/phone: the round badge (logo.png) fills a circle; it already has its own ring and white inside. */
.au-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 112px;
    height: 112px;
    overflow: hidden;
    border-radius: 50%;
    box-shadow: 0 0 0 3px rgba(145, 132, 217, .45), 0 8px 24px rgba(0, 0, 0, .45);
}

.au-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Desktop: the wide logo (transparent, made for dark backgrounds) sits straight on the card - no plate, no ring. */
@media (min-width: 1024px) {
    .au-logo {
        width: auto;
        height: auto;
        padding: 0;
        overflow: visible;
        border-radius: 0;
        background: none;
        box-shadow: none;
    }

    .au-logo img {
        width: 300px;
        height: auto;
        object-fit: contain;
        filter: drop-shadow(0 6px 16px rgba(0, 0, 0, .45));
    }
}

.au-title {
    margin: 0;
    padding: .1em .3em .2em;
    font-size: 34px;
    line-height: 1.4;
}

/* ---- form -------------------------------------------------------------------------------------------- */

/* <form> is rendered by EditForm, hence */
.au-body .au-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.au-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.au-label {
    color: #b9b9c8;
    font: 600 12px var(--nx-font);
    letter-spacing: .04em;
}

.au-input {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(233, 233, 237, .28);
    border-radius: 999px;
    background: rgba(22, 24, 38, .7);
}

.au-input:hover,
.au-input:focus-within {
    border-color: var(--nx-accent);
}

.au-input:focus-within {
    box-shadow: 0 0 0 2px rgba(145, 132, 217, .35);
}

.au-input:has(.invalid) {
    border-color: var(--nx-error);
}

.au-input input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: #e9e9ed;
    font: 400 16px var(--nx-font);
}

.au-input input::placeholder {
    color: #8b8fa3;
}

/* keep browser autofill dark */
.au-input input:-webkit-autofill {
    -webkit-box-shadow: 0 0 0 100px #1d2033 inset;
    -webkit-text-fill-color: #e9e9ed;
    caret-color: #e9e9ed;
}

.au-ic {
    display: inline-flex;
    flex: none;
    color: #c9b8ff;
}

.au-eye {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    margin-right: -6px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #b9b9c8;
    cursor: pointer;
}

.au-eye:hover {
    color: #fff;
}

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

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

.au-eye.is-shown .au-eye-off {
    display: inline;
}

.au-hint {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    color: #b9b9c8;
    font-size: 12px;
    line-height: 1.4;
}

.au-hint svg {
    flex: none;
    margin-top: 1px;
    color: #c9b8ff;
}

.au-field .au-error {
    color: var(--nx-error);
    font-size: 12px;
    line-height: 1.4;
}

.au-body .validation-errors {
    margin: 0;
    padding: 10px 12px 10px 28px;
    border: 1px solid rgba(248, 113, 113, .5);
    border-radius: var(--nx-radius-sm);
    background: rgba(248, 113, 113, .12);
    color: var(--nx-error);
    font-size: 13px;
}

.au-body .alert {
    margin: 0;
    padding: 10px 12px;
    border-radius: var(--nx-radius-sm);
    font-size: 14px;
}

.au-body .alert-danger {
    border: 1px solid rgba(248, 113, 113, .5);
    background: rgba(248, 113, 113, .12);
    color: var(--nx-error);
}

.au-body .alert-success {
    border: 1px solid rgba(74, 222, 128, .5);
    background: rgba(74, 222, 128, .12);
    color: var(--nx-ok-bg);
}

.au-submit {
    display: flex;
    align-items: center;
    align-self: center;
    justify-content: center;
    gap: 8px;
    min-width: 200px;
    min-height: 44px;
    padding: 0 22px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(95deg, #9184d9, #c9b8ff);
    box-shadow: 0 6px 18px rgba(145, 132, 217, .35);
    color: #161826;
    font: 700 15px var(--nx-font);
    cursor: pointer;
    transition: filter .15s, transform .15s;
}

.au-submit:hover {
    filter: brightness(1.08);
    transform: translateY(-1px);
}

.au-submit svg {
    flex: none;
}

.au-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    background: rgba(145, 132, 217, .18);
    font-size: 14px;
}

.au-foot svg {
    flex: none;
    color: #c9b8ff;
}

.au-foot a {
    color: #c9b8ff;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.au-foot a:hover {
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .au-submit {
        transition: none;
    }
}

/* ---- phone ----------------------------------------------------------------------------------------- */

@media (max-width: 640.98px) {
    .au-page {
        align-items: flex-start;
        padding: 16px;
        background: linear-gradient(90deg, rgba(22, 24, 38, .82), rgba(22, 24, 38, .5)),
                    url('/img/home/auth-bg.webp') center / cover #161826;
    }

    .au-body {
        padding: 18px 20px 18px;
    }

    .au-title {
        font-size: 30px;
    }
}

/* ---- login-only pieces ----------------------------------------------------------------------------- */

.au-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* "remember me" switch: a real checkbox (keyboard + screen readers) drawn as a pill switch */
.au-remember {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 32px;
    cursor: pointer;
}

.au-remember input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    opacity: 0;
}

.au-switch {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
    width: 42px;
    height: 24px;
    padding: 0 3px;
    border: 1.5px solid #ffb86b;
    border-radius: 12px;
    background: rgba(22, 24, 38, .85);
    transition: background .2s, justify-content .2s;
}

.au-knob {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    transition: transform .2s;
}

.au-remember input:checked + .au-switch {
    background: linear-gradient(95deg, #ffb86b, #ff8fa3);
}

.au-remember input:checked + .au-switch .au-knob {
    transform: translateX(18px);
}

.au-remember input:focus-visible + .au-switch {
    outline: 2px solid var(--nx-accent-text);
    outline-offset: 2px;
}

.au-remember-text {
    background: linear-gradient(95deg, #ffe29a 0%, #ffb86b 30%, #ff8fa3 60%, #c9b8ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    font: 600 14px var(--nx-font);
}

.au-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(145, 132, 217, .16);
    color: #c9b8ff;
    font: 600 14px var(--nx-font);
    text-decoration: none;
    white-space: nowrap;
}

.au-chip:hover {
    background: rgba(145, 132, 217, .3);
    color: #fff;
}

.au-chip svg {
    flex: none;
}

.au-aside {
    margin: 0;
    color: #b9b9c8;
    font-size: 13px;
    text-align: center;
}

.au-aside a {
    color: #c9b8ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.au-aside a:hover {
    color: #fff;
}

@media (prefers-reduced-motion: reduce) {
    .au-switch,
    .au-knob {
        transition: none;
    }
}

/* ---- other account pages: intro text, result block (AuthState), code input ------------------------------- */

.au-title--sm {
    font-size: 26px;
    text-wrap: balance;
}

.au-lead {
    margin: 0;
    color: #d4d4de;
    font-size: 15px;
    line-height: 1.55;
    text-align: center;
}

.au-lead a {
    color: #c9b8ff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.au-lead a:hover {
    color: #fff;
}

.au-lead .alert {
    text-align: left;
}

.au-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding-bottom: 4px;
}

.au-state-ic {
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(145, 132, 217, .2);
    box-shadow: 0 0 0 1px rgba(201, 184, 255, .35);
    color: #c9b8ff;
}

.au-state-ic.is-ok {
    background: rgba(74, 222, 128, .14);
    box-shadow: 0 0 0 1px rgba(74, 222, 128, .45);
    color: #86efac;
}

.au-state-ic.is-bad {
    background: rgba(248, 113, 113, .14);
    box-shadow: 0 0 0 1px rgba(248, 113, 113, .45);
    color: #fca5a5;
}

a.au-submit,
a.au-submit:hover,
a.au-submit:visited {
    color: #161826;
    text-decoration: none;
}

/* one-time code: centred, spaced digits */
.au-code input {
    text-align: center;
    letter-spacing: .28em;
    font-size: 18px;
    font-weight: 600;
}

@media (max-width: 640.98px) {
    .au-title--sm {
        font-size: 23px;
    }
}
