/*
 * Shared entry-page UI for auth and error screens.
 * Light Apple-inspired glass style, separate from admin shell.
 */

:root {
    --auth-bg: #f6f8fb;
    --auth-surface: rgba(255, 255, 255, 0.78);
    --auth-border: rgba(255, 255, 255, 0.58);
    --auth-text: #172033;
    --auth-muted: #68778b;
    --auth-faint: #93a0b2;
    --auth-blue: #0a84ff;
    --auth-blue-dark: #0066d6;
    --auth-danger: #d94b4b;
    --auth-success: #27845b;
    --auth-font: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Dark HUD auth shell with electric border and galaxy field */
:root {
    --auth-bg: #050806;
    --auth-surface: rgba(17, 23, 20, 0.84);
    --auth-border: rgba(78, 222, 163, 0.22);
    --auth-text: #e7f5ee;
    --auth-muted: #8aa098;
    --auth-faint: #60746b;
    --auth-blue: #10b981;
    --auth-blue-dark: #0f9f72;
    --auth-danger: #ff6b76;
    --auth-success: #53e0a7;
}

body.auth-body,
body.auth-flow-page {
    position: relative;
    min-height: 100vh;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 72% 8%, rgba(83, 224, 167, 0.18), transparent 24rem),
        radial-gradient(circle at 20% 92%, rgba(43, 100, 68, 0.16), transparent 22rem),
        linear-gradient(135deg, #070b0f 0%, #101713 46%, #050806 100%) !important;
    color: var(--auth-text) !important;
}

.auth-bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.78;
}

.auth-main,
.auth-footer {
    position: relative;
    z-index: 1;
}

.auth-main {
    padding: 30px 18px 84px;
}

.auth-flow-shell {
    width: min(100%, 420px);
    padding: 0;
    border-radius: 24px;
    background: transparent !important;
    filter: none;
    animation: none;
}

.auth-flow-shell::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 0;
    border: 1px solid rgba(78, 222, 163, 0.22);
    border-radius: inherit;
    background: rgba(78, 222, 163, 0.035);
    filter: drop-shadow(0 0 18px rgba(16, 185, 129, 0.28));
    pointer-events: none;
    animation: none;
}

.auth-electric-canvas {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

/* Final override: ReactBits FloatingLines login background. */
html:has(body.auth-body),
html:has(body.auth-flow-page),
body.auth-body,
body.auth-flow-page {
    background: #120F17 !important;
}

body.auth-body,
body.auth-flow-page {
    overflow: hidden !important;
}

.floating-lines-container,
.auth-floating-lines-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
    overflow: hidden;
    background: #120F17;
}

.floating-lines-container canvas,
.auth-floating-lines-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.galaxy-container,
.auth-galaxy-container {
    display: none !important;
}

/* Keep both ICP and public security备案 visible on auth pages. */
body.auth-body .auth-footer,
body.auth-flow-page .auth-footer {
    position: fixed !important;
    left: 0;
    right: 0;
    bottom: max(10px, env(safe-area-inset-bottom));
    z-index: 30;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 0 16px;
    pointer-events: auto;
}

body.auth-body .auth-footer a,
body.auth-flow-page .auth-footer a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 16px;
    line-height: 16px;
    white-space: nowrap;
}

body.auth-body .auth-footer img,
body.auth-flow-page .auth-footer img {
    width: 12px;
    height: 12px;
    flex: 0 0 auto;
}

.auth-flow-shell.electric-border {
    box-shadow:
        0 0 0 1px rgba(2, 115, 77, 0.42),
        0 20px 70px rgba(0, 0, 0, 0.46) !important;
}

.eb-glow-1 {
    border-color: rgba(2, 115, 77, 0.5) !important;
    filter: blur(0.4px) !important;
}

.eb-glow-2 {
    border-color: rgba(111, 111, 111, 0.24) !important;
    filter: blur(1px) !important;
}

.eb-background-glow {
    opacity: 0 !important;
}

.auth-flow-shell::before {
    background: transparent !important;
    filter: none !important;
}

.auth-card-flow.eb-content,
.auth-card-compact.eb-content,
.auth-card.eb-content,
.auth-card,
.auth-card-flow,
.auth-card-compact {
    background: rgba(17, 24, 22, 0.82) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 28px 80px rgba(0, 0, 0, 0.48) !important;
}

/* Register page: keep the auth visual system, but allow full-page scrolling. */
body.auth-register-page {
    min-height: 100dvh;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
}

body.auth-register-page .auth-main {
    align-items: flex-start;
    min-height: 100dvh;
    padding-top: clamp(22px, 5vh, 54px);
    padding-bottom: calc(108px + env(safe-area-inset-bottom));
}

body.auth-register-page .auth-flow-shell {
    width: min(100%, 440px) !important;
}

