/* ------------------------------------------------------------------------
 * BioFin app-level custom styles.
 *
 * Rule of thumb: if the Limitless theme (assets/css/ltr/all.min.css)
 * provides a utility or component for it, use that in the view instead.
 * Only styles the theme genuinely cannot express live here — and nothing
 * page-specific should be pushed inline from Blade views.
 * ------------------------------------------------------------------------ */

/* --- Forms ---------------------------------------------------------------- */

/* Red asterisk on required field labels */
.form-label.required:after {
    content: " *";
    color: red;
}

/* Locked (JS-disabled) form fields, e.g. NID-verified customer data in the
   Bioverify wizard */
.form-control.bg-light {
    background-color: #f8f9fa !important;
    border-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
}

.form-control.bg-light:focus {
    background-color: #f8f9fa !important;
    border-color: #e9ecef !important;
    box-shadow: none !important;
}

/* --- Tables / scrollbars --------------------------------------------------- */

.table-responsive {
    min-height: 300px;
}

/* Horizontal scrollbar styling for wide tables */
.custom-scrollbar {
    overflow-x: auto;
    overflow-y: hidden;
}

.custom-scrollbar::-webkit-scrollbar {
    height: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background-color: #888;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background-color: #f1f1f1;
}

/* Vertical variant used by scrollable table bodies */
.custom-scrollbar-y {
    overflow-y: auto;
}

.custom-scrollbar-y::-webkit-scrollbar {
    width: 8px;
}

.custom-scrollbar-y::-webkit-scrollbar-thumb {
    background-color: #888;
    border-radius: 4px;
}

.custom-scrollbar-y::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

.custom-scrollbar-y::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 4px;
}

/* --- Reference codes -------------------------------------------------------
 * BV-XXXXXX application references and short IDs, shown identically across
 * Bioverify, NidVerify and Billing pages. */
.ref-code {
    font-family: var(--font-monospace, monospace);
    letter-spacing: 1.5px;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    background-color: #f8f9fa;
    padding: 0.125rem 0.5rem;
    user-select: all;
}

/* Hero variant (draft-saved modal) */
.ref-code-lg {
    font-size: 1.6rem;
    letter-spacing: 3px;
    font-weight: 600;
    padding: 0.5rem 1rem;
}

/* --- Dashboard -------------------------------------------------------------
 * Brand welcome banner (charcoal + BioFin green strip) and KPI tile pieces the
 * theme has no equivalent for. */
.card-lift {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.35rem 0.75rem rgba(0, 0, 0, 0.08);
}

