/**
 * Finapps login — always dark, centered card, no side illustration.
 */
html:has(.finapps-login-page),
html.fi-login-dark,
html.dark:has(.finapps-login-page),
html.dark.fi-login-dark {
    color-scheme: dark;
}

html:has(.finapps-login-page),
html:has(.finapps-login-page) body,
html.fi-login-dark,
html.fi-login-dark body,
html.dark.fi-login-dark,
html.dark.fi-login-dark body,
body.finapps-login-page,
body.fi-body.finapps-login-page,
body.fi-body:has(.finapps-login-page) {
    min-height: 100vh !important;
    margin: 0;
    background-color: #0a0a0f !important;
    background-image:
        radial-gradient(ellipse 80% 50% at 15% 0%, rgba(52, 211, 153, 0.12) 0%, transparent 52%),
        radial-gradient(ellipse 70% 50% at 85% 10%, rgba(167, 139, 250, 0.1) 0%, transparent 48%),
        radial-gradient(ellipse 60% 45% at 50% 100%, rgba(56, 189, 248, 0.1) 0%, transparent 45%),
        radial-gradient(ellipse 70% 45% at 30% 60%, rgba(255, 107, 0, 0.15) 0%, transparent 55%),
        radial-gradient(ellipse at center, rgba(255, 107, 0, 0.18) 0%, transparent 65%),
        url('/theme-v2/dotsbg.jpg') !important;
    background-size: auto, auto, auto, auto, auto, 480px 480px !important;
    background-repeat: no-repeat, no-repeat, no-repeat, no-repeat, no-repeat, repeat !important;
    background-position: center, center, center, center, center, top left !important;
    background-attachment: fixed !important;
    background-blend-mode: normal, normal, normal, normal, normal, soft-light !important;
}

html:has(.finapps-login-page) .fi-topbar,
html:has(.finapps-login-page) .fi-sidebar,
html.fi-login-dark .fi-topbar,
html.fi-login-dark .fi-sidebar {
    display: none !important;
}

html:has(.finapps-login-page) .fi-main,
html:has(.finapps-login-page) .fi-main-ctn,
html:has(.finapps-login-page) .fi-simple-layout,
html:has(.finapps-login-page) .fi-layout,
html.fi-login-dark .fi-main,
html.fi-login-dark .fi-main-ctn,
html:has(.finapps-login-page) .app-v2-auth-shell {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    background: transparent !important;
    box-shadow: none !important;
}

.app-v2-auth-shell {
    box-sizing: border-box;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    width: 100%;
    padding: 1rem;
}

.app-v2-auth-inner {
    box-sizing: border-box;
    width: 100%;
    max-width: 29.375rem;
    margin-inline: auto;
}

.app-v2-auth-card {
    box-sizing: border-box;
    width: 100%;
    padding: 2rem 1.75rem 2.25rem;
    border-radius: 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background:
        linear-gradient(165deg, rgba(255, 152, 0, 0.08) 0%, transparent 42%),
        linear-gradient(180deg, #1e2128 0%, #16181e 52%, #12141a 100%) !important;
    box-shadow:
        0 24px 80px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 107, 0, 0.06) inset,
        0 1px 0 rgba(255, 255, 255, 0.06) inset;
    color: rgba(255, 255, 255, 0.94);
}

.app-v2-auth-card *,
.app-v2-auth-card *::before,
.app-v2-auth-card *::after {
    box-sizing: border-box;
}

.app-v2-auth-logo__text {
    color: #f8fafc !important;
}

.app-v2-auth-logo__img {
    filter: drop-shadow(0 8px 24px rgba(255, 107, 0, 0.25));
}

.app-v2-auth-card .fi-simple-layout,
.app-v2-auth-card .fi-simple-main-ctn,
.app-v2-auth-card .fi-simple-main,
.app-v2-auth-card .fi-glass-login-root,
.app-v2-auth-card .fi-simple-page,
.app-v2-auth-card .fi-simple-page > section,
.app-v2-auth-card form,
.app-v2-auth-card .fi-form,
.app-v2-auth-card .fi-fo-field-wrp,
.app-v2-auth-card .fi-input-wrapped {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: auto !important;
}

.app-v2-auth-card .fi-simple-main,
.app-v2-auth-card .fi-simple-page,
.app-v2-auth-card .fi-glass-login-panel {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
}

.app-v2-auth-card .fi-simple-header {
    display: none !important;
}

.app-v2-auth-card form {
    display: block;
}

.app-v2-auth-card input:not([type='checkbox']):not([type='radio']),
.app-v2-auth-card .fi-input-wrapped {
    width: 100% !important;
    max-width: 100% !important;
}

.app-v2-auth-card .fi-btn.fi-btn-color-primary,
.app-v2-auth-card button.fi-btn[type='submit'],
.app-v2-auth-card .fi-ac-actions .fi-btn {
    width: 100% !important;
    max-width: 100% !important;
}

.app-v2-auth-card .fi-fo-field-wrp label span {
    color: #e2e8f0 !important;
    font-weight: 600;
    font-size: 0.875rem;
}

.app-v2-auth-card .fi-input-wrapped {
    border-radius: 0.5rem !important;
    background: #0f1117 !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
}

.app-v2-auth-card .fi-input-wrapped:focus-within {
    border-color: rgba(255, 152, 0, 0.45) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 0, 0.15) !important;
}

.app-v2-auth-card .fi-input-wrapped input {
    color: #f8fafc !important;
    background: transparent !important;
}

.app-v2-auth-card .fi-input-wrapped input::placeholder {
    color: #64748b !important;
}

.app-v2-auth-card .fi-fo-checkbox-wrp label {
    color: #cbd5e1 !important;
}

.app-v2-auth-card .fi-btn.fi-btn-color-primary {
    margin-top: 0.25rem;
    min-height: 2.75rem;
    border-radius: 0.625rem !important;
    background: linear-gradient(135deg, #ff6b00 0%, #ff9a3c 55%, #ffb366 100%) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    box-shadow: 0 0 28px rgba(255, 107, 0, 0.35), 0 12px 28px -10px rgba(255, 107, 0, 0.5) !important;
}

.app-v2-auth-card .fi-btn.fi-btn-color-primary:hover {
    filter: brightness(1.06);
}

.app-v2-auth-card .fi-ac-action a.fi-link {
    color: #ff9a3c !important;
}

.app-v2-auth-card .fi-fo-field-wrp-error-message,
.app-v2-auth-card .fi-fo-field-wrp .text-danger-600,
.app-v2-auth-card .fi-fo-field-wrp .text-danger-500 {
    color: #fca5a5 !important;
}

.app-v2-auth-card .fi-simple-page .fi-simple-header-subheading,
.app-v2-auth-card .fi-simple-page .fi-simple-header-subheading a {
    color: rgba(255, 255, 255, 0.65) !important;
}

.app-v2-auth-subtitle {
    margin: 0 0 1.5rem;
    text-align: center;
    font-size: 0.875rem;
    line-height: 1.5;
    font-weight: 500;
    color: #94a3b8 !important;
}

.app-v2-auth-tenant-heading {
    margin-bottom: 1rem;
    text-align: center;
}

.app-v2-auth-tenant-heading__title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #f8fafc;
}

.app-v2-auth-tenant-heading__sub {
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: #94a3b8;
}