body.auth-register-page .auth-card-compact,
body.auth-register-page .auth-register-card {
    padding: 30px !important;
}

body.auth-register-page .auth-brand {
    margin-bottom: 22px;
}

body.auth-register-page .auth-brand-mark {
    width: 54px;
    height: 54px;
    margin-bottom: 14px;
    border-radius: 18px;
}

body.auth-register-page .auth-brand-mark svg {
    width: 26px;
    height: 26px;
}

body.auth-register-page .auth-brand h3 {
    font-size: 20px !important;
}

body.auth-register-page .auth-form {
    gap: 13px;
}

body.auth-register-page .auth-field {
    gap: 6px;
}

body.auth-register-page .auth-input {
    min-height: 44px !important;
}

.auth-register-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 18px;
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 700;
}

@media (max-width: 520px) {
    body.auth-register-page .auth-main {
        padding: 18px 14px calc(112px + env(safe-area-inset-bottom));
    }

    body.auth-register-page .auth-card-compact,
    body.auth-register-page .auth-register-card {
        padding: 24px 20px !important;
        border-radius: 20px !important;
    }

    body.auth-register-page .auth-flow-shell {
        border-radius: 20px !important;
    }
}

/* Register page one-screen layout. */
body.auth-register-page {
    overflow: hidden !important;
}

body.auth-register-page .auth-main {
    align-items: center;
    padding: 18px 18px 86px;
}

body.auth-register-page .auth-flow-shell {
    width: min(100%, 560px) !important;
}

body.auth-register-page .auth-card-compact,
body.auth-register-page .auth-register-card {
    padding: 24px !important;
}

body.auth-register-page .auth-brand {
    margin-bottom: 18px;
}

body.auth-register-page .auth-brand-mark {
    width: 48px;
    height: 48px;
    margin-bottom: 12px;
    border-radius: 16px;
}

body.auth-register-page .auth-brand h3 {
    font-size: 19px !important;
}

body.auth-register-page .auth-brand p {
    margin-top: 4px;
}

body.auth-register-page .auth-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 14px;
}

body.auth-register-page .auth-form > .auth-field:nth-of-type(3),
body.auth-register-page .auth-form > .auth-field:nth-of-type(4),
body.auth-register-page .auth-form > .auth-submit {
    grid-column: 1 / -1;
}

body.auth-register-page .auth-field {
    gap: 5px;
}

body.auth-register-page .auth-label {
    font-size: 11px;
}

body.auth-register-page .auth-input {
    min-height: 42px !important;
    font-size: 13px !important;
}

body.auth-register-page .auth-hint {
    min-height: 16px;
    font-size: 10.5px;
}

body.auth-register-page .auth-submit {
    min-height: 42px !important;
    margin-top: 2px;
}

body.auth-register-page .auth-register-footer {
    margin-top: 14px;
}

@media (max-width: 640px) {
    body.auth-register-page {
        overflow-y: auto !important;
    }

    body.auth-register-page .auth-main {
        align-items: flex-start;
        padding: 16px 14px calc(104px + env(safe-area-inset-bottom));
    }

    body.auth-register-page .auth-flow-shell {
        width: min(100%, 430px) !important;
    }

    body.auth-register-page .auth-form {
        display: flex;
        gap: 10px;
    }

    body.auth-register-page .auth-card-compact,
    body.auth-register-page .auth-register-card {
        padding: 22px 18px !important;
    }
}

@media (max-height: 720px) and (min-width: 641px) {
    body.auth-register-page .auth-main {
        padding-top: 10px;
        padding-bottom: 70px;
    }

    body.auth-register-page .auth-card-compact,
    body.auth-register-page .auth-register-card {
        padding: 20px 22px !important;
    }

    body.auth-register-page .auth-brand {
        margin-bottom: 14px;
    }

    body.auth-register-page .auth-brand-mark {
        width: 42px;
        height: 42px;
        margin-bottom: 8px;
    }

    body.auth-register-page .auth-form {
        gap: 10px 12px;
    }

    body.auth-register-page .auth-input,
    body.auth-register-page .auth-submit {
        min-height: 40px !important;
    }
}

/* Final override: ReactBits FloatingLines login background. */
html:has(body.auth-body),
html:has(body.auth-flow-page),
body.auth-body,
body.auth-flow-page {
    background: #120F17 !important;
}

body.auth-body,
body.auth-flow-page {
    overflow: hidden !important;
}

.floating-lines-container,
.auth-floating-lines-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
    overflow: hidden;
    background: #120F17;
}

.floating-lines-container canvas,
.auth-floating-lines-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.galaxy-container,
.auth-galaxy-container {
    display: none !important;
}

.auth-flow-shell.electric-border {
    box-shadow:
        0 0 0 1px rgba(2, 115, 77, 0.42),
        0 20px 70px rgba(0, 0, 0, 0.46) !important;
}

