/* =========================================================
   NBFC — Custom Login Page Styles
   Two-column: branding panel (left) + form panel (right)
   ========================================================= */

/* ─── Reset LeptonX constraints + Bootstrap container override ─ */
body,
.lpx-scroll-container,
#lpx-wrapper,
.lpx-content-container,
.lpx-content {
    min-height: 100vh !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Override the Bootstrap .container wrapping the login page */
.container:has(> .nbfc-login-page) {
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Ensure body background matches the brand panel (covers any edge gaps) */
body:has(.nbfc-login-page) {
    background: #1E1B4B !important;
}

/* ─── Two-column grid ────────────────────────────────────── */
.nbfc-login-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 100vh;
}

/* ─── LEFT: Branding panel ───────────────────────────────── */
.nbfc-brand-panel {
    position: relative;
    background: linear-gradient(145deg, #1E1B4B 0%, #3730A3 50%, #4F46E5 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 3rem 3.5rem;
}

.nbfc-brand-inner {
    position: relative;
    z-index: 2;
    max-width: 420px;
}

/* Decorative glowing circles */
.nbfc-deco-circle {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}
.nbfc-deco-1 {
    width: 560px;
    height: 560px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.45) 0%, transparent 65%);
    top: -180px;
    right: -180px;
}
.nbfc-deco-2 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(167, 139, 250, 0.35) 0%, transparent 65%);
    bottom: -120px;
    left: -80px;
}
.nbfc-deco-3 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(224, 231, 255, 0.15) 0%, transparent 70%);
    top: 40%;
    left: 20%;
}

/* Logo */
.nbfc-brand-logo-mark {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.02em;
    flex-shrink: 0;
}

.nbfc-brand-logo-wrap {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 2.5rem;
}

.nbfc-brand-logo-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: brightness(0) invert(1);
}

.nbfc-brand-name {
    font-size: 2rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.03em;
    line-height: 1;
}

/* Tagline */
.nbfc-brand-tagline {
    font-size: 1.875rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin: 0 0 1rem 0;
    letter-spacing: -0.02em;
}

.nbfc-brand-subtitle {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.72);
    margin: 0 0 2.5rem 0;
    line-height: 1.65;
}

/* Feature list */
.nbfc-features {
    list-style: none;
    padding: 0;
    margin: 0 0 2.5rem 0;
}

.nbfc-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.9rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.nbfc-features li:last-child {
    border-bottom: none;
}

.nbfc-features li i {
    font-size: 1.05rem;
    color: #A5B4FC;
    flex-shrink: 0;
    width: 20px;
    text-align: center;
}

/* Compliance badge */
.nbfc-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.20);
    color: rgba(255, 255, 255, 0.88);
    border-radius: 100px;
    padding: 0.45rem 1.1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    backdrop-filter: blur(8px);
}

.nbfc-brand-badge i {
    color: #FCD34D;
}

/* ─── RIGHT: Form panel ──────────────────────────────────── */
.nbfc-form-panel {
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    position: relative;
    padding: 3rem;
    min-height: 100vh;
}

/* Language switcher — pinned top-right */
.nbfc-form-topbar {
    position: absolute;
    top: 1.75rem;
    right: 2rem;
    display: flex;
    align-items: center;
}

.nbfc-form-topbar .btn-outline-secondary {
    border-color: #E5E7EB;
    color: #6B7280;
    font-size: 0.8125rem;
    padding: 0.35rem 0.85rem;
}

.nbfc-form-topbar .btn-outline-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #374151;
}

/* The actual form card */
.nbfc-form-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

/* ─── Tenant Switcher ────────────────────────────────────── */
.nbfc-tenant-switch {
    background: #F5F3FF;
    border: 1px solid #E0E7FF;
    border-radius: 10px;
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
}

.nbfc-tenant-current {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8437rem;
    color: #4B5563;
    flex-wrap: wrap;
}

.nbfc-tenant-current > i {
    color: #6366F1;
    font-size: 0.95rem;
}

.nbfc-tenant-label {
    font-weight: 600;
    color: #374151;
}

.nbfc-tenant-name {
    font-weight: 500;
    color: #4F46E5;
}

.nbfc-tenant-switch-link {
    font-size: 0.78rem;
    color: #6366F1;
    text-decoration: none;
    font-weight: 500;
    margin-left: 2px;
    white-space: nowrap;
}

.nbfc-tenant-switch-link:hover {
    color: #4338CA;
    text-decoration: underline;
}

.nbfc-tenant-switch-form {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #E0E7FF;
}

.nbfc-tenant-hint {
    font-size: 0.78rem;
    color: #6B7280;
    margin: 0 0 0.6rem 0;
    line-height: 1.45;
}

.nbfc-tenant-input-row {
    display: flex;
    gap: 8px;
}

.nbfc-tenant-input {
    flex: 1;
    min-width: 0;
    height: 38px !important;
    font-size: 0.875rem !important;
    padding: 0 10px !important;
}

.nbfc-btn-tenant-switch {
    flex-shrink: 0;
    height: 38px;
    padding: 0 1rem;
    background: #4F46E5;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease;
    font-family: inherit;
    white-space: nowrap;
}

.nbfc-btn-tenant-switch:hover {
    background: #4338CA;
}

