/* WalletGateway — liquid-glass Filament auth (login / register / MFA) */

:root {
    --wg-auth-accent: #38bdf8;
    --wg-auth-accent-strong: #0ea5e9;
    --wg-auth-admin: #a78bfa;
    --wg-auth-admin-strong: #8b5cf6;
    --wg-auth-client: #818cf8;
    --wg-auth-client-strong: #6366f1;
}

.wg-auth-app {
    --wg-accent: var(--wg-auth-accent);
    --wg-accent-strong: var(--wg-auth-accent-strong);
    position: relative;
    isolation: isolate;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 1.25rem 1rem 1.5rem;
    overflow: visible;
    color: #f1f5f9;
    background: #070b14;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    color-scheme: dark;
}

.wg-auth-app--admin {
    --wg-accent: var(--wg-auth-admin);
    --wg-accent-strong: var(--wg-auth-admin-strong);
}

.wg-auth-app--client {
    --wg-accent: var(--wg-auth-client);
    --wg-accent-strong: var(--wg-auth-client-strong);
}

body:has(.wg-auth-app) {
    background: #070b14 !important;
    height: auto !important;
    min-height: 100dvh;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

html:has(.wg-auth-app) {
    height: auto !important;
    overflow-y: auto !important;
}

.fi-body:has(.wg-auth-app),
.fi-simple-layout:has(.wg-auth-app) {
    height: auto !important;
    min-height: 100dvh;
    overflow: visible !important;
}

.wg-auth-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(1200px 600px at 12% -10%, rgb(56 189 248 / 0.16), transparent 55%),
        radial-gradient(900px 500px at 110% 15%, rgb(124 58 237 / 0.22), transparent 50%),
        radial-gradient(700px 480px at 50% 120%, rgb(14 165 233 / 0.1), transparent 55%),
        linear-gradient(180deg, #0b1220 0%, #070b14 45%, #05070d 100%);
}

.wg-auth-app--admin .wg-auth-mesh {
    background:
        radial-gradient(1200px 600px at 12% -10%, rgb(167 139 250 / 0.2), transparent 55%),
        radial-gradient(900px 500px at 110% 15%, rgb(99 102 241 / 0.18), transparent 50%),
        radial-gradient(700px 480px at 50% 120%, rgb(139 92 246 / 0.12), transparent 55%),
        linear-gradient(180deg, #0d0b1a 0%, #070b14 45%, #05070d 100%);
}

.wg-auth-app--client .wg-auth-mesh {
    background:
        radial-gradient(1200px 600px at 12% -10%, rgb(129 140 248 / 0.2), transparent 55%),
        radial-gradient(900px 500px at 110% 15%, rgb(56 189 248 / 0.12), transparent 50%),
        radial-gradient(700px 480px at 50% 120%, rgb(99 102 241 / 0.14), transparent 55%),
        linear-gradient(180deg, #0b1020 0%, #070b14 45%, #05070d 100%);
}

.wg-auth-orb {
    position: absolute;
    border-radius: 9999px;
    filter: blur(40px);
    opacity: 0.55;
    animation: wg-auth-drift 22s ease-in-out infinite;
}

.wg-auth-orb--a {
    width: 18rem;
    height: 18rem;
    top: -6rem;
    left: -4rem;
    background: var(--wg-accent);
}

.wg-auth-orb--b {
    width: 16rem;
    height: 16rem;
    right: -5rem;
    bottom: 10%;
    background: var(--wg-accent-strong);
    animation-duration: 28s;
    animation-direction: reverse;
}

.wg-auth-orb--c {
    width: 10rem;
    height: 10rem;
    left: 40%;
    bottom: -4rem;
    background: #e2e8f0;
    opacity: 0.12;
    animation-duration: 26s;
}

@keyframes wg-auth-drift {
    0%,
    100% {
        transform: translate3d(0, 0, 0) scale(1);
    }
    50% {
        transform: translate3d(4%, 6%, 0) scale(1.08);
    }
}

.wg-auth-glass {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 26.5rem;
    padding: 1.35rem 1.25rem 1.5rem;
    border-radius: 1.5rem;
    border: 1px solid rgb(255 255 255 / 0.12);
    background: linear-gradient(
        180deg,
        rgb(255 255 255 / 0.14) 0%,
        rgb(15 23 42 / 0.28) 48%,
        rgb(2 6 23 / 0.42) 100%
    );
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 0.16),
        0 24px 80px -24px rgb(0 0 0 / 0.7);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
}

.wg-auth-header__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.wg-auth-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

.wg-auth-brand__logo {
    width: 2rem;
    height: 2rem;
    border-radius: 0.6rem;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgb(255 255 255 / 0.12);
}

.wg-auth-brand__text {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.1rem;
}

.wg-auth-brand__name {
    font-size: 0.8125rem;
    font-weight: 650;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wg-auth-brand__panel {
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgb(226 232 240 / 0.62);
}

.wg-auth-alt {
    flex-shrink: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #f8fafc;
    text-decoration: none;
    padding: 0.4rem 0.8rem;
    border-radius: 9999px;
    border: 1px solid rgb(255 255 255 / 0.14);
    background: rgb(255 255 255 / 0.08);
    transition: background 0.15s, border-color 0.15s;
}

.wg-auth-alt:hover {
    background: rgb(255 255 255 / 0.14);
    border-color: rgb(255 255 255 / 0.22);
}

.wg-auth-title {
    margin: 0 0 0.4rem;
    font-size: 1.375rem;
    font-weight: 650;
    letter-spacing: -0.03em;
    line-height: 1.25;
    color: #f8fafc;
}

.wg-auth-subtitle {
    margin: 0 0 1.35rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgb(226 232 240 / 0.62);
}

.wg-auth-form-title {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.wg-auth-hint {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgb(226 232 240 / 0.62);
}

.wg-auth-switch {
    margin: 1.15rem 0 0;
    text-align: center;
    font-size: 0.8125rem;
    color: rgb(148 163 184 / 0.95);
}

.wg-auth-switch a,
.wg-auth-switch button {
    font-weight: 650;
    color: var(--wg-accent) !important;
}

.wg-auth-body .fi-simple-layout,
.wg-auth-body .fi-simple-main-ctn,
.wg-auth-body .fi-simple-main,
.wg-auth-body .fi-simple-page,
.wg-auth-body .fi-page {
    max-width: none !important;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
    gap: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.wg-auth-body .fi-simple-header,
.wg-auth-body .fi-header,
.wg-auth-body .fi-logo {
    display: none !important;
}

.wg-auth-app,
.wg-auth-glass,
.wg-auth-body {
    --gray-950: oklch(0.985 0.002 247.839);
    --gray-900: oklch(0.967 0.001 286.375);
    --gray-800: oklch(0.92 0.004 286.32);
    --gray-700: oklch(0.871 0.006 286.286);
    --gray-600: oklch(0.82 0.01 286.2);
    --gray-500: oklch(0.78 0.012 286.1);
    --color-gray-950: oklch(0.985 0.002 247.839);
    --color-gray-900: oklch(0.967 0.001 286.375);
    --color-gray-800: oklch(0.92 0.004 286.32);
    --color-gray-700: oklch(0.871 0.006 286.286);
    --color-gray-600: oklch(0.82 0.01 286.2);
    --color-gray-500: oklch(0.78 0.012 286.1);
}

.wg-auth-body .fi-fo-field-wrp,
.wg-auth-body .fi-sc-field,
.wg-auth-body .fi-fo-field {
    margin-bottom: 0.85rem;
    color: #e8eef7 !important;
}

.wg-auth-body .fi-fo-field-label,
.wg-auth-body .fi-fo-field-label-col,
.wg-auth-body .fi-fo-field-label-ctn,
.wg-auth-body .fi-fo-field-label-content,
.wg-auth-body .fi-fo-field-wrp-label,
.wg-auth-body .fi-fo-field-wrp-label span,
.wg-auth-body .fi-sc-field-label,
.wg-auth-body label,
.wg-auth-body label span {
    color: #e8eef7 !important;
    -webkit-text-fill-color: #e8eef7;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
}

.wg-auth-body .fi-fo-field-label-required-mark,
.wg-auth-body .fi-fo-field-label-content sup {
    color: #fb7185 !important;
    -webkit-text-fill-color: #fb7185;
}

.wg-auth-body .fi-sc-text,
.wg-auth-body .fi-fo-field-wrp-helper-text,
.wg-auth-body .fi-sc-field-hint,
.wg-auth-body .fi-fo-field-content-col .fi-sc-text {
    color: #cbd5e1 !important;
    -webkit-text-fill-color: #cbd5e1;
    font-size: 0.75rem !important;
    opacity: 1 !important;
}

.wg-auth-body .fi-input-wrp {
    border-radius: 0.875rem !important;
    border: 1px solid rgb(255 255 255 / 0.12) !important;
    background: rgb(2 6 23 / 0.45) !important;
    box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.06) !important;
    overflow: hidden;
}

.wg-auth-body .fi-input-wrp .fi-icon-btn,
.wg-auth-body .fi-input-wrp button {
    color: rgb(203 213 225 / 0.85) !important;
    background: transparent !important;
    box-shadow: none !important;
}

.wg-auth-body .fi-input-wrp:focus-within {
    border-color: color-mix(in srgb, var(--wg-accent) 70%, white) !important;
    box-shadow:
        inset 0 1px 0 rgb(255 255 255 / 0.08),
        0 0 0 3px color-mix(in srgb, var(--wg-accent) 28%, transparent) !important;
}

.wg-auth-body .fi-input-wrp input,
.wg-auth-body .fi-input-wrp textarea,
.wg-auth-body .fi-input {
    border: none !important;
    box-shadow: none !important;
    padding: 0.72rem 0.95rem !important;
    font-size: 0.9375rem !important;
    color: #f8fafc !important;
    -webkit-text-fill-color: #f8fafc;
    caret-color: #f8fafc;
    background: transparent !important;
}

.wg-auth-body .fi-input-wrp input::placeholder,
.wg-auth-body .fi-input-wrp textarea::placeholder,
.wg-auth-body .fi-input::placeholder {
    color: #94a3b8 !important;
    -webkit-text-fill-color: #94a3b8;
    opacity: 1 !important;
}

.wg-auth-body .fi-input-wrp input:-webkit-autofill,
.wg-auth-body .fi-input-wrp input:-webkit-autofill:hover,
.wg-auth-body .fi-input-wrp input:-webkit-autofill:focus {
    -webkit-text-fill-color: #f8fafc;
    -webkit-box-shadow: 0 0 0 1000px rgb(15 23 42 / 0.92) inset;
    caret-color: #f8fafc;
    transition: background-color 9999s ease-out 0s;
}

.wg-auth-body .fi-fo-checkbox {
    margin-top: 0.15rem;
}

.wg-auth-body .fi-fo-checkbox label,
.wg-auth-body .fi-fo-checkbox span {
    font-size: 0.8125rem;
    color: rgb(203 213 225 / 0.9) !important;
}

.wg-auth-body .fi-form-actions {
    margin-top: 1.1rem;
}

.wg-auth-body .fi-btn,
.wg-auth-body .fi-ac-btn-action {
    width: 100%;
    border-radius: 0.875rem !important;
    padding: 0.78rem 1.25rem !important;
    font-size: 0.9375rem !important;
    font-weight: 650 !important;
    color: #fff !important;
    background: var(--wg-accent-strong) !important;
    border: 1px solid rgb(255 255 255 / 0.08) !important;
    box-shadow: 0 10px 28px -12px color-mix(in srgb, var(--wg-accent-strong) 80%, black) !important;
}

.wg-auth-body .fi-btn:hover,
.wg-auth-body .fi-ac-btn-action:hover {
    filter: brightness(1.08);
}

.wg-auth-body .fi-link {
    font-weight: 650;
    color: var(--wg-accent) !important;
}

.wg-auth-body .fi-fo-field-wrp-error-message,
.wg-auth-body .fi-sc-field-error {
    color: #fda4af !important;
}

@media (min-width: 640px) {
    .wg-auth-app {
        padding: 2.5rem 1.5rem;
    }

    .wg-auth-glass {
        padding: 1.75rem 1.75rem 1.85rem;
    }

    .wg-auth-title {
        font-size: 1.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wg-auth-orb {
        animation: none;
    }
}

/* Legacy blade auth shell (unrouted when Filament is on) */
.wg-auth-shell-legacy {
    min-height: 100dvh;
}

.wg-auth-legacy-input {
    width: 100%;
    border-radius: 0.875rem;
    border: 1px solid rgb(255 255 255 / 0.12);
    background: rgb(2 6 23 / 0.45);
    padding: 0.72rem 0.95rem;
    font-size: 0.9375rem;
    color: #f8fafc;
    outline: none;
}

.wg-auth-legacy-input:focus {
    border-color: var(--wg-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--wg-accent) 28%, transparent);
}

.wg-auth-legacy-btn {
    width: 100%;
    border: none;
    border-radius: 0.875rem;
    padding: 0.78rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 650;
    color: #fff;
    cursor: pointer;
    background: var(--wg-accent-strong);
}

.wg-auth-legacy-alert {
    margin-bottom: 1rem;
    border-radius: 0.875rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.wg-auth-legacy-alert--error {
    background: rgb(127 29 29 / 0.35);
    border: 1px solid rgb(252 165 165 / 0.35);
    color: #fecaca;
}

.wg-auth-legacy-alert--success {
    background: rgb(6 78 59 / 0.35);
    border: 1px solid rgb(167 243 208 / 0.3);
    color: #a7f3d0;
}

/* Pending approval (authenticated agent page — keep light card) */
.wg-pending-approval {
    max-width: 40rem;
    margin: 0 auto;
    padding: 1.5rem 0 2rem;
}

.wg-pending-approval__card {
    border-radius: 1.25rem;
    border: 1px solid #bae6fd;
    background: linear-gradient(180deg, #f0f9ff, #fff);
    padding: 1.75rem;
}

.wg-pending-approval__steps {
    margin: 1.25rem 0 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.75rem;
}

.wg-pending-approval__steps li {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.875rem;
    color: #475569;
}

.wg-pending-approval__steps span {
    display: inline-flex;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 9999px;
    align-items: center;
    justify-content: center;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}