.eb-glow-1 {
    border-color: rgba(2, 115, 77, 0.5) !important;
    filter: blur(0.4px) !important;
}

.eb-glow-2 {
    border-color: rgba(111, 111, 111, 0.24) !important;
    filter: blur(1px) !important;
}

.eb-background-glow {
    opacity: 0 !important;
}

.auth-flow-shell::before {
    background: transparent !important;
    filter: none !important;
}

.auth-card-flow.eb-content,
.auth-card-compact.eb-content,
.auth-card.eb-content,
.auth-card,
.auth-card-flow,
.auth-card-compact {
    background: rgba(17, 24, 22, 0.82) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 28px 80px rgba(0, 0, 0, 0.48) !important;
}

/* ReactBits FloatingLines auth background */
html:has(body.auth-body),
html:has(body.auth-flow-page),
body.auth-body,
body.auth-flow-page {
    background: #120F17 !important;
}

body.auth-body,
body.auth-flow-page {
    overflow: hidden;
}

.floating-lines-container,
.auth-floating-lines-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
    overflow: hidden;
    background: #120F17;
}

.floating-lines-container canvas,
.auth-floating-lines-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.galaxy-container,
.auth-galaxy-container {
    display: none !important;
}

.auth-flow-shell.electric-border {
    box-shadow:
        0 0 0 1px rgba(2, 115, 77, 0.42),
        0 20px 70px rgba(0, 0, 0, 0.46) !important;
}

.eb-glow-1 {
    border-color: rgba(2, 115, 77, 0.5) !important;
    filter: blur(0.4px) !important;
}

.eb-glow-2 {
    border-color: rgba(111, 111, 111, 0.24) !important;
    filter: blur(1px) !important;
}

.eb-background-glow {
    opacity: 0 !important;
}

.auth-flow-shell::before {
    background: transparent !important;
    filter: none !important;
}

.auth-card-flow.eb-content,
.auth-card-compact.eb-content,
.auth-card.eb-content,
.auth-card,
.auth-card-flow,
.auth-card-compact {
    background: rgba(17, 24, 22, 0.82) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 28px 80px rgba(0, 0, 0, 0.48) !important;
}

/* React Bits local effects: Galaxy background + ElectricBorder wrapper. */
body.auth-body,
body.auth-flow-page {
    background: #000101 !important;
}

.galaxy-container,
.auth-galaxy-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
    overflow: hidden;
}

.galaxy-container canvas,
.auth-galaxy-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.auth-main,
.auth-footer {
    position: relative;
    z-index: 1;
}

.auth-flow-shell.electric-border {
    --electric-light-color: oklch(from var(--electric-border-color) l c h);
    position: relative;
    isolation: isolate;
    overflow: visible;
    width: min(100%, 420px) !important;
    padding: 0 !important;
    border-radius: 17px !important;
    background: transparent !important;
    filter: none !important;
    animation: none !important;
    box-shadow:
        0 0 0 1px rgba(16, 185, 129, 0.56),
        0 0 10px rgba(16, 185, 129, 0.22) !important;
}

.auth-flow-shell.electric-border::before {
    content: none !important;
}

.eb-canvas-container {
    display: none !important;
}

.eb-canvas {
    display: block;
}

.eb-content {
    position: relative;
    z-index: 1;
    border-radius: inherit !important;
}

.eb-layers {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    pointer-events: none;
}

.eb-glow-1,
.eb-glow-2,
.eb-background-glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-sizing: border-box;
    pointer-events: none;
}

.eb-glow-1 {
    border: 1px solid rgba(16, 185, 129, 0.72);
    filter: blur(0.6px);
}

.eb-glow-2 {
    border: 1px solid rgba(83, 224, 167, 0.48);
    filter: blur(2px);
}

.eb-background-glow {
    z-index: -1;
    opacity: 0.08;
    background: rgba(16, 185, 129, 0.78);
    filter: blur(12px);
    transform: scale(1.015);
}

.auth-card-flow.eb-content,
.auth-card-compact.eb-content,
.auth-card.eb-content {
    border: 0 !important;
    border-radius: 17px !important;
    background:
        linear-gradient(180deg, rgba(21, 30, 28, 0.88), rgba(5, 10, 8, 0.94)) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 28px 80px rgba(0, 0, 0, 0.42) !important;
}

.auth-input,
.auth-card-flow .auth-input,
.auth-card-compact .auth-input {
    outline: none !important;
    border-color: rgba(16, 185, 129, 0.24) !important;
    background: rgba(0, 8, 5, 0.82) !important;
    color: #e7f5ee !important;
    -webkit-text-fill-color: #e7f5ee !important;
    caret-color: #53e0a7 !important;
}

