/* =====================================================================
   KYC Karo theme
   Colours are taken from the brand logo:
     - brand blue   #0558C3 (shield + "KYC")
     - brand orange #FE7903 (tick arrow + "KARO")
   ===================================================================== */
:root {
  /* Typography — change fonts in one place.
     Headings: Plus Jakarta Sans (modern, trustworthy fintech look)
     Body/UI:  DM Sans (highly readable at small sizes in forms and tables)
     Code:     JetBrains Mono (API keys, secrets, code snippets) */
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  /* Make Bootstrap components use the same fonts */
  --bs-body-font-family: var(--font-body);
  --bs-font-sans-serif: var(--font-body);
  --bs-font-monospace: var(--font-mono);
  /* Dark surfaces are deep blues derived from the brand blue */
  --navy: #061A3A;
  --navy2: #0A2550;
  --navy3: #113168;
  --blue: #0558C3;
  --blue-dark: #04479F;
  --blue-pale: #E8F0FB;
  --orange: #FE7903;
  --orange-dark: #E06A00;
  --orange-pale: #FFF1E5;
  /* Kept for backwards compatibility: old "teal" accent now maps to orange */
  --teal: var(--orange);
  --border: #E1E8F2;
  --text: #0B1A33;
  --text2: #4A5568;
  --text3: #8898AA;
  --radius: 14px;
  --sidebar-w: 250px;

  /* Bootstrap 5.3 global overrides so every component follows the brand */
  --bs-primary: #0558C3;
  --bs-primary-rgb: 5, 88, 195;
  --bs-primary-text-emphasis: #04479F;
  --bs-primary-bg-subtle: #E8F0FB;
  --bs-primary-border-subtle: #A9C5EC;
  --bs-info: #FE7903;
  --bs-info-rgb: 254, 121, 3;
  --bs-link-color: #0558C3;
  --bs-link-color-rgb: 5, 88, 195;
  --bs-link-hover-color: #04479F;
  --bs-link-hover-color-rgb: 4, 71, 159;
  --bs-focus-ring-color: rgba(5, 88, 195, .25);
}

body {
  font-family: var(--font-body);
  background: #F2F6FC;
  color: var(--text);
  min-height: 100vh;
}

h1, h2, h3, h4, h5, .brand, .page-title { font-family: var(--font-heading); }

a { color: var(--blue); }
a:hover { color: var(--blue-dark); }

