.auth-page {
    --site-font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --auth-bg: #050506;
    --auth-card: rgba(255, 255, 255, .035);
    --auth-card-border: rgba(255, 255, 255, .09);
    --auth-field: rgba(255, 255, 255, .045);
    --auth-field-hover: rgba(255, 255, 255, .065);
    --auth-field-border: rgba(255, 255, 255, .12);
    --auth-text: #f7f8fb;
    --auth-muted: rgba(238, 241, 248, .6);
    --auth-label: rgba(247, 248, 251, .82);
    --auth-focus: #8ad9ff;
    isolation: isolate;
    position: relative;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    overflow: hidden;
    color: var(--auth-text);
    background: var(--auth-bg);
    color-scheme: dark;
}

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

.auth-background {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(circle at 18% 15%, rgba(138, 217, 255, .1), transparent 32%),
        radial-gradient(circle at 82% 84%, rgba(110, 147, 255, .08), transparent 34%),
        linear-gradient(145deg, #020203 0%, #08090c 52%, #030405 100%);
}

.auth-background::before,
.auth-background::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    filter: blur(8px);
    opacity: .8;
}

.auth-background::before {
    top: 14%;
    left: 12%;
    width: 6px;
    height: 6px;
    background: rgba(176, 227, 255, .75);
    box-shadow: 0 0 28px 8px rgba(92, 183, 255, .22);
}

.auth-background::after {
    right: 13%;
    bottom: 17%;
    width: 8px;
    height: 8px;
    background: rgba(148, 176, 255, .58);
    box-shadow: 0 0 36px 10px rgba(105, 145, 255, .18);
}

.auth-shell {
    display: flex;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    padding: 28px 18px;
}

.auth-layout {
    display: grid;
    place-items: center;
    width: 100%;
    margin: auto;
}

.auth-card {
    width: min(100%, 480px);
    border: 1px solid var(--auth-card-border);
    border-radius: 22px;
    background: rgba(13, 14, 18, .78);
    background: var(--auth-card);
    box-shadow: 0 28px 90px rgba(0, 0, 0, .48), inset 0 1px 0 rgba(255, 255, 255, .025);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.auth-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 36px 40px 0;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    min-width: 0;
    gap: 13px;
    color: var(--auth-text);
    text-decoration: none;
}

.auth-brand-mark {
    display: grid;
    place-items: center;
    flex: 0 0 38px;
    width: 38px;
    height: 38px;
    border-radius: 11px;
    color: #06070a;
    background: #f8fafc;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .22);
    transition: transform .2s ease, box-shadow .2s ease;
}

.auth-brand-mark i { font-size: 17px; }
.auth-brand-name {
    overflow: hidden;
    color: inherit;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -.025em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-brand:hover { color: #fff; }
.auth-brand:hover .auth-brand-mark { transform: translateY(-1px); box-shadow: 0 11px 28px rgba(0, 0, 0, .3); }

.auth-card-tools { flex: none; }
.auth-theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 11px;
    color: rgba(247, 248, 251, .68);
    background: rgba(255, 255, 255, .035);
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}

.auth-theme-toggle:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .2);
    background: rgba(255, 255, 255, .07);
    transform: translateY(-1px);
}