.auth-input:hover,
.auth-card-flow .auth-input:hover,
.auth-card-compact .auth-input:hover {
    border-color: rgba(83, 224, 167, 0.44) !important;
    background: rgba(0, 10, 7, 0.9) !important;
}

.auth-input:focus,
.auth-input:focus-visible,
.auth-card-flow .auth-input:focus,
.auth-card-flow .auth-input:focus-visible,
.auth-card-compact .auth-input:focus,
.auth-card-compact .auth-input:focus-visible {
    outline: none !important;
    border-color: rgba(83, 224, 167, 0.72) !important;
    background: rgba(0, 12, 8, 0.94) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.13) !important;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-card-flow .auth-input:-webkit-autofill,
.auth-card-flow .auth-input:-webkit-autofill:hover,
.auth-card-flow .auth-input:-webkit-autofill:focus,
.auth-card-compact .auth-input:-webkit-autofill,
.auth-card-compact .auth-input:-webkit-autofill:hover,
.auth-card-compact .auth-input:-webkit-autofill:focus {
    border-color: rgba(83, 224, 167, 0.56) !important;
    box-shadow: 0 0 0 1000px #000805 inset, 0 0 0 3px rgba(16, 185, 129, 0.1) !important;
    -webkit-text-fill-color: #e7f5ee !important;
    caret-color: #53e0a7 !important;
    transition: background-color 9999s ease-in-out 0s;
}

.auth-check-label .checkbox,
.auth-check-label input[type="checkbox"] {
    appearance: none !important;
    -webkit-appearance: none !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    border: 1px solid rgba(83, 224, 167, 0.54) !important;
    border-radius: 5px !important;
    background: rgba(0, 10, 7, 0.88) !important;
    box-shadow: inset 0 0 0 2px rgba(0, 8, 5, 0.8) !important;
    accent-color: #10b981 !important;
}

.auth-check-label .checkbox:checked,
.auth-check-label input[type="checkbox"]:checked {
    border-color: rgba(83, 224, 167, 0.9) !important;
    background:
        linear-gradient(135deg, transparent 0 42%, #001a10 42% 58%, transparent 58%),
        linear-gradient(45deg, transparent 0 48%, #001a10 48% 64%, transparent 64%),
        #53e0a7 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.12), 0 0 12px rgba(16, 185, 129, 0.24) !important;
}

.auth-check-label .checkbox:focus,
.auth-check-label .checkbox:focus-visible,
.auth-check-label input[type="checkbox"]:focus,
.auth-check-label input[type="checkbox"]:focus-visible {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16) !important;
}

.auth-bg-canvas,
.auth-electric-canvas {
    display: none !important;
}

@media (max-width: 520px) {
    .auth-flow-shell.electric-border {
        width: min(100%, 430px) !important;
        border-radius: 17px !important;
    }

    .auth-card-flow.eb-content,
    .auth-card-compact.eb-content,
    .auth-card.eb-content {
        border-radius: 17px !important;
    }
}

.auth-card,
.auth-card-flow,
.auth-card-compact {
    width: 100%;
    border: 1px solid rgba(78, 222, 163, 0.2) !important;
    border-radius: 24px !important;
    background:
        linear-gradient(180deg, rgba(29, 41, 35, 0.88), rgba(11, 18, 14, 0.9)) !important;
    color: var(--auth-text) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.04),
        0 26px 80px rgba(0, 0, 0, 0.36) !important;
    backdrop-filter: blur(22px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
}

.auth-card-flow,
.auth-card-compact {
    padding: 34px;
}

.auth-card-flow .auth-brand h1,
.auth-card-flow .auth-brand h3,
.auth-brand h1,
.auth-brand h3 {
    color: var(--auth-text) !important;
    font-size: 21px;
    font-weight: 900;
}

.auth-card-flow .auth-brand p,
.auth-brand p,
.auth-card-flow .auth-check-label,
.auth-check-label,
.auth-label {
    color: var(--auth-muted) !important;
}

.auth-brand-mark,
.auth-card-flow .auth-brand-mark {
    border-color: rgba(78, 222, 163, 0.28) !important;
    background: rgba(78, 222, 163, 0.1) !important;
    color: #53e0a7 !important;
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.22) !important;
}

.auth-input,
.auth-card-flow .auth-input {
    min-height: 46px;
    border: 1px solid rgba(78, 222, 163, 0.2) !important;
    border-radius: 12px !important;
    background: rgba(5, 12, 9, 0.74) !important;
    color: var(--auth-text) !important;
    font-size: 13px;
    font-weight: 760;
    box-shadow: none !important;
}

.auth-input::placeholder,
.auth-card-flow .auth-input::placeholder {
    color: var(--auth-faint) !important;
}

.auth-input:focus,
.auth-card-flow .auth-input:focus {
    border-color: rgba(83, 224, 167, 0.62) !important;
    background: rgba(8, 16, 12, 0.9) !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12) !important;
}