/* ---------- buttons (brand blue primary, orange accent) ---------- */
.btn-primary {
  --bs-btn-bg: var(--blue); --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: var(--blue-dark); --bs-btn-hover-border-color: var(--blue-dark);
  --bs-btn-active-bg: var(--blue-dark); --bs-btn-active-border-color: var(--blue-dark);
  --bs-btn-disabled-bg: var(--blue); --bs-btn-disabled-border-color: var(--blue);
  --bs-btn-focus-shadow-rgb: 5, 88, 195;
}
.btn-outline-primary {
  --bs-btn-color: var(--blue); --bs-btn-border-color: var(--blue);
  --bs-btn-hover-bg: var(--blue); --bs-btn-hover-border-color: var(--blue);
  --bs-btn-active-bg: var(--blue-dark); --bs-btn-active-border-color: var(--blue-dark);
  --bs-btn-focus-shadow-rgb: 5, 88, 195;
}
.btn-accent, .btn-info {
  --bs-btn-color: #fff; --bs-btn-bg: var(--orange); --bs-btn-border-color: var(--orange);
  --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--orange-dark); --bs-btn-hover-border-color: var(--orange-dark);
  --bs-btn-active-color: #fff; --bs-btn-active-bg: var(--orange-dark); --bs-btn-active-border-color: var(--orange-dark);
  --bs-btn-focus-shadow-rgb: 254, 121, 3;
}
.text-primary { color: var(--blue) !important; }
.bg-primary, .text-bg-primary { background-color: var(--blue) !important; }
.text-accent, .text-info { color: var(--orange) !important; }
.bg-accent { background-color: var(--orange) !important; }
.text-bg-info, .text-bg-accent { background-color: var(--orange) !important; color: #fff !important; }

/* Form controls: brand focus ring and checked state */
.form-control:focus, .form-select:focus {
  border-color: #6A9BDC;
  box-shadow: 0 0 0 .2rem rgba(5, 88, 195, .18);
}
.form-check-input:checked { background-color: var(--blue); border-color: var(--blue); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(5, 88, 195, .18); }
.nav-pills .nav-link.active, .nav-pills .show > .nav-link { background-color: var(--blue); }
.nav-tabs .nav-link.active { color: var(--blue); border-bottom-color: #fff; }
.page-link { color: var(--blue); }
.active > .page-link, .page-link.active { background-color: var(--blue); border-color: var(--blue); }
.progress-bar { background-color: var(--blue); }
.dropdown-item:active { background-color: var(--blue); }

/* ---------- brand logo ---------- */
.brand { display: inline-flex; align-items: center; align-self: flex-start; text-decoration: none; line-height: 0; }
.brand-logo { height: 34px; width: auto; display: block; }
.brand-sm .brand-logo { height: 26px; }
.brand-lg .brand-logo { height: 44px; }
/* White chip keeps the blue/orange logo readable on dark backgrounds */
.brand-chip { background: #fff; padding: .45rem .8rem; border-radius: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.brand-plain { padding: 0; }

/* ---------- panel layout ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar-w);
  background: var(--navy); color: #c9d4e5; padding: 1.25rem .9rem;
  overflow-y: auto; z-index: 1030;
  transition: transform .2s;
}
.sidebar .nav-section { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #7F97BF; margin: 1.3rem .6rem .4rem; }
.sidebar .nav-link { color: #c9d4e5; border-radius: 9px; padding: .55rem .75rem; display: flex; gap: .65rem; align-items: center; font-size: .9rem; }
.sidebar .nav-link:hover { background: var(--navy3); color: #fff; }
.sidebar .nav-link.active { background: var(--blue); color: #fff; box-shadow: inset 3px 0 0 var(--orange); }
.sidebar .nav-link.active i { color: #FFB574; }
.sidebar .nav-link .badge { margin-left: auto; }

.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar { background: #fff; border-bottom: 1px solid var(--border); height: 62px; padding: 0 1.5rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 1020; }
.content { padding: 1.75rem 1.5rem 3rem; max-width: 1400px; }

@media (max-width: 991.98px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.show { transform: none; }
  .main { margin-left: 0; }
}

.page-title { font-size: 1.45rem; font-weight: 700; margin: 0; }
.page-sub { color: var(--text2); font-size: .9rem; }

/* ---------- cards ---------- */
.card { border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(6, 26, 58, .05); }
.card-header { background: #fff; border-bottom: 1px solid var(--border); font-weight: 600; border-radius: var(--radius) var(--radius) 0 0 !important; }
.stat-card .label { color: var(--text3); font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; }
.stat-card .value { font-family: var(--font-heading); font-size: 1.6rem; font-weight: 700; }

.table { font-size: .88rem; }
.table thead th { color: var(--text3); font-weight: 600; font-size: .74rem; text-transform: uppercase; letter-spacing: .04em; background: #F4F7FC; }
.mono, code { font-family: var(--font-mono); font-size: .82rem; }
code { color: #c0306e; }

.secret-box { background: var(--navy); color: #FFB574; padding: .9rem 1rem; border-radius: 10px; word-break: break-all; font-family: var(--font-mono); }

/* ---------- auth + hosted pages ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(circle at 20% 20%, var(--navy3), var(--navy) 60%); color: #c9d4e5; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.auth-side h2 { color: #fff; font-weight: 800; font-size: 2.1rem; line-height: 1.2; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 2rem; }
.auth-card { width: 100%; max-width: 440px; }
@media (max-width: 991.98px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

.hosted-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 2rem 1rem; }
.hosted-card { max-width: 480px; width: 100%; }
.dl-btn { background: #5a2d91; border: none; color: #fff; font-weight: 600; padding: .85rem 1rem; border-radius: 10px; }
.dl-btn:hover { background: #4a2479; color: #fff; }

.timeline-item { border-left: 2px solid var(--border); padding: 0 0 1rem 1rem; position: relative; }
.timeline-item::before { content: ''; position: absolute; left: -6px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); }

/* Thin brand stripe at the top of the topbar */
.topbar { box-shadow: inset 0 3px 0 var(--blue); }
.stat-card .value { color: var(--navy); }