.auth-theme-toggle i { font-size: 16px; }
.auth-theme-toggle span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.auth-card-body { padding: 34px 40px 40px; }
.auth-heading {
    margin: 0;
    color: var(--auth-text);
    font-size: clamp(28px, 6vw, 34px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.045em;
}

.auth-subtitle {
    margin: 10px 0 30px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.6;
}

.auth-flash:empty { display: none; }
.auth-fields { display: grid; gap: 20px; }
.auth-field { min-width: 0; }
.auth-field-label {
    display: block;
    margin: 0 0 9px;
    color: var(--auth-label);
    font-size: 13px;
    font-weight: 500;
}

.auth-input-wrap {
    position: relative;
    display: block;
    transition: transform .2s ease;
}

.auth-input-wrap:focus-within { transform: translateY(-2px); }
.auth-page .auth-input {
    display: block;
    width: 100%;
    height: 56px;
    padding: 15px 48px 15px 17px;
    border: 1px solid var(--auth-field-border);
    border-radius: 13px;
    outline: 0;
    color: var(--auth-text);
    background: var(--auth-field);
    font: inherit;
    font-size: 15px;
    transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
    appearance: none;
}

.auth-page .auth-input::placeholder { color: rgba(238, 241, 248, .32); opacity: 1; }
.auth-page .auth-input:hover { border-color: rgba(255, 255, 255, .18); background: var(--auth-field-hover); }
.auth-page .auth-input:focus {
    border-color: rgba(138, 217, 255, .62);
    background: var(--auth-field-hover);
    box-shadow: 0 0 0 4px rgba(80, 180, 239, .1);
}

.auth-page .auth-input--password { padding-right: 90px; }
.auth-field-status {
    position: absolute;
    top: 50%;
    right: 14px;
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(.72);
    transition: color .18s ease, background-color .18s ease, opacity .18s ease, transform .18s ease;
}

.auth-field-status--before-toggle { right: 52px; }
.auth-field.is-valid .auth-field-status,
.auth-field.is-invalid .auth-field-status {
    opacity: 1;
    transform: translateY(-50%) scale(1);
}

.auth-field.is-valid .auth-field-status {
    color: #34d399;
    background: rgba(16, 185, 129, .12);
}

.auth-field.is-invalid .auth-field-status {
    color: #fb7185;
    background: rgba(244, 63, 94, .12);
}

.auth-page .auth-field.is-valid .auth-input {
    border-color: rgba(52, 211, 153, .56);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, .08);
}

.auth-page .auth-field.is-invalid .auth-input {
    border-color: rgba(251, 113, 133, .62);
    box-shadow: 0 0 0 3px rgba(244, 63, 94, .08);
}

.auth-password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    color: rgba(238, 241, 248, .48);
    background: transparent;
    cursor: pointer;
    transform: translateY(-50%);
    transition: color .2s ease, background .2s ease;
}

.auth-password-toggle:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.auth-remember {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 19px 0 22px;
    color: var(--auth-muted);
    font-size: 13px;
    cursor: pointer;
}

.auth-remember input {
    appearance: none;
    display: grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 5px;
    background: rgba(255, 255, 255, .04);
    cursor: pointer;
}

.auth-remember input:checked { border-color: #f8fafc; background: #f8fafc; }
.auth-remember input:checked::after {
    content: '';
    width: 8px;
    height: 5px;
    margin-top: -2px;
    border-left: 2px solid #050506;
    border-bottom: 2px solid #050506;
    transform: rotate(-45deg);
}

.auth-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 14px 18px;
    border: 1px solid #f8fafc;
    border-radius: 13px;
    color: #050506;
    background: #f8fafc;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .22);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-submit i { font-size: 12px; transition: transform .2s ease; }
.auth-submit:hover { background: #fff; transform: translateY(-2px); box-shadow: 0 15px 32px rgba(0, 0, 0, .3), 0 0 22px rgba(255, 255, 255, .06); }
.auth-submit:hover i { transform: translateX(3px); }
.auth-submit:active { transform: translateY(0); }
.auth-submit:disabled {
    cursor: wait;
    opacity: .82;
    transform: none;
}

.auth-submit.is-loading i {
    width: 15px;
    height: 15px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 999px;
    font-size: 0;
    animation: authSubmitSpin .7s linear infinite;
}

@keyframes authSubmitSpin { to { transform: rotate(360deg); } }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 25px 0 18px;
    color: rgba(238, 241, 248, .35);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .12em;
    text-align: center;
}

.auth-divider::before,
.auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255, 255, 255, .09); }
.auth-social-actions { display: grid; gap: 10px; }
.auth-social-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 11px 14px;
    border: 1px solid rgba(255, 255, 255, .12);
    border-radius: 13px;
    color: rgba(247, 248, 251, .88);
    background: rgba(255, 255, 255, .035);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}

.auth-social-button i { font-size: 17px; }
.auth-page .auth-social-button--discord {
    border-color: #5865f2;
    color: #fff;
    background: #5865f2;
    box-shadow: 0 10px 24px rgba(88, 101, 242, .22);
}