.nbfc-btn-tenant-switch:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.nbfc-tenant-error {
    margin-top: 0.5rem;
    font-size: 0.78rem;
    color: #DC2626;
    background: #FEF2F2;
    border: 1px solid #FECACA;
    border-radius: 6px;
    padding: 0.4rem 0.65rem;
}

/* Form header */
.nbfc-form-icon {
    font-size: 2.75rem;
    color: #4F46E5;
    margin-bottom: 1rem;
    line-height: 1;
}

.nbfc-form-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.35rem 0;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.nbfc-form-desc {
    font-size: 0.9rem;
    color: #6B7280;
    margin: 0 0 2rem 0;
    line-height: 1.5;
}

/* Alert for model-state errors */
.nbfc-error-alert {
    background: #FEF2F2;
    border: 1px solid #FECACA;
    color: #B91C1C;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

.nbfc-error-alert ul {
    margin: 0;
    padding-left: 1.25rem;
}

/* Form fields */
.nbfc-field {
    margin-bottom: 1.25rem;
}

.nbfc-label {
    display: block;
    font-size: 0.8437rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.45rem;
    letter-spacing: 0.005em;
}

.nbfc-input {
    width: 100%;
    height: 44px;
    padding: 0 14px;
    font-size: 0.9375rem;
    color: #111827;
    background: #FFFFFF;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    outline: none;
    transition: border-color 150ms ease, box-shadow 150ms ease;
    box-sizing: border-box;
    font-family: inherit;
}

.nbfc-input:focus {
    border-color: #4F46E5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.nbfc-input.input-validation-error {
    border-color: #EF4444;
}

.nbfc-input::placeholder {
    color: #9CA3AF;
}

/* Password input group (input + eye toggle) */
.nbfc-input-group {
    display: flex;
    align-items: stretch;
}

.nbfc-input-group .nbfc-input {
    border-radius: 8px 0 0 8px;
    flex: 1;
    min-width: 0;
}

.nbfc-input-addon {
    flex-shrink: 0;
    height: 44px;
    width: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F9FAFB;
    border: 1.5px solid #D1D5DB;
    border-left: none;
    border-radius: 0 8px 8px 0;
    cursor: pointer;
    color: #6B7280;
    transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
    padding: 0;
}

.nbfc-input-addon:hover {
    background: #F3F4F6;
    color: #4F46E5;
}

.nbfc-input-group:focus-within .nbfc-input-addon {
    border-color: #4F46E5;
}

/* Validation message */
.nbfc-validation {
    display: block;
    font-size: 0.78rem;
    color: #EF4444;
    margin-top: 0.3rem;
    min-height: 1em;
}

/* Remember + Forgot row */
.nbfc-field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
    gap: 0.5rem;
}

.nbfc-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.nbfc-checkbox {
    width: 16px;
    height: 16px;
    accent-color: #4F46E5;
    cursor: pointer;
    flex-shrink: 0;
}

.nbfc-link {
    font-size: 0.875rem;
    color: #4F46E5;
    text-decoration: none;
    font-weight: 500;
}

.nbfc-link:hover {
    color: #4338CA;
    text-decoration: underline;
}

/* Primary submit button */
.nbfc-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 48px;
    background: #4F46E5;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 150ms ease, box-shadow 150ms ease, transform 80ms ease;
    letter-spacing: 0.01em;
    font-family: inherit;
}

.nbfc-btn-primary:hover {
    background: #4338CA;
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.32);
}

.nbfc-btn-primary:active {
    transform: translateY(1px);
    background: #3730A3;
}

.nbfc-btn-primary[disabled],
.nbfc-btn-primary.disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Or-divider for external providers */
.nbfc-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #9CA3AF;
    font-size: 0.8125rem;
    margin: 1.75rem 0;
}

.nbfc-divider::before,
.nbfc-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E5E7EB;
}

/* External provider buttons */
.nbfc-external-providers {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1.5rem;
}

.nbfc-btn-ext {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 44px;
    background: #FFFFFF;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: border-color 150ms ease, background 150ms ease;
    font-family: inherit;
}

.nbfc-btn-ext:hover {
    background: #F9FAFB;
    border-color: #4F46E5;
}

.nbfc-ext-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* Footer — register link */
.nbfc-form-footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: #6B7280;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding-top: 1.5rem;
    border-top: 1px solid #F3F4F6;
}

.nbfc-link-strong {
    font-weight: 600;
}

/* ─── Responsive ─────────────────────────────────────────── */

/* Tablet: tighten side padding */
@media (max-width: 1100px) {
    .nbfc-brand-panel {
        padding: 2.5rem 2rem;
    }
    .nbfc-form-panel {
        padding: 3rem 2rem;
    }
}

/* Mobile: single column — hide branding, full-width form */
@media (max-width: 768px) {
    .nbfc-login-page {
        grid-template-columns: 1fr;
    }

    .nbfc-brand-panel {
        display: none;
    }

    .nbfc-form-panel {
        padding: 2rem 1.5rem;
        justify-content: flex-start;
        padding-top: 4.5rem;
    }

    .nbfc-form-card {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .nbfc-form-panel {
        padding: 1.5rem 1.25rem;
        padding-top: 4rem;
    }

    .nbfc-form-title {
        font-size: 1.625rem;
    }
}
