.login-32:has(.auth-login) {
    position: relative;
    min-height: 100dvh;
    overflow: hidden;
    background:
        radial-gradient(120% 120% at 15% 10%, #eaf1ff 0%, rgba(234, 241, 255, 0) 55%),
        radial-gradient(120% 120% at 85% 90%, #e8f7f1 0%, rgba(232, 247, 241, 0) 50%),
        linear-gradient(160deg, #f4f7fc 0%, #eef2f9 100%);
}

/* Soft floating colour blobs behind the frosted card — they give the glass
   something to blur. Two pseudo-elements, gently drifting. */
.login-32:has(.auth-login)::before,
.login-32:has(.auth-login)::after {
    content: "";
    position: absolute;
    z-index: 0;
    width: 42vmax;
    height: 42vmax;
    border-radius: 50%;
    filter: blur(6px);
    opacity: 0.72;
    pointer-events: none;
    will-change: transform;
}

.login-32:has(.auth-login)::before {
    top: -14vmax;
    left: -10vmax;
    background: radial-gradient(circle at 30% 30%, rgba(54, 120, 219, 0.5), rgba(54, 120, 219, 0) 70%);
    animation: auth-blob-a 18s ease-in-out infinite;
}

.login-32:has(.auth-login)::after {
    right: -12vmax;
    bottom: -16vmax;
    background: radial-gradient(circle at 60% 60%, rgba(29, 191, 145, 0.42), rgba(29, 191, 145, 0) 70%);
    animation: auth-blob-b 22s ease-in-out infinite;
}

.login-32:has(.auth-login) .login-32-inner {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100dvh;
    padding: max(32px, env(safe-area-inset-top)) 20px max(32px, env(safe-area-inset-bottom));
}

.login-32:has(.auth-login) .form-signin {
    flex: 0 0 auto;
    width: min(100%, 480px);
    max-width: 480px;
    margin: 0 auto;
}

.auth-login {
    width: 100%;
    margin: 0 auto;
    font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    color: #17263b;
    text-align: left;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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


.auth-login__card {
    position: relative;
    isolation: isolate;
    padding: clamp(30px, 5vw, 48px);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 22px;
    background: rgba(255, 255, 255, 0.82);
    /* Clean frosted surface — light blur so the card reads crisp, not milky. */
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    backdrop-filter: blur(18px) saturate(140%);
    box-shadow:
        0 24px 56px rgba(22, 38, 61, 0.12),
        0 2px 6px rgba(22, 38, 61, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
    animation: auth-card-rise 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Specular sheen — a soft diagonal gloss + brighter top edge, the giveaway of
   Tahoe's liquid glass. Sits above the blur, below the content. */
.auth-login__card::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: inherit;
    background:
        linear-gradient(150deg, rgba(255, 255, 255, 0.55) 0%, rgba(255, 255, 255, 0) 42%),
        radial-gradient(120% 80% at 50% -10%, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 60%);
    pointer-events: none;
}

/* Progressive enhancement: only lean on translucency where blur is supported;
   otherwise fall back to a solid card so text stays legible. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .auth-login__card {
        background: #fff;
        border-color: #e2e8f0;
    }
}

.auth-login__header {
    margin-bottom: 28px;
    text-align: center;
}

.auth-login__header h1 {
    margin: 0;
    color: #1a2440;
    font-family: "Sora", "Plus Jakarta Sans", -apple-system, system-ui, sans-serif;
    font-size: clamp(2.3rem, 6.5vw, 2.9rem);
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.04em;
}

.auth-login__header p {
    margin: 9px 0 0;
    color: #6b7a90;
    font-size: 0.91rem;
    line-height: 1.55;
}

.auth-login__alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 22px;
    padding: 12px 13px;
    border: 1px solid #f1c7cf;
    border-radius: 12px;
    background: #fff6f7;
    color: #9b2940;
    font-size: 0.82rem;
    line-height: 1.45;
}

.auth-login__alert svg {
    flex: 0 0 auto;
    width: 19px;
    height: 19px;
    margin-top: 1px;
}

.auth-login__alert ul {
    margin: 3px 0 0;
    padding-left: 17px;
}

.auth-login__field {
    margin-bottom: 19px;
}

.auth-login__label {
    display: block;
    margin-bottom: 7px;
    color: #26364c;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: -0.005em;
    transition: color 150ms ease;
}

.auth-login__control {
    position: relative;
}

.auth-login__control > svg {
    position: absolute;
    top: 50%;
    left: 16px;
    width: 19px;
    height: 19px;
    color: #2f6fdc;
    transform: translateY(-50%);
    transition: color 150ms ease;
    pointer-events: none;
}

/* Colourful, per-field icon tints. */
.auth-login__control:has(input[type="password"]) > svg {
    color: #1dbf91;
}

.auth-login__control:has(input[type="text"]) > svg {
    color: #7c5cff;
}

/* Focus: label shifts to the accent so the active field reads at a glance. */
.auth-login__field:focus-within .auth-login__label {
    color: #2f6fdc;
}

.auth-login__input {
    width: 100%;
    min-height: 52px;
    padding: 12px 48px;
    border: 2px solid #dbe3ee;
    border-radius: 14px;
    outline: none;
    background: rgba(255, 255, 255, 0.72);
    color: #17263b;
    font: inherit;
    font-size: 0.95rem;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.auth-login__input::placeholder {
    color: #99a5b5;
}

.auth-login__input:hover {
    border-color: #bac8da;
}

/* Selected state: ONE clean, solid accent border (no ring/blur/outline), and the
   typed value deepens to the accent ink. */
.auth-login__input:focus {
    border-color: #2f6fdc;
    background: #fff;
    color: #1c3d70;
}

.auth-login__input.is-invalid {
    border-color: #d64560;
}

.auth-login__toggle {
    position: absolute;
    top: 50%;
    right: 7px;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #718096;
    cursor: pointer;
    transform: translateY(-50%);
}

.auth-login__toggle:hover {
    background: #eef4fc;
    color: #246bd7;
}

.auth-login__toggle svg {
    width: 19px;
    height: 19px;
}

.auth-login__field-error {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 6px 1px 0;
    color: #b3334c;
    font-size: 0.76rem;
    line-height: 1.4;
}

.auth-login__field-error svg {
    width: 14px;
    height: 14px;
}

.auth-login__options {
    margin: 1px 0 23px;
}

.auth-login__remember {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: #526277;
    font-size: 0.84rem;
    cursor: pointer;
}

.auth-login__remember input {
    appearance: none;
    -webkit-appearance: none;
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: background-color 150ms ease, border-color 150ms ease, transform 120ms ease;
}

.auth-login__remember input:hover {
    border-color: #2f6fdc;
}

.auth-login__remember input:checked {
    border-color: #2f6fdc;
    background-color: #2f6fdc;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M13 4.5 6.5 11 3 8' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 13px;
}

.auth-login__remember input:active {
    transform: scale(0.92);
}

/* Single clean focus outline for keyboard users — one ring, no stacking. */
.auth-login__remember input:focus-visible {
    outline: 2px solid rgba(47, 111, 220, 0.5);
    outline-offset: 2px;
}

.auth-login__submit {
    display: inline-flex;
    width: 100%;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 14px 24px;
    border: 0;
    border-radius: 16px;
    background: #2f6fdc;
    box-shadow: 0 10px 22px rgba(47, 111, 220, 0.26);
    color: #fff;
    font: inherit;
    font-size: 1rem;
    font-weight: 650;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.auth-login__submit:hover {
    background: #2563cf;
    box-shadow: 0 14px 28px rgba(47, 111, 220, 0.32);
    transform: translateY(-1px);
}

.auth-login__submit:active {
    transform: translateY(0);
}

.auth-login__submit:disabled {
    cursor: wait;
    opacity: 0.75;
    transform: none;
}

.auth-login__submit svg,
.auth-login__spinner {
    width: 18px;
    height: 18px;
}

.auth-login__spinner {
    display: none;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-login-spin 700ms linear infinite;
}

.auth-login__submit.is-loading .auth-login__submit-icon {
    display: none;
}

.auth-login__submit.is-loading .auth-login__spinner {
    display: inline-block;
}

.auth-login__security {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 18px 0 0;
    color: #7b899b;
    font-size: 0.72rem;
    text-align: center;
}

.auth-login__security svg {
    flex: 0 0 auto;
    width: 14px;
    height: 14px;
    color: #3b8e71;
}

/* Inputs show focus via their own solid border only (no stacked outline).
   Links/buttons keep a keyboard-focus ring for accessibility. */
.auth-login :is(a, button):focus-visible {
    outline: 3px solid rgba(54, 120, 219, 0.35);
    outline-offset: 2px;
}

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

@keyframes auth-card-rise {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes auth-blob-a {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(6vmax, 4vmax) scale(1.08); }
}

@keyframes auth-blob-b {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(-5vmax, -5vmax) scale(1.12); }
}

/* Wobble the card when the server bounces the login back with errors. */
@keyframes auth-shake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-5px); }
    40%, 60% { transform: translateX(5px); }
}

.auth-login__card--shake {
    animation: auth-shake 620ms cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@media (max-width: 520px) {
    .login-32:has(.auth-login) .login-32-inner {
        align-items: flex-start;
        padding: max(28px, env(safe-area-inset-top)) 16px max(28px, env(safe-area-inset-bottom));
    }

    .auth-login__card {
        padding: 27px 22px;
        border-radius: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-login *,
    .auth-login *::before,
    .auth-login *::after,
    .auth-login__card,
    .auth-login__card--shake,
    .login-32:has(.auth-login)::before,
    .login-32:has(.auth-login)::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