.auth-page .auth-social-button--discord i { color: #fff; }
.auth-page .auth-social-button--discord:hover {
    border-color: #4752c4;
    color: #fff;
    background: #4752c4;
    box-shadow: 0 13px 28px rgba(71, 82, 196, .3);
}
.auth-social-button:hover {
    color: #fff;
    border-color: rgba(255, 255, 255, .22);
    background: rgba(255, 255, 255, .07);
    transform: translateY(-1px);
}

.auth-footnote { margin: 24px 0 0; color: var(--auth-muted); font-size: 13px; text-align: center; }
.auth-footnote a { color: var(--auth-text); font-weight: 600; text-decoration: none; }
.auth-footnote a:hover { text-decoration: underline; text-underline-offset: 4px; }
.auth-footnote-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: 4px;
    padding: 7px 10px 7px 12px;
    border: 1px solid rgba(138, 217, 255, .26);
    border-radius: 999px;
    color: #a6e1ff !important;
    background: rgba(80, 180, 239, .09);
    line-height: 1;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease, transform .18s ease;
}

.auth-footnote-link i {
    font-size: 10px;
    transition: transform .18s ease;
}

.auth-footnote-link:hover {
    border-color: rgba(138, 217, 255, .48);
    color: #d5f2ff !important;
    background: rgba(80, 180, 239, .16);
    text-decoration: none !important;
    transform: translateY(-1px);
}

.auth-footnote-link:hover i { transform: translateX(2px); }
.auth-page--register .auth-card-body { padding-top: 30px; }
.auth-page--register .auth-fields { gap: 16px; }
.auth-page--register .auth-submit { margin-top: 22px; }
.auth-page--register .auth-subtitle { margin-bottom: 24px; }
.auth-page--register .auth-divider { margin-top: 22px; }

.auth-page :is(a, button, input):focus-visible {
    outline: 2px solid var(--auth-focus);
    outline-offset: 3px;
}

body[data-theme='pearl'] .auth-page,
body[data-theme='ocean'] .auth-page {
    --auth-bg: #edf3f8;
    --auth-card: rgba(255, 255, 255, .78);
    --auth-card-border: rgba(39, 55, 74, .11);
    --auth-field: rgba(236, 242, 247, .86);
    --auth-field-hover: #fff;
    --auth-field-border: rgba(39, 55, 74, .13);
    --auth-text: #111820;
    --auth-muted: rgba(30, 47, 65, .62);
    --auth-label: rgba(17, 24, 32, .82);
    color-scheme: light;
}