.auth-input-wrap i,
.auth-input-wrap svg,
.auth-card-flow .auth-input-wrap i,
.auth-card-flow .auth-input-wrap svg {
    color: var(--auth-muted) !important;
}

.auth-submit,
.auth-card-flow .auth-submit {
    min-height: 46px;
    border: 1px solid rgba(78, 222, 163, 0.44) !important;
    border-radius: 12px !important;
    background: rgba(78, 222, 163, 0.14) !important;
    color: #53e0a7 !important;
    font-size: 13px;
    box-shadow: none !important;
}

.auth-submit:hover,
.auth-card-flow .auth-submit:hover {
    transform: translateY(-1px);
    background: rgba(78, 222, 163, 0.22) !important;
    color: #7dffd0 !important;
}

.auth-link {
    color: #53e0a7 !important;
}

.auth-link-group {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.auth-alert {
    border-color: rgba(255, 107, 118, 0.34);
    background: rgba(255, 107, 118, 0.1);
    color: #ff9ba3;
}

.auth-hint {
    color: var(--auth-muted);
}

.pwd-valid {
    color: #53e0a7 !important;
}

.pwd-invalid {
    color: #ff9ba3 !important;
}

.auth-footer a,
.auth-flow-page .auth-footer a {
    color: var(--auth-faint) !important;
}

.auth-footer a:hover,
.auth-flow-page .auth-footer a:hover {
    color: #53e0a7 !important;
}

@media (max-width: 520px) {
    .auth-card-flow,
    .auth-card-compact {
        padding: 28px 22px;
        border-radius: 22px !important;
    }

    .auth-flow-shell {
        width: min(100%, 430px);
        border-radius: 22px;
    }

    .auth-row {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }
}

html {
    min-height: 100%;
}

body.auth-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background:
        radial-gradient(circle at 14% 8%, rgba(183, 216, 255, 0.62), transparent 24rem),
        radial-gradient(circle at 88% 4%, rgba(218, 205, 255, 0.44), transparent 25rem),
        linear-gradient(180deg, #fbfcff 0%, var(--auth-bg) 58%, #eef3f9 100%);
    color: var(--auth-text);
    font-family: var(--auth-font);
    -webkit-font-smoothing: antialiased;
}

body.auth-flow-page {
    background: #fff;
    color: var(--auth-text);
}

.auth-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px 18px 84px;
}

.auth-card {
    position: relative;
    width: min(100%, 400px);
    padding: 34px;
    border: 1px solid var(--auth-border);
    border-radius: 30px;
    background: var(--auth-surface);
    box-shadow: 0 24px 70px rgba(45, 64, 88, 0.12);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
}

.auth-flow-shell {
    position: relative;
    isolation: isolate;
    width: min(100%, 404px);
    padding: 2px;
    border-radius: 32px;
    background: conic-gradient(
        from var(--flow-angle, 0deg),
        rgba(26, 115, 255, 1) 0deg,
        rgba(26, 115, 255, 1) 24deg,
        rgba(26, 115, 255, 0.08) 54deg,
        rgba(69, 182, 111, 0) 82deg,
        rgba(69, 182, 111, 1) 104deg,
        rgba(69, 182, 111, 0.08) 132deg,
        rgba(214, 180, 42, 0) 160deg,
        rgba(214, 180, 42, 1) 184deg,
        rgba(220, 107, 29, 1) 218deg,
        rgba(220, 107, 29, 0.08) 250deg,
        rgba(239, 64, 53, 0) 284deg,
        rgba(106, 92, 255, 1) 316deg,
        rgba(26, 115, 255, 1) 360deg
    );
    filter: saturate(1.3) brightness(1.08);
    animation: auth-flow-spin 9s ease-in-out infinite;
}

.auth-flow-shell::before {
    content: "";
    position: absolute;
    inset: -24px;
    z-index: -1;
    border-radius: 48px;
    background: conic-gradient(
        from var(--flow-angle, 0deg),
        rgba(26, 115, 255, 0.45) 0deg,
        rgba(26, 115, 255, 0.1) 48deg,
        rgba(69, 182, 111, 0) 78deg,
        rgba(69, 182, 111, 0.24) 112deg,
        rgba(214, 180, 42, 0) 154deg,
        rgba(220, 107, 29, 0.36) 216deg,
        rgba(239, 64, 53, 0.1) 274deg,
        rgba(106, 92, 255, 0.3) 318deg,
        rgba(26, 115, 255, 0.45) 360deg
    );
    opacity: 0.7;
    filter: blur(28px);
    pointer-events: none;
    animation: auth-flow-spin 9s ease-in-out infinite;
}

