/*
 * banking-ui.css — v2.0
 * Additive stylesheet loaded after the theme CSS (front + admin).
 *  1. Design tokens taken from the existing brand (purple #6c3beb, green #81ef71, ink #030306)
 *  2. "bk-*" components used by transfer / recharge / OTP / admin settings pages
 *  3. Low-risk global improvements: focus visibility, touch targets, mobile forms & tables,
 *     status colours, reduced motion. Existing class names are only refined, never removed.
 */

:root {
    --bk-primary: #6c3beb;
    --bk-primary-hover: #4a1fbb;
    --bk-primary-soft: #efe9fe;
    --bk-accent: #81ef71;
    --bk-ink: #030306;
    --bk-text: #1f2430;
    --bk-muted: #5b6170;          /* 6.1:1 on white (WCAG AA) */
    --bk-border: #dcdfe6;
    --bk-surface: #ffffff;
    --bk-surface-2: #f7f7fb;
    --bk-success: #0f7b45;
    --bk-success-bg: #e6f6ee;
    --bk-warning: #8a5300;
    --bk-warning-bg: #fff4e0;
    --bk-danger: #b42318;
    --bk-danger-bg: #fdecec;
    --bk-info: #1d5fa8;
    --bk-info-bg: #e8f1fb;
    --bk-radius: 10px;
    --bk-radius-sm: 6px;
    --bk-focus: 0 0 0 3px rgba(108, 59, 235, .35);
    --bk-font: inherit;
}

.dark-theme {
    --bk-text: #eef0f4;
    --bk-muted: #a9b0bd;
    --bk-border: #2f3a36;
    --bk-surface: #172622;
    --bk-surface-2: #121d1a;
    --bk-primary-soft: #2a2340;
    --bk-success-bg: #12352a;
    --bk-success: #7fe0ad;
    --bk-warning-bg: #3b2d10;
    --bk-warning: #ffcf7a;
    --bk-danger-bg: #3d1717;
    --bk-danger: #ff9d94;
    --bk-info-bg: #13263d;
    --bk-info: #9cc7f5;
}

/* ------------------------------------------------------------------ 3. Global refinements */

/* Visible keyboard focus everywhere (mouse users are unaffected thanks to :focus-visible) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
.site-btn:focus-visible,
.site-btn-sm:focus-visible {
    outline: 2px solid var(--bk-primary) !important;
    outline-offset: 2px;
    box-shadow: var(--bk-focus);
}

/* Disabled buttons look disabled */
button:disabled,
.site-btn[disabled],
.site-btn-sm[disabled],
.bk-btn:disabled {
    opacity: .55;
    cursor: not-allowed;
}

/* Readable form controls; 16px on phones prevents iOS auto-zoom */
.box-input,
.form-control,
.box-textarea {
    min-height: 44px;
}
@media (max-width: 767.98px) {
    .box-input, .form-control, .box-textarea, select, .bk-input { font-size: 16px !important; }
    .site-card .site-card-header { flex-wrap: wrap; gap: 8px; }
    .site-card .site-card-header .title { font-size: 17px; }
    .site-btn, .site-btn-sm { min-height: 44px; }
}

/* Tables never break the layout on small screens */
.site-table, .site-custom-table, .table-responsive { -webkit-overflow-scrolling: touch; }
.site-table table, .site-custom-table { max-width: 100%; }

/* Input helper text: more readable than the theme default */
.input-info-text { color: var(--bk-muted); font-size: 13px; margin-top: 4px; }

/* Fund transfer review box */
.site-custom-table-sm .site-table-list { align-items: center; }
.site-custom-table-sm .fee-desc { font-weight: 400; }