.dash-welcome {
    /* Deep charcoal, kept dark across the whole width so white text stays
       readable end to end */
    background: linear-gradient(90deg, #232427, #3a3b3e);
    border: none;
    overflow: hidden;
}

/* Header buttons: the theme's light/outline-light variants assume a light
   page background — pin readable colors for the dark banner explicitly */
.dash-welcome .btn-outline-light {
    border-color: rgba(255, 255, 255, 0.7);
    color: #fff;
}

.dash-welcome .btn-outline-light:hover,
.dash-welcome .btn-outline-light:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

.dash-welcome .btn-light {
    background-color: #fff;
    border-color: #fff;
    color: #2f3032;
}

.dash-welcome .btn-light:hover,
.dash-welcome .btn-light:focus {
    background-color: #f1f1f1;
    color: #1d1e20;
}

.dash-welcome-strip {
    height: 3px;
    background: linear-gradient(90deg, #4e8a2a, #71a333);
}

.dash-kpi-value {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1.1;
}

.dash-kpi-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dash-kpi-icon i {
    font-size: 1.4rem;
}

.dash-module-icon {
    font-size: 2.4rem;
    opacity: 0.35;
}

/* Module cards: theme border-top-{color} gives the color; this gives weight */
.border-top-3 {
    border-top-width: 3px !important;
    border-top-style: solid;
}

/* --- Bioverify wizard: captured fingerprint thumbnails ---------------------- */
.finger-image-container {
    text-align: center;
    margin-bottom: 10px;
}

.finger-image {
    max-width: 80px;
    max-height: 100px;
    border: 1px solid #ddd;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.finger-label {
    font-size: 12px;
    margin-top: 5px;
    color: #555;
}

/* --- Login page ------------------------------------------------------------ */
.login-card {
    background-color: #252b36;
}

.login-card .form-label {
    color: #fff;
}

@media (min-width: 576px) {
    .login-card {
        border-radius: 5%;
    }
}

@media (min-width: 768px) {
    .login-card {
        border-radius: 20% 5% 5% 20%;
    }
}

.login-logo {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    object-fit: contain;
    padding: 6px;
}

/* --- Sign-in page (split layout) -------------------------------------------
 * Used only by resources/views/auth/login.blade.php through
 * components/auth-split-layout. Everything is namespaced .bf-auth / .bf-* and
 * uses explicit brand colours so it looks the same in the light and dark
 * theme modes. The other auth pages still use the .login-card rules above.
 * ------------------------------------------------------------------------ */
html body.bf-auth {
    --bf-green: #4f8a2b;
    --bf-green-dark: #3f7222;
    --bf-green-darker: #35611c;
    --bf-green-soft: rgba(79, 138, 43, .28);
    --bf-ink: #1f2937;
    --bf-muted: #5b6575;
    --bf-border: #cdd5df;
    --bf-danger: #b42318;
    margin: 0;
    background: #f4f6f8;
    color: var(--bf-ink);
}

.bf-auth-shell {
    display: flex;
    min-height: 100vh;
    min-height: 100dvh;
}

/* Brand panel (large screens only) */
.bf-auth-brand {
    display: none;
    position: relative;
    overflow: hidden;
    flex: 0 0 46%;
    max-width: 720px;
    color: #fff;
    background:
        radial-gradient(900px 600px at 10% 112%, rgba(79, 138, 43, .38), transparent 60%),
        radial-gradient(600px 420px at 100% 0%, rgba(79, 138, 43, .16), transparent 55%),
        linear-gradient(160deg, #1b212c 0%, #252b36 100%);
}

/* Soft fingerprint-style rings in the corner */
.bf-auth-brand::before {
    content: "";
    position: absolute;
    inset: 0;
    background: repeating-radial-gradient(circle at 88% 96%, transparent 0 20px, rgba(255, 255, 255, .06) 20px 22px);
    -webkit-mask-image: radial-gradient(circle at 88% 96%, #000 0, transparent 62%);
    mask-image: radial-gradient(circle at 88% 96%, #000 0, transparent 62%);
    pointer-events: none;
}

@media (min-width: 992px) {
    .bf-auth-brand {
        display: flex;
    }
}

.bf-auth-brand-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    padding: 56px 64px;
}

.bf-auth-brand-logo {
    display: block;
    height: 44px;
    width: auto;
    align-self: flex-start;
}

.bf-auth-headline {
    margin: 0 0 14px;
    color: #fff;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -.02em;
}

.bf-auth-lede {
    margin: 0;
    max-width: 30rem;
    color: rgba(255, 255, 255, .74);
    font-size: 1.0625rem;
    line-height: 1.55;
}

.bf-auth-points {
    margin: 32px 0 0;
    padding: 0;
    list-style: none;
}

.bf-auth-points li {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    color: rgba(255, 255, 255, .9);
    font-size: .9375rem;
}

.bf-auth-points i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, .08);
    color: #9ad06a;
    font-size: 1.25rem;
}

.bf-auth-brand-foot {
    color: rgba(255, 255, 255, .55);
    font-size: .8125rem;
}

/* Form panel */
.bf-auth-panel {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.bf-auth-panel-inner {
    display: flex;
    flex: 1 0 auto;
    align-items: center;
    justify-content: center;
    padding: 32px 16px 16px;
}

.bf-auth-form {
    width: 100%;
    max-width: 440px;
    padding: 40px;
    border: 1px solid #e4e8ee;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px -8px rgba(16, 24, 40, .1);
}

.bf-auth-form-logo {
    display: block;
    height: 36px;
    width: auto;
    margin: 0 0 28px;
}

@media (min-width: 992px) {
    .bf-auth-form-logo {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .bf-auth-panel-inner {
        padding: 20px 12px 12px;
    }

    .bf-auth-form {
        padding: 28px 20px;
    }
}

.bf-auth-header {
    margin-bottom: 24px;
}

.bf-auth-title {
    margin: 0;
    color: var(--bf-ink);
    font-size: 1.625rem;
    font-weight: 700;
    letter-spacing: -.01em;
}

.bf-auth-subtitle {
    margin: 6px 0 0;
    color: var(--bf-muted);
    font-size: .9375rem;
}

.bf-auth-panel-foot {
    padding: 8px 16px 20px;
    text-align: center;
    font-size: .8125rem;
}

.bf-auth-panel-foot a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--bf-muted);
    text-decoration: none;
}

.bf-auth-panel-foot a:hover {
    color: var(--bf-green-dark);
    text-decoration: underline;
}

/* Fields */
.bf-field {
    margin-bottom: 18px;
}

.bf-label {
    display: block;
    margin-bottom: 6px;
    color: var(--bf-ink);
    font-size: .875rem;
    font-weight: 600;
}

.bf-input-wrap {
    position: relative;
}

.bf-input-icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #7a8494;
    font-size: 1.25rem;
    pointer-events: none;
}

.bf-input {
    display: block;
    width: 100%;
    height: 46px;
    padding: 0 14px 0 44px;
    border: 1px solid var(--bf-border);
    border-radius: 10px;
    background: #fff;
    color: var(--bf-ink);
    font-size: .9375rem;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.bf-input.bf-input-has-toggle {
    padding-right: 48px;
}

.bf-input::placeholder {
    color: #7b8595;
}

.bf-input:hover {
    border-color: #aeb8c6;
}

.bf-input:focus {
    outline: 0;
    border-color: var(--bf-green);
    box-shadow: 0 0 0 3px var(--bf-green-soft);
}

.bf-input.is-invalid {
    border-color: var(--bf-danger);
}

.bf-input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(180, 35, 24, .2);
}

.bf-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    transform: translateY(-50%);
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--bf-muted);
    font-size: 1.25rem;
    cursor: pointer;
}