.auth-card-flow {
    isolation: isolate;
    overflow: hidden;
    width: 100%;
    min-height: auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 34px;
    border: 0;
    border-radius: 28px;
    background: #fff;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.92),
        inset 0 -18px 42px rgba(230, 236, 246, 0.18),
        0 22px 54px rgba(45, 64, 88, 0.1);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.auth-card-flow::before,
.auth-card-flow::after {
    content: none;
}

.auth-card-flow > * {
    position: relative;
    z-index: 1;
}

.auth-card-flow .auth-brand h1,
.auth-card-flow .auth-brand h3 {
    color: var(--auth-text);
    font-size: 20px;
    line-height: 1.2;
    font-weight: 900;
}

.auth-card-flow .auth-brand p,
.auth-card-flow .auth-check-label {
    color: var(--auth-muted);
}

.auth-card-flow .auth-brand {
    margin-bottom: 28px;
}

.auth-card-flow .auth-input {
    border-color: rgba(204, 215, 228, 0.76);
    min-height: 46px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.58);
    color: var(--auth-text);
    font-size: 14px;
    font-weight: 600;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

.auth-card-flow .auth-input::placeholder {
    color: var(--auth-faint);
}

.auth-card-flow .auth-input:focus {
    border-color: rgba(10, 132, 255, 0.72);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.14);
}

.auth-card-flow .auth-input-wrap i,
.auth-card-flow .auth-input-wrap svg {
    left: 15px;
    color: var(--auth-faint);
    width: 16px;
    height: 16px;
}

.auth-card-flow .auth-input-with-icon {
    padding-left: 44px;
}

.auth-card-flow .auth-link {
    color: var(--auth-blue-dark);
    font-size: 12px;
}

.auth-flow-page .auth-footer a {
    color: var(--auth-faint);
}

.auth-flow-page .auth-footer a:hover {
    color: var(--auth-blue-dark);
}

.auth-card-flow .auth-brand-mark {
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    border-color: rgba(10, 132, 255, 0.18);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(238, 246, 255, 0.86));
    color: var(--auth-blue);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.82),
        0 12px 30px rgba(10, 132, 255, 0.16);
}

.auth-card-flow .auth-brand-mark svg {
    width: 30px;
    height: 30px;
}

.auth-card-flow .auth-form {
    gap: 14px;
}

.auth-card-flow .auth-row {
    margin-top: 2px;
    padding: 0 4px;
}

.auth-card-flow .auth-check-label {
    font-size: 12px;
}

.auth-card-flow .checkbox {
    width: 16px;
    height: 16px;
    border-width: 2px;
    border-color: #4f46ff;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.48);
}

.auth-card-flow .auth-submit {
    min-height: 48px;
    margin-top: 8px;
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(235, 240, 247, 0.72)),
        rgba(245, 248, 252, 0.82);
    border: 1px solid rgba(210, 219, 232, 0.86);
    color: #263243;
    font-size: 14px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.9),
        0 12px 24px rgba(45, 64, 88, 0.1);
    backdrop-filter: blur(18px) saturate(150%);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.auth-card-flow .auth-submit:hover {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(229, 236, 246, 0.82)),
        rgba(245, 248, 252, 0.9);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.95),
        0 16px 30px rgba(45, 64, 88, 0.13);
}

@property --flow-angle {
    syntax: "<angle>";
    inherits: false;
    initial-value: 0deg;
}

@keyframes auth-flow-spin {
    to {
        --flow-angle: 360deg;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-flow-shell,
    .auth-flow-shell::before {
        animation: none;
    }
}

.auth-card-compact {
    padding: 28px;
}

.auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
    text-align: center;
}

.auth-brand-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin-bottom: 16px;
    border: 1px solid rgba(10, 132, 255, 0.18);
    border-radius: 20px;
    background: linear-gradient(180deg, var(--auth-blue), var(--auth-blue-dark));
    color: #fff;
    box-shadow: 0 12px 26px rgba(10, 132, 255, 0.22);
}

.auth-brand-mark svg,
.auth-input-wrap svg,
.auth-hint svg,
.auth-card svg.ui-icon {
    flex: 0 0 auto;
    stroke-width: 2;
}

.auth-brand-mark svg {
    width: 28px;
    height: 28px;
}

.auth-brand h1,
.auth-brand h3 {
    margin: 0;
    color: var(--auth-text);
    font-size: 20px;
    line-height: 1.25;
    font-weight: 800;
    letter-spacing: 0;
}

.auth-brand p {
    margin: 6px 0 0;
    color: var(--auth-faint);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0;
}