/* Success / pending result block */
.main-user-dahboard .page-content .main-content .page-gap .transaction-success-block { padding: 40px 16px; }
.transaction-success-block.pending .icon { background: #b7791f !important; }
.transaction-success-block .bk-summary { max-width: 420px; margin: 16px auto; text-align: left; }

/* Status badges: AA contrast */
.site-badge.badge-success { color: var(--bk-success); background: var(--bk-success-bg); }
.site-badge.badge-failed { color: var(--bk-danger); background: var(--bk-danger-bg); }
.site-badge.badge-pending { color: var(--bk-warning); background: var(--bk-warning-bg); }

/* Notification toasts above everything, readable on mobile */
.notify-container, .simple-notify { z-index: 10000 !important; }
@media (max-width: 575.98px) {
    .simple-notify { left: 8px !important; right: 8px !important; width: auto !important; max-width: none !important; }
}

/* User dashboard side menu: comfortable tap targets */
.user-sidebar .user-nav ul li a { min-height: 44px; display: flex; align-items: center; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

.visually-hidden {
    position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
    overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ------------------------------------------------------------------ 2. Components */

.bk-card .site-card-body { padding: 20px; }
@media (max-width: 575.98px) { .bk-card .site-card-body { padding: 14px; } }

.bk-muted { color: var(--bk-muted); }
.bk-section-title { font-size: 17px; font-weight: 700; margin: 20px 0 10px; color: var(--bk-text); }
.bk-label { display: block; font-weight: 600; font-size: 14px; margin: 10px 0 6px; color: var(--bk-text); }
.bk-input {
    display: block; width: 100%; min-height: 44px; padding: 10px 12px;
    border: 1px solid var(--bk-border); border-radius: var(--bk-radius-sm);
    background: var(--bk-surface); color: var(--bk-text); font-size: 15px; line-height: 1.4;
    transition: border-color .15s, box-shadow .15s;
}
.bk-input:focus { border-color: var(--bk-primary); box-shadow: var(--bk-focus); outline: none; }
.bk-input-sm { min-height: 36px; padding: 6px 10px; font-size: 14px; width: auto; }
textarea.bk-input { resize: vertical; }
.bk-input.is-dirty { border-color: var(--bk-primary); background: var(--bk-primary-soft); }
.bk-input-group { display: flex; gap: 8px; align-items: stretch; }
.bk-input-group .bk-input { flex: 1 1 auto; }
.bk-otp-inline .input-group { gap: 8px; }
.bk-otp-input { font-size: 28px !important; letter-spacing: 10px; text-align: center; font-variant-numeric: tabular-nums; }

.bk-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-height: 44px; padding: 10px 20px; border-radius: 100px; border: 1px solid transparent;
    font-weight: 700; font-size: 14px; line-height: 1.2; cursor: pointer; text-decoration: none;
    transition: background-color .15s, color .15s, border-color .15s;
}
.bk-btn-sm { min-height: 34px; padding: 6px 12px; font-size: 13px; }
.bk-btn-block { width: 100%; }
.bk-btn-primary { background: var(--bk-primary); color: #fff; }
.bk-btn-primary:hover { background: var(--bk-primary-hover); color: #fff; }
.bk-btn-secondary { background: var(--bk-surface); color: var(--bk-primary); border-color: var(--bk-primary); }
.bk-btn-secondary:hover { background: var(--bk-primary-soft); color: var(--bk-primary-hover); }
.bk-btn-danger { background: var(--bk-danger-bg); color: var(--bk-danger); border-color: var(--bk-danger); }
.bk-btn-danger:hover { background: var(--bk-danger); color: #fff; }
.bk-btn-link { background: transparent; color: var(--bk-primary); padding-left: 6px; padding-right: 6px; text-decoration: underline; }
.bk-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 20px; }
.bk-nowrap { display: flex; flex-wrap: wrap; gap: 6px; min-width: 150px; }
.bk-nowrap form { margin: 0; }
@media (max-width: 575.98px) { .bk-actions .bk-btn-primary { width: 100%; } }

.bk-alert { border-radius: var(--bk-radius-sm); padding: 12px 14px; margin: 0 0 14px; border-left: 4px solid; font-size: 14px; }
.bk-alert ul { padding-left: 18px; }
.bk-alert-success { background: var(--bk-success-bg); color: var(--bk-success); border-color: var(--bk-success); }
.bk-alert-error { background: var(--bk-danger-bg); color: var(--bk-danger); border-color: var(--bk-danger); }
.bk-alert-warning { background: var(--bk-warning-bg); color: var(--bk-warning); border-color: var(--bk-warning); }
.bk-alert-info { background: var(--bk-info-bg); color: var(--bk-info); border-color: var(--bk-info); }

.bk-status { display: inline-block; padding: 3px 10px; border-radius: 100px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.bk-status-success { background: var(--bk-success-bg); color: var(--bk-success); }
.bk-status-failed, .bk-status-reversed { background: var(--bk-danger-bg); color: var(--bk-danger); }
.bk-status-pending, .bk-status-submitted, .bk-status-reserved { background: var(--bk-warning-bg); color: var(--bk-warning); }
.bk-status-unknown { background: var(--bk-info-bg); color: var(--bk-info); }
.bk-badge { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--bk-primary-soft); color: var(--bk-primary); font-size: 11px; font-weight: 700; }

.bk-summary { margin: 12px 0; border: 1px solid var(--bk-border); border-radius: var(--bk-radius-sm); overflow: hidden; }
.bk-summary > div { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; border-bottom: 1px solid var(--bk-border); }
.bk-summary > div:last-child { border-bottom: 0; }
.bk-summary dt { font-weight: 500; color: var(--bk-muted); margin: 0; }
.bk-summary dd { margin: 0; font-weight: 700; color: var(--bk-text); text-align: right; word-break: break-word; }
.bk-summary .bk-summary-total { background: var(--bk-surface-2); }
.bk-summary .bk-summary-total dd { font-size: 17px; }

.bk-steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; counter-reset: s; }
.bk-step { flex: 1; text-align: center; font-size: 13px; padding: 8px 4px; border-radius: 100px; background: var(--bk-surface-2); color: var(--bk-muted); counter-increment: s; }
.bk-step::before { content: counter(s) ". "; }
.bk-step.is-active { background: var(--bk-primary-soft); color: var(--bk-primary); font-weight: 700; }

.bk-product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.bk-product { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--bk-border); border-radius: var(--bk-radius-sm); cursor: pointer; background: var(--bk-surface); }
.bk-product input { position: absolute; opacity: 0; }
.bk-product:has(input:checked) { border-color: var(--bk-primary); box-shadow: var(--bk-focus); background: var(--bk-primary-soft); }
.bk-product:has(input:focus-visible) { outline: 2px solid var(--bk-primary); outline-offset: 2px; }
.bk-product-amount { font-weight: 700; color: var(--bk-text); }
.bk-product-name { font-size: 12px; color: var(--bk-muted); }

.bk-list-row { display: flex; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bk-border); color: var(--bk-text); text-decoration: none; }
.bk-list-row:last-child { border-bottom: 0; }
.bk-list-row:hover { color: var(--bk-primary); }

.bk-result .bk-result-icon { width: 72px; height: 72px; margin: 0 auto 12px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: var(--bk-warning-bg); color: var(--bk-warning); }
.bk-result-success .bk-result-icon { background: var(--bk-success-bg); color: var(--bk-success); }
.bk-result-failed .bk-result-icon, .bk-result-reversed .bk-result-icon { background: var(--bk-danger-bg); color: var(--bk-danger); }
.bk-result .bk-result-icon svg { width: 36px; height: 36px; }
.bk-result-title { font-size: 22px; margin-bottom: 6px; }

/* Tables: horizontal scroll on tablets, stacked cards on phones */
.bk-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.bk-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--bk-text); }
.bk-table th { text-align: left; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; color: var(--bk-muted); padding: 10px; border-bottom: 2px solid var(--bk-border); white-space: nowrap; }
.bk-table td, .bk-table tbody th { padding: 10px; border-bottom: 1px solid var(--bk-border); vertical-align: top; }
.bk-table tbody tr:hover { background: var(--bk-surface-2); }
.bk-table-compact td, .bk-table-compact th { padding: 6px 8px; }
.bk-row-muted { opacity: .6; }
.bk-break { word-break: break-all; }
@media (max-width: 767.98px) {
    .bk-table thead { display: none; }
    .bk-table, .bk-table tbody, .bk-table tr, .bk-table td, .bk-table tbody th { display: block; width: 100%; }
    .bk-table tr { border: 1px solid var(--bk-border); border-radius: var(--bk-radius-sm); margin-bottom: 10px; padding: 6px 0; }
    .bk-table td, .bk-table tbody th { border: 0; padding: 6px 12px; text-align: left !important; }
    .bk-table td[data-label]::before { content: attr(data-label); display: block; font-size: 11px; text-transform: uppercase; color: var(--bk-muted); font-weight: 700; }
}