body[data-theme='pearl'] .auth-background,
body[data-theme='ocean'] .auth-background {
    background:
        radial-gradient(circle at 18% 15%, rgba(74, 183, 237, .18), transparent 34%),
        radial-gradient(circle at 84% 82%, rgba(91, 125, 229, .13), transparent 36%),
        linear-gradient(145deg, #f7f9fb, #e9f1f7);
}

body[data-theme='pearl'] .auth-card,
body[data-theme='ocean'] .auth-card { box-shadow: 0 28px 80px rgba(39, 61, 82, .16), inset 0 1px 0 rgba(255, 255, 255, .7); }
body[data-theme='pearl'] .auth-brand-mark,
body[data-theme='ocean'] .auth-brand-mark { color: #fff; background: #111820; }
body[data-theme='pearl'] .auth-brand:hover,
body[data-theme='ocean'] .auth-brand:hover { color: #111820; }
body[data-theme='pearl'] .auth-theme-toggle,
body[data-theme='ocean'] .auth-theme-toggle { border-color: rgba(39, 55, 74, .13); color: rgba(17, 24, 32, .62); background: rgba(255, 255, 255, .54); }
body[data-theme='pearl'] .auth-theme-toggle:hover,
body[data-theme='ocean'] .auth-theme-toggle:hover { color: #111820; border-color: rgba(39, 55, 74, .24); background: #fff; }
body[data-theme='pearl'] .auth-page .auth-input::placeholder,
body[data-theme='ocean'] .auth-page .auth-input::placeholder { color: rgba(30, 47, 65, .4); }
body[data-theme='pearl'] .auth-password-toggle,
body[data-theme='ocean'] .auth-password-toggle { color: rgba(30, 47, 65, .48); }
body[data-theme='pearl'] .auth-password-toggle:hover,
body[data-theme='ocean'] .auth-password-toggle:hover { color: #111820; background: rgba(39, 55, 74, .08); }
body[data-theme='pearl'] .auth-remember input,
body[data-theme='ocean'] .auth-remember input { border-color: rgba(39, 55, 74, .28); background: rgba(255, 255, 255, .56); }
body[data-theme='pearl'] .auth-remember input:checked,
body[data-theme='ocean'] .auth-remember input:checked { border-color: #111820; background: #111820; }
body[data-theme='pearl'] .auth-remember input:checked::after,
body[data-theme='ocean'] .auth-remember input:checked::after { border-color: #fff; }
body[data-theme='pearl'] .auth-submit,
body[data-theme='ocean'] .auth-submit { border-color: #111820; color: #fff; background: #111820; box-shadow: 0 10px 24px rgba(24, 39, 54, .17); }
body[data-theme='pearl'] .auth-submit:hover,
body[data-theme='ocean'] .auth-submit:hover { background: #05090d; }
body[data-theme='pearl'] .auth-divider,
body[data-theme='ocean'] .auth-divider { color: rgba(30, 47, 65, .4); }
body[data-theme='pearl'] .auth-divider::before,
body[data-theme='pearl'] .auth-divider::after,
body[data-theme='ocean'] .auth-divider::before,
body[data-theme='ocean'] .auth-divider::after { background: rgba(39, 55, 74, .13); }
body[data-theme='pearl'] .auth-social-button,
body[data-theme='ocean'] .auth-social-button { border-color: rgba(39, 55, 74, .13); color: rgba(17, 24, 32, .84); background: rgba(255, 255, 255, .55); }
body[data-theme='pearl'] .auth-social-button:hover,
body[data-theme='ocean'] .auth-social-button:hover { color: #111820; border-color: rgba(39, 55, 74, .23); background: #fff; }
body[data-theme='pearl'] .auth-page .auth-social-button--discord,
body[data-theme='ocean'] .auth-page .auth-social-button--discord {
    border-color: #5865f2;
    color: #fff;
    background: #5865f2;
}

body[data-theme='pearl'] .auth-page .auth-social-button--discord:hover,
body[data-theme='ocean'] .auth-page .auth-social-button--discord:hover {
    border-color: #4752c4;
    color: #fff;
    background: #4752c4;
}

body[data-theme='pearl'] .auth-footnote-link,
body[data-theme='ocean'] .auth-footnote-link {
    border-color: rgba(22, 133, 232, .22);
    color: #0872c9 !important;
    background: rgba(22, 133, 232, .07);
}

body[data-theme='pearl'] .auth-footnote-link:hover,
body[data-theme='ocean'] .auth-footnote-link:hover {
    border-color: rgba(22, 133, 232, .38);
    color: #075ea5 !important;
    background: rgba(22, 133, 232, .13);
}

@media (max-width: 520px) {
    .auth-shell { padding: 14px 12px; }
    .auth-card { border-radius: 18px; }
    .auth-card-top { padding: 25px 24px 0; }
    .auth-card-body { padding: 28px 24px 30px; }
    .auth-heading { font-size: 28px; }
    .auth-subtitle { margin-bottom: 25px; font-size: 13px; }
    .auth-fields { gap: 17px; }
    .auth-page .auth-input { height: 53px; }
    .auth-submit { min-height: 53px; }
    .auth-brand-name { font-size: 16px; }
    .auth-brand-mark { flex-basis: 36px; width: 36px; height: 36px; }
}

@media (max-width: 360px) {
    .auth-card-top { padding-inline: 19px; }
    .auth-card-body { padding-inline: 19px; }
    .auth-brand { gap: 10px; }
    .auth-brand-name { max-width: 180px; }
}

@media (hover: none) {
    .auth-brand:hover .auth-brand-mark,
    .auth-theme-toggle:hover,
    .auth-submit:hover,
    .auth-social-button:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .auth-page *,
    .auth-page *::before,
    .auth-page *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}