.bf-toggle:hover {
    background: #eef1f5;
    color: var(--bf-ink);
}

.bf-toggle:focus-visible {
    outline: 2px solid var(--bf-green);
    outline-offset: 1px;
}

.bf-field-error {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin: 6px 0 0;
    color: var(--bf-danger);
    font-size: .8125rem;
    font-weight: 500;
}

.bf-field-error i {
    margin-top: 1px;
    font-size: 1rem;
}

/* Inline alerts (flash messages) */
.bf-alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    padding: 12px 14px;
    border: 1px solid transparent;
    border-radius: 10px;
    font-size: .875rem;
    line-height: 1.45;
}

.bf-alert i {
    margin-top: 1px;
    font-size: 1.125rem;
}

.bf-alert-danger {
    background: #fef3f2;
    border-color: #fecdca;
    color: #912018;
}

.bf-alert-warning {
    background: #fffaeb;
    border-color: #fedf89;
    color: #93370d;
}

.bf-alert-success {
    background: #ecfdf3;
    border-color: #abefc6;
    color: #067647;
}

.bf-alert-info {
    background: #eff8ff;
    border-color: #b2ddff;
    color: #175cd3;
}

/* Remember me / forgot password row */
.bf-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin: 4px 0 22px;
}

.bf-remember {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    min-height: 0;
}

.bf-remember .form-check-input {
    float: none;
    margin: 0;
    width: 1.125rem;
    height: 1.125rem;
    border-color: var(--bf-border);
    cursor: pointer;
}

.bf-remember .form-check-input:checked {
    background-color: var(--bf-green-dark);
    border-color: var(--bf-green-dark);
}

.bf-remember .form-check-input:focus {
    border-color: var(--bf-green);
    box-shadow: 0 0 0 3px var(--bf-green-soft);
}

.bf-remember .form-check-label {
    margin: 0;
    color: var(--bf-ink);
    font-size: .875rem;
    cursor: pointer;
}

.bf-link {
    color: var(--bf-green-dark);
    font-size: .875rem;
    font-weight: 600;
    text-decoration: none;
}

.bf-link:hover {
    color: var(--bf-green-darker);
    text-decoration: underline;
}

.bf-link:focus-visible {
    outline: 2px solid var(--bf-green);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Submit button */
.bf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 48px;
    border: 0;
    border-radius: 10px;
    background: var(--bf-green-dark);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .12);
    cursor: pointer;
    transition: background-color .15s ease, box-shadow .15s ease;
}

.bf-btn:hover {
    background: var(--bf-green-darker);
}

.bf-btn:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px var(--bf-green-soft), 0 1px 2px rgba(16, 24, 40, .12);
}

.bf-btn:disabled {
    opacity: .8;
    cursor: progress;
}

@media (prefers-reduced-motion: reduce) {
    .bf-input,
    .bf-btn {
        transition: none;
    }
}

/* --- E-KYC: pick extracted fingerprints to verify ---------------------------- */
.bf-finger-tile {
    background-color: var(--bs-body-bg, #fff);
    transition: border-color .15s ease, background-color .15s ease;
}

.bf-finger-tile.is-selected {
    border-color: var(--bs-primary, #0d6efd) !important;
    background-color: rgba(13, 110, 253, .04);
}

.bf-finger-tile:not(.is-selected) .fp-thumb {
    opacity: .5;
}