.bk-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.bk-filter .bk-input { width: auto; flex: 1 1 180px; }

.bk-field { margin-bottom: 14px; }
.bk-switch { display: inline-flex; gap: 10px; align-items: center; font-weight: 600; cursor: pointer; }
.bk-switch input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--bk-primary); }
.bk-check { display: inline-flex; gap: 6px; align-items: center; font-size: 13px; margin-top: 6px; }
.bk-check input { accent-color: var(--bk-primary); }

.bk-tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.bk-tab { padding: 8px 16px; border-radius: 100px; background: var(--bk-surface-2); color: var(--bk-text); text-decoration: none; font-weight: 600; font-size: 14px; }
.bk-tab.is-active { background: var(--bk-primary); color: #fff; }

.bk-text-list { display: flex; flex-direction: column; }
.bk-text-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--bk-border); }
.bk-text-row.is-edited { border-left: 3px solid var(--bk-primary); padding-left: 10px; }
.bk-text-source { font-weight: 600; word-break: break-word; }
.bk-text-where { margin-top: 4px; color: var(--bk-muted); }
@media (max-width: 991.98px) { .bk-text-row { grid-template-columns: 1fr; gap: 8px; } }
.bk-sticky-bottom { position: sticky; bottom: 0; background: var(--bk-surface); padding: 12px 0; border-top: 1px solid var(--bk-border); z-index: 5; }
.bk-sticky { position: sticky; top: 90px; }
@media (max-width: 1199.98px) { .bk-sticky { position: static; } }

