/* Login */
.login-page {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 24px;
    background:
        radial-gradient(circle at 12% 16%, rgba(101, 119, 255, .13), transparent 28%),
        #f1f2f7;
}

.login-page .app-version-badge {
    position: fixed;
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
    left: 50%;
    z-index: 3;
    color: rgba(114, 119, 139, .82);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: center;
    text-transform: uppercase;
    transform: translateX(-50%);
    pointer-events: none;
}

.login-shell {
    display: grid;
    width: min(1100px, 100%);
    min-height: calc(100vh - 48px);
    min-height: calc(100dvh - 48px);
    margin: 0 auto;
    grid-template-columns: minmax(360px, .82fr) 1.18fr;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .75);
    border-radius: 30px;
    background: var(--surface);
    box-shadow: 0 30px 100px rgba(34, 37, 58, .15);
}

.login-panel {
    display: flex;
    max-width: 460px;
    padding: 72px 64px;
    align-self: center;
    flex-direction: column;
    justify-self: center;
}

.brand-mark {
    display: inline-grid;
    width: 34px;
    height: 34px;
    flex: 0 0 auto;
    place-items: center;
    color: #fff;
    border-radius: 11px;
    background: linear-gradient(145deg, #7988ff, #5265ee);
    box-shadow: 0 8px 18px rgba(101, 119, 255, .3);
    font-family: "Manrope", sans-serif;
    font-weight: 800;
}

.brand-icon,
.brand-mark-large {
    object-fit: contain;
}

.brand-icon {
    display: block;
    width: 34px;
    height: 34px;
}

.brand-mark-large {
    width: 52px;
    height: 52px;
    margin-bottom: 38px;
    border-radius: 17px;
    font-size: 21px;
}

.login-panel h1 {
    margin: 0;
    font-family: "Manrope", sans-serif;
    font-size: clamp(34px, 4vw, 48px);
    line-height: 1.05;
    letter-spacing: -.05em;
}

.login-copy {
    margin: 16px 0 30px;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.6;
}

.login-error {
    margin-bottom: 18px;
    padding: 11px 13px;
    color: #ae3e55;
    border: 1px solid #f0ccd5;
    border-radius: 12px;
    background: #fff3f6;
    font-size: 13px;
}

.login-form {
    display: grid;
    gap: 11px;
}

.login-form label {
    color: #4e5262;
    font-size: 13px;
    font-weight: 700;
}

.password-field {
    position: relative;
}

.login-form > input:not([type="hidden"]),
.password-field input {
    width: 100%;
    height: 52px;
    padding: 0 16px;
    color: var(--ink);
    outline: none;
    border: 1px solid #dfe1e9;
    border-radius: 14px;
    background: #fafafe;
    transition: .2s ease;
}

.password-field input {
    padding-right: 48px;
}

.login-form > input:not([type="hidden"]):focus,
.password-field input:focus {
    border-color: var(--accent);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(101, 119, 255, .12);
}

.remember-login {
    display: flex;
    margin-top: 2px;
    padding: 8px 2px;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.remember-login input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.remember-login > span {
    position: relative;
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    border: 1px solid #d5d8e3;
    border-radius: 6px;
    background: #fafafe;
    transition: background .2s ease, border-color .2s ease;
}

.remember-login > span::after {
    position: absolute;
    top: 4px;
    left: 3px;
    width: 11px;
    height: 6px;
    content: "";
    border-bottom: 2px solid #fff;
    border-left: 2px solid #fff;
    opacity: 0;
    transform: rotate(-45deg) scale(.7);
    transition: opacity .15s ease, transform .15s ease;
}

.remember-login input:checked + span {
    border-color: var(--accent);
    background: var(--accent);
}

.remember-login input:checked + span::after {
    opacity: 1;
    transform: rotate(-45deg) scale(1);
}

.remember-login input:focus-visible + span {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.remember-login div {
    display: grid;
    gap: 2px;
}

.login-form .remember-login strong {
    color: #4e5262;
    font-size: 12px;
}

.remember-login small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 500;
    line-height: 1.35;
}

.show-password {
    position: absolute;
    top: 5px;
    right: 5px;
    display: grid;
    width: 42px;
    height: 42px;
    padding: 0;
    place-items: center;
    color: #9195a5;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.show-password.active {
    color: var(--accent);
}

.primary-button {
    height: 52px;
    margin-top: 8px;
    color: #fff;
    border: 0;
    border-radius: 14px;
    background: var(--accent);
    box-shadow: 0 12px 24px rgba(101, 119, 255, .25);
    font-weight: 700;
    cursor: pointer;
    transition: .2s ease;
}

.primary-button:hover {
    background: var(--accent-dark);
    transform: translateY(-1px);
}

.login-art {
    position: relative;
    min-height: 620px;
    overflow: hidden;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .08), transparent 45%),
        #151827;
}

.login-art::before {
    position: absolute;
    inset: 12%;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 50%;
    content: "";
}

