body.auth-page {
    --sg-bg: #0c0c0d;
    --sg-bg-soft: #111113;
    --sg-panel: #111113;
    --sg-panel-2: #171719;
    --sg-hover: rgba(255, 255, 255, .05);
    --sg-field: #141416;
    --sg-line: rgba(255, 255, 255, .12);
    --sg-line-strong: rgba(255, 255, 255, .2);
    --sg-text: #f5f5f6;
    --sg-text-2: #c0c0c5;
    --sg-text-3: #85858d;
    --sg-accent: #4b9cff;
    --sg-accent-hover: #70b1ff;
    --sg-on-accent: #071321;
    --sg-accent-soft: rgba(75, 156, 255, .12);
    --sg-shadow: none;
    min-height: 100vh;
    background: #0c0c0d;
    color: #f5f5f6;
}

body.auth-page .sg-ground {
    background: #0c0c0d;
}

body.auth-page site-nav,
body.auth-page site-footer {
    display: none !important;
}

.auth-topbar {
    position: absolute;
    z-index: 20;
    inset: 0 0 auto;
    display: flex;
    min-height: 3.75rem;
    align-items: center;
    justify-content: space-between;
    padding: .65rem clamp(1rem, 2.5vw, 2rem);
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    color: #f5f5f6;
    text-decoration: none;
}

.auth-brand img {
    width: auto;
    height: 1.65rem;
    object-fit: contain;
}

.auth-brand span {
    font-size: .9rem;
    font-weight: 650;
    letter-spacing: -.025em;
}

.auth-top-link {
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: .75rem;
    padding: .42rem .8rem;
    color: #f5f5f6;
    font-size: .78rem;
    font-weight: 550;
    text-decoration: none;
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.auth-top-link:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, .3);
    background: rgba(255, 255, 255, .06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, .18);
}

.auth-main {
    position: relative;
    isolation: isolate;
    min-height: 100vh;
    padding: 5rem 1rem 2rem;
}

.auth-main::before,
.auth-main::after {
    position: fixed;
    z-index: -1;
    width: min(25vw, 24rem);
    height: min(32vh, 15rem);
    content: "";
    pointer-events: none;
    background-image:
        linear-gradient(rgba(185, 185, 190, .19) 1px, transparent 1px),
        linear-gradient(90deg, rgba(185, 185, 190, .19) 1px, transparent 1px);
    background-size: 1.7rem 1.7rem;
}