.auth-alert {
    margin-bottom: 18px;
    padding: 11px 13px;
    border: 1px solid #ffdada;
    border-radius: 16px;
    background: #fff1f1;
    color: var(--auth-danger);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.auth-label {
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 700;
}

.auth-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.auth-input-wrap i,
.auth-input-wrap svg {
    position: absolute;
    left: 15px;
    color: var(--auth-faint);
    width: 16px;
    height: 16px;
}

.auth-input {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid rgba(204, 215, 228, 0.86);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.78);
    color: var(--auth-text);
    font: 600 14px/1.4 var(--auth-font);
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.auth-input-with-icon {
    padding-left: 44px;
}

.auth-input:focus {
    border-color: var(--auth-blue);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(10, 132, 255, 0.14);
}

.auth-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 0 2px;
}

.auth-link {
    color: var(--auth-blue-dark);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.auth-link:hover {
    text-decoration: underline;
}

.auth-check-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--auth-muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.auth-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin-top: 8px;
    border: 0;
    border-radius: 18px;
    background: linear-gradient(180deg, var(--auth-blue), var(--auth-blue-dark));
    color: #fff;
    font: 800 14px/1 var(--auth-font);
    cursor: pointer;
    box-shadow: 0 12px 24px rgba(10, 132, 255, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.auth-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(10, 132, 255, 0.26);
}

.auth-footer {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 0 18px 24px;
}

.auth-footer a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--auth-faint);
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.auth-footer a:hover {
    color: var(--auth-blue-dark);
}

.pwd-invalid {
    color: var(--auth-danger);
}

.pwd-valid {
    color: var(--auth-success);
}

.auth-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 18px;
    color: var(--auth-faint);
    font-size: 11px;
    font-weight: 700;
}

.auth-hint svg {
    width: 14px;
    height: 14px;
}

.auth-error-code {
    margin: 0;
    color: var(--auth-text);
    font-size: 54px;
    line-height: 1;
    font-weight: 800;
}

.auth-error-text {
    margin: 12px 0 22px;
    color: var(--auth-muted);
    font-size: 14px;
    line-height: 1.7;
    font-weight: 600;
}

.auth-submit svg {
    width: 16px;
    height: 16px;
}

.auth-submit-secondary {
    border: 1px solid rgba(204, 215, 228, 0.86);
    background: rgba(255, 255, 255, 0.82);
    color: var(--auth-text);
    box-shadow: 0 10px 24px rgba(45, 64, 88, 0.08);
}

.qr-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: min(100%, 430px);
    text-align: center;
}

.qr-title {
    margin: 0 0 22px;
    color: var(--auth-text);
    font-size: 18px;
    line-height: 1.35;
    font-weight: 800;
}

.qr-image {
    width: min(100%, 320px);
    border: 8px solid #fff;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 46px rgba(45, 64, 88, 0.13);
}

.qr-actions {
    display: grid;
    width: min(100%, 280px);
    gap: 12px;
    margin-top: 26px;
}

@media (max-width: 520px) {
    .auth-main {
        align-items: flex-start;
        padding-top: 24px;
    }

    .auth-card {
        padding: 26px 22px;
        border-radius: 26px;
    }

    .auth-flow-shell {
        width: min(100%, 430px);
        border-radius: 32px;
    }

    .auth-card-flow {
        padding: 34px 24px;
    }

    .auth-card-flow .auth-brand {
        margin-bottom: 28px;
    }

    .auth-card-flow .auth-brand-mark {
        width: 68px;
        height: 68px;
        border-radius: 22px;
        margin-bottom: 18px;
    }

    .auth-card-flow .auth-brand-mark svg {
        width: 32px;
        height: 32px;
    }

    .auth-card-flow .auth-brand h1,
    .auth-card-flow .auth-brand h3 {
        font-size: 22px;
    }

    .auth-card-flow .auth-input {
        min-height: 54px;
        border-radius: 18px;
        font-size: 16px;
    }

    .auth-card-flow .auth-input-wrap i,
    .auth-card-flow .auth-input-wrap svg {
        left: 18px;
        width: 18px;
        height: 18px;
    }

    .auth-card-flow .auth-input-with-icon {
        padding-left: 50px;
    }

    .auth-card-flow .auth-submit {
        min-height: 56px;
        border-radius: 20px;
        font-size: 16px;
    }

    .auth-card-flow .auth-check-label,
    .auth-card-flow .auth-link {
        font-size: 13px;
    }
}

/* Final override: auth pages follow the current emerald HUD visual system. */
body.auth-body,
body.auth-flow-page {
    background:
        radial-gradient(circle at 72% 8%, rgba(83, 224, 167, 0.18), transparent 24rem),
        radial-gradient(circle at 20% 92%, rgba(43, 100, 68, 0.16), transparent 22rem),
        linear-gradient(135deg, #070b0f 0%, #101713 46%, #050806 100%) !important;
    color: #e7f5ee !important;
}

.auth-flow-shell {
    width: min(100%, 420px) !important;
    padding: 0 !important;
    border-radius: 24px !important;
    background: transparent !important;
    filter: none !important;
    animation: none !important;
}

.auth-flow-shell::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 0;
    border: 1px solid rgba(78, 222, 163, 0.22);
    border-radius: inherit;
    background: rgba(78, 222, 163, 0.035);
    filter: drop-shadow(0 0 18px rgba(16, 185, 129, 0.28));
    pointer-events: none;
    animation: none !important;
}

