/* Ultra-modern auth (project entry) */

.auth-shell {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: clamp(2rem, 6vh, 4rem) 0;
    overflow: hidden;
    isolation: isolate;

    /* For WA pages: let .wa-body own the background */
    background: transparent;
}

/* When WA theme is enabled, the global background is already set on body. */
.wa-body .auth-shell {
    background: transparent;
}

.auth-shell::before,
.auth-shell::after {
    content: "";
    position: absolute;
    inset: -20%;
    pointer-events: none;
    z-index: -1;
}

.auth-shell::before {
    background:
        radial-gradient(22rem 22rem at 18% 26%, color-mix(in srgb, var(--admin-primary, #6366f1) 28%, transparent), transparent 62%),
        radial-gradient(26rem 26rem at 84% 36%, color-mix(in srgb, var(--admin-info, #3b82f6) 22%, transparent), transparent 64%),
        radial-gradient(18rem 18rem at 54% 88%, color-mix(in srgb, var(--admin-secondary, #8b5cf6) 18%, transparent), transparent 66%);
    filter: blur(0px);
    animation: authBgFloat 14s ease-in-out infinite;
    opacity: 0.75;
}

.auth-shell::after {
    background: repeating-linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.00) 0px,
        rgba(255, 255, 255, 0.00) 18px,
        rgba(255, 255, 255, 0.03) 18px,
        rgba(255, 255, 255, 0.03) 19px
    );
    opacity: 0.55;
    animation: authBgShimmer 18s linear infinite;
}

@keyframes authBgFloat {
    0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
    50% { transform: translate3d(2%, -2%, 0) scale(1.02); }
}

@keyframes authBgShimmer {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-6%, 6%, 0); }
}

.auth-wrap {
    width: 100%;
}

/* Force readable typography in nested dark theme (guards against global overrides) */
.auth-shell[data-bs-theme="dark"] {
    color-scheme: dark;
    color: rgba(255, 255, 255, 0.92);
    --bs-body-color: rgba(255, 255, 255, 0.92);
    --bs-body-color-rgb: 255, 255, 255;
    --bs-secondary-color: rgba(255, 255, 255, 0.70);
    --bs-secondary-color-rgb: 255, 255, 255;
    --bs-tertiary-color: rgba(255, 255, 255, 0.60);
    --bs-tertiary-color-rgb: 255, 255, 255;
    --bs-emphasis-color: rgba(255, 255, 255, 0.96);
    --bs-emphasis-color-rgb: 255, 255, 255;
}

.auth-shell[data-bs-theme="dark"] .auth-caption,
.auth-shell[data-bs-theme="dark"] .auth-muted {
    color: rgba(255, 255, 255, 0.65) !important;
}

.auth-shell[data-bs-theme="dark"] .text-muted {
    color: rgba(255, 255, 255, 0.60) !important;
}

.auth-shell[data-bs-theme="dark"] .form-label,
.auth-shell[data-bs-theme="dark"] .form-check-label,
.auth-shell[data-bs-theme="dark"] .form-text {
    color: rgba(255, 255, 255, 0.78) !important;
}

.auth-shell[data-bs-theme="dark"] .form-control,
.auth-shell[data-bs-theme="dark"] .form-select {
    background-color: rgba(255, 255, 255, 0.06) !important;
    color: rgba(255, 255, 255, 0.92) !important;
}

.auth-shell[data-bs-theme="dark"] .form-control::placeholder {
    color: rgba(255, 255, 255, 0.55) !important;
}

.auth-card {
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(20, 20, 20, 0.40);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.45),
        0 2px 0 rgba(255, 255, 255, 0.03) inset;
    border-radius: 1.25rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    transform: translateY(6px);
    animation: authCardEnter 520ms cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes authCardEnter {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
        filter: blur(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 1rem;
}

.auth-mark {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--admin-primary, var(--bs-primary)) 0%, var(--admin-info, var(--bs-info)) 100%);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

.auth-mark i {
    font-size: 1.2rem;
}

.auth-mark svg {
    width: 34px;
    height: 34px;
    display: block;
}

.auth-mark svg path {
    stroke: currentColor;
}

.auth-product {
    font-weight: 800;
    letter-spacing: 0.2px;
    line-height: 1.1;
}

.auth-caption {
    color: rgba(255, 255, 255, 0.70);
    font-size: 0.9rem;
}

.auth-card .form-control,
.auth-card .form-select {
    border-radius: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
}

/* Browser autofill (especially password managers) can force light backgrounds */
.auth-card input:-webkit-autofill,
.auth-card input:-webkit-autofill:hover,
.auth-card input:-webkit-autofill:focus,
.auth-card select:-webkit-autofill,
.auth-card textarea:-webkit-autofill {
    -webkit-text-fill-color: rgba(255, 255, 255, 0.92);
    caret-color: rgba(255, 255, 255, 0.92);
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset;
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset;
    border: 1px solid rgba(255, 255, 255, 0.10);
}

.auth-card input:-moz-autofill,
.auth-card input:-moz-autofill:focus,
.auth-card select:-moz-autofill,
.auth-card textarea:-moz-autofill {
    box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.06) inset;
    caret-color: rgba(255, 255, 255, 0.92);
}

.auth-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.55);
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
    border-color: rgba(var(--bs-primary-rgb), 0.55);
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.22);
    background: rgba(255, 255, 255, 0.07);
}

.auth-card .form-check-input {
    border-color: rgba(255, 255, 255, 0.25);
    background-color: rgba(255, 255, 255, 0.10);
}

.auth-card .form-check-input:focus {
    box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.22);
}

.auth-btn {
    border-radius: 0.95rem;
    padding: 0.9rem 1rem;
    font-weight: 700;
    letter-spacing: 0.2px;
    background: linear-gradient(135deg, var(--admin-primary, var(--bs-primary)) 0%, var(--admin-info, var(--bs-info)) 100%);
    border: 0;
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.35);
    transform: translateZ(0);
    transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42);
    filter: saturate(1.05);
}

.auth-btn:active {
    transform: translateY(0);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.36);
}

.auth-link {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.25);
}

.auth-link:hover {
    color: rgba(255, 255, 255, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.45);
}

.auth-muted {
    color: rgba(255, 255, 255, 0.65);
}

/* Keep things readable in light mode too */
@media (prefers-color-scheme: light) {
    .auth-card {
        background: rgba(255, 255, 255, 0.72);
        border-color: rgba(0, 0, 0, 0.06);
        box-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
    }

    .auth-caption,
    .auth-muted {
        color: rgba(0, 0, 0, 0.58);
    }

    .auth-card .form-control,
    .auth-card .form-select {
        background: rgba(255, 255, 255, 0.80);
        border-color: rgba(0, 0, 0, 0.08);
        color: rgba(0, 0, 0, 0.82);
    }

    .auth-card .form-control::placeholder {
        color: rgba(0, 0, 0, 0.45);
    }

    .auth-link {
        color: rgba(0, 0, 0, 0.70);
        border-bottom-color: rgba(0, 0, 0, 0.22);
    }

    .auth-link:hover {
        color: rgba(0, 0, 0, 0.82);
        border-bottom-color: rgba(0, 0, 0, 0.35);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-shell::before,
    .auth-shell::after,
    .auth-card {
        animation: none !important;
        transition: none !important;
    }
}