.auth-main::before {
    top: 1.5rem;
    left: 0;
    clip-path: polygon(0 0, 100% 0, 100% 35%, 78% 35%, 78% 72%, 56% 72%, 56% 100%, 0 100%);
    mask-image: linear-gradient(110deg, #000 0%, transparent 92%);
}

.auth-main::after {
    right: 0;
    bottom: 1.5rem;
    clip-path: polygon(22% 0, 100% 0, 100% 100%, 0 100%, 0 62%, 28% 62%, 28% 32%, 52% 32%, 52% 15%, 72% 15%);
    mask-image: linear-gradient(290deg, #000 0%, transparent 92%);
}

.auth-layout {
    position: relative;
    z-index: 1;
    display: block;
    width: min(100%, 22rem);
    margin: auto;
}

.auth-aside {
    display: none;
}

.auth-form-column {
    width: 100%;
    max-width: 22rem;
    margin: auto;
}

.auth-form-column h1 {
    color: #f6f6f7;
    font-size: 1.35rem;
    font-weight: 650;
    letter-spacing: -.035em;
}

.auth-form-column > #signup-view > .text-center,
.auth-form-column > .text-center {
    margin-bottom: 1.2rem;
}

.auth-form-column > #signup-view > .text-center img,
.auth-form-column > .text-center img {
    display: none;
}

.auth-form-column p {
    color: #96969d;
}

.auth-card {
    border: 0;
    border-radius: 0;
    padding: 0 !important;
    background: transparent;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
}

.auth-provider-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
}

.auth-card button:not(.auth-primary),
.auth-provider-button {
    border-color: rgba(255, 255, 255, .15);
    color: #e7e7e9;
}

.auth-card input:not([type="checkbox"]),
.auth-page input:not([type="checkbox"]) {
    min-height: 2.55rem;
    border-color: rgba(255, 255, 255, .16);
    border-radius: .8rem;
    background: #151517;
    color: #f2f2f4;
    box-shadow: none;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease, transform .2s ease;
}

.auth-page input::placeholder {
    color: #73737a;
}

.auth-page input:not([type="checkbox"]):focus {
    border-color: rgba(75, 156, 255, .65);
    background: #18181b;
    box-shadow: 0 0 0 3px rgba(75, 156, 255, .12);
}

.auth-provider-button,
.auth-primary,
.auth-secondary {
    min-height: 2.55rem;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 999px !important;
    box-shadow: none;
    transition: opacity .22s ease, transform .22s ease, border-color .22s ease, background-color .22s ease, box-shadow .22s ease;
}

.auth-provider-button {
    min-height: 2.4rem;
    padding: .38rem .85rem !important;
    border-radius: 999px !important;
    background: #111113 !important;
    color: #dedee2 !important;
    font-size: .82rem;
    line-height: 1.25;
}

.auth-provider-button:hover {
    border-color: rgba(255, 255, 255, .24);
    background: #18181a !important;
    color: #f5f5f6 !important;
}

.auth-primary,
.auth-secondary {
    border-radius: 999px !important;
}

.auth-secondary {
    min-height: 2.35rem;
    background: #111113 !important;
    color: #c9c9ce !important;
    font-size: .82rem;
}

.auth-secondary:not(:disabled):hover {
    border-color: rgba(255, 255, 255, .24);
    background: #171719 !important;
    color: #f2f2f4 !important;
    box-shadow: none;
}

.auth-page button:not(:disabled):hover,
.auth-page a#open-email-btn:hover {
    transform: translateY(-1px);
}

.auth-page button:not(:disabled):active,
.auth-page a#open-email-btn:active {
    transform: translateY(0) scale(.985);
}

.auth-provider-button:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.auth-primary:not(:disabled) {
    animation: auth-ready .38s cubic-bezier(.2, .8, .2, 1);
}

.auth-primary:disabled {
    opacity: .48;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.auth-primary:not(:disabled):hover {
    box-shadow: 0 7px 20px rgba(75, 156, 255, .16);
}

.auth-last-used {
    position: relative;
    min-height: 2.4rem;
    margin-bottom: .35rem;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 999px !important;
    background: #111113 !important;
    color: #dedee2 !important;
    font-size: .78rem;
}

.auth-last-used:not(:disabled):hover {
    border-color: rgba(255, 255, 255, .24);
    background: #18181a !important;
    color: #f5f5f6 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.auth-last-used.auth-primary:not(:disabled):hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, .12);
}

.auth-last-used:not(.hidden) {
    display: flex;
}

.auth-last-used:not(.hidden) + .auth-provider-grid {
    margin-top: .75rem;
}

.auth-last-used::after {
    margin-left: auto;
    padding: .2rem .5rem;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
    color: #a9a9b0;
    content: "Last used";
    font-size: .62rem;
    font-weight: 600;
    letter-spacing: .01em;
}

.auth-primary.bg-sg-accent {
    border-color: #24558f;
    background: #174b87;
    color: #f6f8ff;
    box-shadow: 0 3px 12px rgba(23, 75, 135, .18);
}

.auth-primary.bg-sg-accent:not(:disabled):hover {
    border-color: #2b66a8;
    background: #1b5794;
    box-shadow: 0 5px 16px rgba(23, 75, 135, .24);
}

.auth-progress-track {
    height: 2px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
}

.auth-progress-value {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--sg-accent);
    transition: width .35s cubic-bezier(.2, .8, .2, 1);
}

.auth-step-panel {
    animation: auth-step-in .28s cubic-bezier(.2, .8, .2, 1);
}