.auth-card,
.auth-card-flow,
.auth-card-compact {
    width: 100% !important;
    border: 1px solid rgba(78, 222, 163, 0.2) !important;
    border-radius: 24px !important;
    background: linear-gradient(180deg, rgba(29, 41, 35, 0.88), rgba(11, 18, 14, 0.9)) !important;
    color: #e7f5ee !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04), 0 26px 80px rgba(0, 0, 0, 0.36) !important;
    backdrop-filter: blur(22px) saturate(150%) !important;
    -webkit-backdrop-filter: blur(22px) saturate(150%) !important;
}

.auth-card-flow,
.auth-card-compact {
    padding: 34px !important;
}

.auth-brand h1,
.auth-brand h3,
.auth-card-flow .auth-brand h1,
.auth-card-flow .auth-brand h3 {
    color: #e7f5ee !important;
    font-size: 21px !important;
    font-weight: 900 !important;
}

.auth-brand p,
.auth-card-flow .auth-brand p,
.auth-check-label,
.auth-card-flow .auth-check-label,
.auth-label {
    color: #8aa098 !important;
}

.auth-brand-mark,
.auth-card-flow .auth-brand-mark {
    border-color: rgba(78, 222, 163, 0.28) !important;
    background: rgba(78, 222, 163, 0.1) !important;
    color: #53e0a7 !important;
    box-shadow: 0 0 28px rgba(16, 185, 129, 0.22) !important;
}

.auth-input,
.auth-card-flow .auth-input {
    min-height: 46px !important;
    border: 1px solid rgba(78, 222, 163, 0.2) !important;
    border-radius: 12px !important;
    background: rgba(5, 12, 9, 0.74) !important;
    color: #e7f5ee !important;
    font-size: 13px !important;
    font-weight: 760 !important;
    box-shadow: none !important;
}

.auth-input::placeholder,
.auth-card-flow .auth-input::placeholder {
    color: #60746b !important;
}

.auth-input:focus,
.auth-card-flow .auth-input:focus {
    border-color: rgba(83, 224, 167, 0.62) !important;
    background: rgba(8, 16, 12, 0.9) !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.12) !important;
}

.auth-submit,
.auth-card-flow .auth-submit {
    min-height: 46px !important;
    border: 1px solid rgba(78, 222, 163, 0.44) !important;
    border-radius: 12px !important;
    background: rgba(78, 222, 163, 0.14) !important;
    color: #53e0a7 !important;
    font-size: 13px !important;
    box-shadow: none !important;
}

.auth-submit:hover,
.auth-card-flow .auth-submit:hover {
    background: rgba(78, 222, 163, 0.22) !important;
    color: #7dffd0 !important;
}

.auth-link {
    color: #53e0a7 !important;
}

.auth-link-group {
    display: inline-flex;
    align-items: center;
    gap: 12px;
}

.auth-bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.78;
}

.auth-main,
.auth-footer {
    position: relative;
    z-index: 1;
}

.auth-electric-canvas {
    position: absolute;
    z-index: 3;
    pointer-events: none;
}

/* Final override: ReactBits FloatingLines login background. */
html:has(body.auth-body),
html:has(body.auth-flow-page),
body.auth-body,
body.auth-flow-page {
    background: #120F17 !important;
}

body.auth-body,
body.auth-flow-page {
    overflow: hidden !important;
}

.floating-lines-container,
.auth-floating-lines-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: auto;
    overflow: hidden;
    background: #120F17;
}

.floating-lines-container canvas,
.auth-floating-lines-container canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.galaxy-container,
.auth-galaxy-container {
    display: none !important;
}

.auth-flow-shell.electric-border {
    box-shadow:
        0 0 0 1px rgba(2, 115, 77, 0.42),
        0 20px 70px rgba(0, 0, 0, 0.46) !important;
}

.eb-glow-1 {
    border-color: rgba(2, 115, 77, 0.5) !important;
    filter: blur(0.4px) !important;
}

.eb-glow-2 {
    border-color: rgba(111, 111, 111, 0.24) !important;
    filter: blur(1px) !important;
}

.eb-background-glow {
    opacity: 0 !important;
}

.auth-flow-shell::before {
    background: transparent !important;
    filter: none !important;
}

.auth-card-flow.eb-content,
.auth-card-compact.eb-content,
.auth-card.eb-content,
.auth-card,
.auth-card-flow,
.auth-card-compact {
    background: rgba(17, 24, 22, 0.82) !important;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.05),
        0 28px 80px rgba(0, 0, 0, 0.48) !important;
}