.bk-preview { margin-top: 16px; padding: 12px; border-radius: var(--bk-radius-sm); background: var(--bk-surface-2); }

.bk-checklist { list-style: none; padding: 0; margin: 0; }
.bk-checklist li { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--bk-border); }
.bk-check-icon { flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.bk-checklist .is-ok .bk-check-icon { background: var(--bk-success-bg); color: var(--bk-success); }
.bk-checklist .is-bad .bk-check-icon { background: var(--bk-danger-bg); color: var(--bk-danger); }
.bk-prose ol { padding-left: 18px; }
.bk-prose li { margin-bottom: 8px; }

/* Admin: settings tabs scroll instead of wrapping awkwardly */
.bk-admin .site-tab-bars ul { flex-wrap: nowrap; overflow-x: auto; }
.bk-admin .site-tab-bars ul li { flex: 0 0 auto; }

/* Stand-alone auth page (email OTP) */
.bk-auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #f4f1fe, #eefbea); padding: 16px; font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--bk-text); }
.bk-auth-card { width: 100%; max-width: 420px; background: #fff; border-radius: 16px; padding: 32px 28px; box-shadow: 0 10px 40px rgba(3, 3, 6, .08); }
.bk-auth-logo { max-height: 44px; max-width: 180px; display: block; margin: 0 auto 18px; }
.bk-auth-title { font-size: 22px; font-weight: 700; text-align: center; margin-bottom: 8px; }
.bk-auth-card .bk-btn-primary { margin-top: 16px; }
.bk-auth-secondary { text-align: center; margin-top: 8px; }
