/* ---------- Neutral account authentication ---------- */
/* Shared by sign-in and password recovery so every unauthenticated account
   step uses the same full-screen, responsive presentation. */
.le-auth.neutral-auth {
    --auth-bg: #f4f8fc;
    --auth-surface: #ffffff;
    --auth-border: #d8e3ef;
    --auth-ink: #102033;
    --auth-muted: #5b6b7d;
    --auth-blue: #1463d6;
    --auth-blue-hover: #0f52b5;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr;
    position: relative;
    isolation: isolate;
    overflow: hidden;
    color: var(--auth-ink);
    background: var(--auth-bg);
}

[data-bs-theme="light"] .neutral-auth {
    color-scheme: light;
}

.neutral-auth .le-auth-panel {
    min-height: 100vh;
    padding: clamp(2rem, 5vw, 4rem) clamp(1.5rem, 4vw, 3rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

[data-bs-theme="dark"] .neutral-auth {
    color-scheme: dark;
    --auth-bg: #050a12;
    --auth-surface: #0b1523;
    --auth-border: #20324a;
    --auth-ink: #f7faff;
    --auth-muted: #a9b7c8;
    --auth-blue: #3b82f6;
    --auth-blue-hover: #60a5fa;
    background: var(--auth-bg);
}

.neutral-auth::before {
    content: "";
    position: absolute;
    z-index: -2;
    inset: 0;
    background: url("../images/auth/clubmanager-signin-court-v2.png") center center / cover no-repeat;
    background-image: image-set(
        url("../images/auth/clubmanager-signin-court-v2.webp") type("image/webp"),
        url("../images/auth/clubmanager-signin-court-v2.png") type("image/png"));
}

.neutral-auth::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 11, 21, .10), rgba(5, 11, 21, .22));
}

.neutral-auth form,
.neutral-auth .le-auth-inner {
    width: 100%;
    max-width: 420px;
    padding: clamp(2rem, 6vw, 3rem);
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 12px;
    box-shadow: 0 18px 55px rgba(15, 35, 60, .10);
}

[data-bs-theme="dark"] .neutral-auth form,
[data-bs-theme="dark"] .neutral-auth .le-auth-inner {
    box-shadow: 0 20px 60px rgba(0, 0, 0, .38);
}

.neutral-auth .neutral-auth-mark {
    width: 3rem;
    height: 3rem;
    margin-bottom: 1.5rem;
    display: block;
    object-fit: contain;
}

.neutral-auth h1 { color: var(--auth-ink); }
.neutral-auth .text-muted,
.neutral-auth .form-check-label { color: var(--auth-muted) !important; }

.neutral-auth .form-control {
    color: var(--auth-ink);
    background: var(--auth-surface);
    border-color: var(--auth-border);
}

.neutral-auth .form-control:focus {
    border-color: var(--auth-blue);
    box-shadow: 0 0 0 .2rem rgba(20, 99, 214, .18);
}

/* Chromium/Edge can apply a dark saved-credential fill even while the
   page is in light mode. Keep autofilled fields visually identical to
   ordinary enabled inputs. */
[data-bs-theme="light"] .neutral-auth .form-control:autofill {
    color: var(--auth-ink);
    background-color: var(--auth-surface) !important;
    box-shadow: 0 0 0 1000px var(--auth-surface) inset;
    caret-color: var(--auth-ink);
}

[data-bs-theme="light"] .neutral-auth .form-control:-webkit-autofill {
    -webkit-text-fill-color: var(--auth-ink);
    -webkit-box-shadow: 0 0 0 1000px var(--auth-surface) inset;
    box-shadow: 0 0 0 1000px var(--auth-surface) inset;
    caret-color: var(--auth-ink);
}

[data-bs-theme="light"] .neutral-auth .form-control:autofill:focus,
[data-bs-theme="light"] .neutral-auth .form-control:-webkit-autofill:focus {
    box-shadow:
        0 0 0 1000px var(--auth-surface) inset,
        0 0 0 .2rem rgba(20, 99, 214, .18);
}

.neutral-auth .btn-primary {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--auth-blue);
    --bs-btn-border-color: var(--auth-blue);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--auth-blue-hover);
    --bs-btn-hover-border-color: var(--auth-blue-hover);
    --bs-btn-active-color: #fff;
    --bs-btn-active-bg: var(--auth-blue-hover);
    --bs-btn-active-border-color: var(--auth-blue-hover);
    --bs-btn-disabled-color: #fff;
    --bs-btn-disabled-bg: var(--auth-blue);
    --bs-btn-disabled-border-color: var(--auth-blue);
    background-color: var(--auth-blue);
    background-image: none;
    box-shadow: 0 6px 16px -7px rgba(20, 99, 214, .65);
}

.neutral-auth .btn-primary:hover,
.neutral-auth .btn-primary:focus,
.neutral-auth .btn-primary:active {
    color: #fff;
    background-color: var(--auth-blue-hover);
    background-image: none;
    border-color: var(--auth-blue-hover);
    box-shadow: 0 9px 20px -8px rgba(20, 99, 214, .72);
}

@media (max-width: 575.98px) {
    .le-auth.neutral-auth {
        min-height: calc(100svh - var(--le-appbar-h, 0px) - env(safe-area-inset-top));
        overflow-y: auto;
    }

    /* The source art is intentionally wide. On a portrait viewport its
       center is empty court, so bias the crop toward the players and hoop. */
    .neutral-auth::before {
        background-position: 23% center;
    }

    .neutral-auth .le-auth-panel {
        min-height: calc(100svh - var(--le-appbar-h, 0px) - env(safe-area-inset-top));
        align-items: center;
        padding: max(1rem, env(safe-area-inset-top)) 1rem max(1rem, env(safe-area-inset-bottom));
    }

    .neutral-auth form,
    .neutral-auth .le-auth-inner {
        width: min(100%, 22rem);
        padding: 1.25rem;
        border-radius: 16px;
        background: rgba(255, 255, 255, .92);
        box-shadow: 0 14px 36px rgba(5, 11, 21, .22);
        -webkit-backdrop-filter: blur(12px) saturate(120%);
        backdrop-filter: blur(12px) saturate(120%);
    }

    [data-bs-theme="dark"] .neutral-auth form,
    [data-bs-theme="dark"] .neutral-auth .le-auth-inner {
        background: rgba(11, 21, 35, .92);
    }

    .neutral-auth .neutral-auth-mark {
        width: 2.25rem;
        height: 2.25rem;
        margin-bottom: .65rem;
    }

    .neutral-auth h1 { font-size: 1.5rem; }
    .neutral-auth h1 + p { margin-bottom: 1rem !important; font-size: .9rem; }
    .neutral-auth form > .mb-3 { margin-bottom: .75rem !important; }
    .neutral-auth .form-check { margin-bottom: 1rem !important; }
    .neutral-auth .form-control { padding: .5rem .75rem; }
    .neutral-auth .btn-lg { padding: .625rem 1rem; font-size: 1rem; }
}

@media (max-width: 575.98px) and (max-height: 700px) {
    .neutral-auth .neutral-auth-mark { display: none; }
}