.auth-eye-button {
    position: absolute;
    top: 50%;
    right: .75rem;
    display: grid;
    width: 2rem;
    height: 2rem;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: .4rem;
    background: transparent;
    color: #a4a4ab;
}

.auth-eye-button:hover {
    background: rgba(255, 255, 255, .06);
    color: white;
}

.auth-saved-login {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    color: #c4c4ca;
    font-size: .75rem;
    line-height: 1.5;
}

.auth-page [role="alert"]:not(.hidden) {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .85rem 1rem;
    border: 1px solid rgba(255, 111, 111, .24);
    border-radius: 1rem;
    background: linear-gradient(125deg, rgba(111, 28, 38, .32), rgba(57, 25, 34, .24));
    color: #ffb6b6;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .14), inset 0 1px 0 rgba(255, 255, 255, .035);
    line-height: 1.5;
    animation: auth-message-in .26s cubic-bezier(.2, .8, .2, 1) both;
}

.auth-page [role="alert"]:not(.hidden)::before {
    display: grid;
    width: 1.2rem;
    height: 1.2rem;
    flex: 0 0 auto;
    place-items: center;
    margin-top: .06rem;
    border: 1px solid rgba(255, 160, 160, .38);
    border-radius: 50%;
    background: rgba(255, 120, 120, .12);
    color: #ffb6b6;
    content: "!";
    font-size: .75rem;
    font-weight: 700;
}

.auth-page [role="status"]:not(.hidden) {
    border-radius: 1rem;
    animation: auth-message-in .26s cubic-bezier(.2, .8, .2, 1) both;
}

.auth-page #mfa-view .glass-card,
.auth-page #link-sent-view .glass-card {
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 1.4rem;
    background: linear-gradient(145deg, rgba(24, 24, 27, .96), rgba(15, 15, 17, .96));
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .045);
    animation: auth-message-in .3s cubic-bezier(.2, .8, .2, 1) both;
}

.auth-page #mfa-view input {
    border-radius: .9rem;
    background: #151517;
    color: #f3f3f4;
}

.auth-page #mfa-view button,
.auth-page #link-sent-view a#open-email-btn {
    border-radius: 999px;
}

.auth-page .turnstile-challenge.is-verified #turnstile-status::before {
    display: inline-grid;
    width: 1rem;
    height: 1rem;
    place-items: center;
    margin-right: .35rem;
    border-radius: 50%;
    background: rgba(52, 211, 153, .15);
    color: #6ee7b7;
    content: "✓";
    animation: auth-tick-in .32s cubic-bezier(.2, .8, .2, 1) both;
}

@keyframes auth-tick-in {
    from { opacity: 0; transform: scale(.35) rotate(-25deg); }
    70% { opacity: 1; transform: scale(1.15) rotate(5deg); }
    to { opacity: 1; transform: scale(1) rotate(0); }
}

@keyframes auth-ready {
    0% { transform: scale(.985); }
    55% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

@keyframes auth-step-in {
    from { opacity: 0; transform: translateY(7px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes auth-message-in {
    from { opacity: 0; transform: translateY(6px) scale(.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
    .auth-main::before,
    .auth-main::after {
        width: 37vw;
        opacity: .55;
    }

    .auth-layout {
        width: min(100%, 22rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-primary,
    .auth-secondary,
    .auth-progress-value,
    .auth-top-link,
    .auth-provider-button,
    .auth-page input:not([type="checkbox"]) {
        transition: none;
    }

    .auth-primary:not(:disabled),
    .auth-step-panel,
    .auth-page [role="alert"]:not(.hidden),
    .auth-page [role="status"]:not(.hidden),
    .auth-page button:not(:disabled):hover,
    .auth-page button:not(:disabled):active,
    .auth-page a#open-email-btn:hover,
    .auth-page a#open-email-btn:active {
        animation: none;
        transform: none;
    }

    .auth-page .turnstile-challenge.is-verified #turnstile-status::before {
        animation: none;
    }
}
.auth-brand .auth-logo { height: 2rem; width: auto; }