.art-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(1px);
}

.art-orb-one {
    top: 8%;
    right: -8%;
    width: 330px;
    height: 330px;
    background: rgba(101, 119, 255, .55);
}

.art-orb-two {
    bottom: 5%;
    left: -8%;
    width: 260px;
    height: 260px;
    background: rgba(65, 185, 149, .3);
}

.floating-card {
    position: absolute;
    display: grid;
    width: 210px;
    padding: 18px;
    gap: 13px;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 20px;
    background: rgba(255, 255, 255, .1);
    box-shadow: 0 28px 60px rgba(0, 0, 0, .2);
    backdrop-filter: blur(15px);
}

.floating-card span {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 13px;
    background: rgba(255, 255, 255, .13);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .1em;
}

.floating-card strong {
    font-size: 14px;
}

.floating-card-one {
    top: 20%;
    left: 12%;
    transform: rotate(-5deg);
}

.floating-card-two {
    top: 42%;
    right: 10%;
    transform: rotate(5deg);
}

.floating-card-three {
    bottom: 13%;
    left: 22%;
    transform: rotate(-2deg);
}

.admin-passcode-page {
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at 50% 10%, rgba(101, 119, 255, .18), transparent 34%),
        #11141f !important;
}

.admin-passcode-shell {
    width: min(460px, 100%);
}

.admin-passcode-panel {
    width: 100%;
    max-width: none;
    padding: 48px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 26px;
    background: rgba(27, 31, 45, .94);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .32);
    backdrop-filter: blur(24px);
}

.admin-passcode-panel h1,
.admin-passcode-panel .login-form label {
    color: #f7f8ff;
}

.admin-passcode-panel .login-copy {
    color: #aeb4c8;
}

.admin-passcode-panel .brand-mark-large {
    margin-bottom: 28px;
}

/* Outrank the shared light login-field selector on the standalone dark admin gate. */
.admin-passcode-form > input.admin-passcode-input:not([type="hidden"]) {
    width: 100%;
    height: 58px;
    padding: 0 18px;
    color: #fff;
    caret-color: #fff;
    color-scheme: dark;
    outline: none;
    border: 1px solid rgba(255, 255, 255, .13);
    border-radius: 15px;
    background: rgba(255, 255, 255, .055);
    font-size: 24px;
    font-variant-numeric: tabular-nums;
    letter-spacing: .38em;
    text-align: center;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.admin-passcode-form > input.admin-passcode-input:not([type="hidden"]):focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, .085);
    box-shadow: 0 0 0 4px rgba(101, 119, 255, .16);
}

.admin-passcode-form > input.admin-passcode-input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    caret-color: #fff;
    box-shadow: 0 0 0 1000px #252936 inset;
}

.admin-passcode-form > input.admin-passcode-input:-webkit-autofill:focus {
    box-shadow: 0 0 0 1000px #2b3040 inset, 0 0 0 4px rgba(101, 119, 255, .16);
}

.admin-passcode-signout {
    margin-top: 22px;
    color: #9ea5ba;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
}

.admin-passcode-signout:hover {
    color: #fff;
}

@media (max-width: 560px) {
    .login-page.admin-passcode-page {
        padding: max(18px, env(safe-area-inset-top)) 18px max(18px, env(safe-area-inset-bottom));
    }

    .admin-passcode-panel {
        padding: 34px 24px;
        border-radius: 22px;
    }
}

/* iOS pans a smaller visual viewport over the fixed login layout when its keyboard opens. */
body.admin-passcode-page.app-shell-keyboard-focus {
    padding: 0;
}

body.admin-passcode-page.app-shell-keyboard-focus .admin-passcode-shell {
    position: fixed;
    top: var(--app-visual-viewport-top, 0px);
    right: 0;
    left: 0;
    z-index: 4;
    display: flex;
    width: 100%;
    height: var(--app-visual-viewport-height, 100dvh);
    max-height: var(--app-visual-viewport-height, 100dvh);
    padding: max(10px, env(safe-area-inset-top)) 18px max(10px, env(safe-area-inset-bottom));
    align-items: center;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
}

body.admin-passcode-page.app-shell-keyboard-focus .admin-passcode-panel {
    width: 100%;
    max-width: 460px;
    flex: 0 0 auto;
    margin: auto 0;
}

body.admin-passcode-page.app-shell-keyboard-open .admin-passcode-panel {
    padding: 18px 24px;
}

body.admin-passcode-page.app-shell-keyboard-open .admin-passcode-panel .brand-mark-large {
    display: none;
}

body.admin-passcode-page.app-shell-keyboard-open .admin-passcode-panel .login-copy {
    margin: 10px 0 16px;
}

body.admin-passcode-page.app-shell-keyboard-open .admin-passcode-signout {
    margin-top: 14px;
}

body.admin-passcode-page.app-shell-keyboard-open .app-version-badge {
    visibility: hidden;
}
