/* BiiTrust Member — the client portal (member.biitrust.com).
   Theme variables only (static/css/theme.css); light and dark both come from there. */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100dvh;
  background: var(--background);
  color: var(--text-color);
  font-family: var(--font-main), system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-color); }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ── shared controls ─────────────────────────────────────────────────────────────── */
/* fields match the staff sign-in (static/app/join): label + hint on one line, a 48px box,
   the border alone says focus, an eye on password boxes */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > .lab { font-size: 0.86rem; font-weight: 500; color: var(--title-color); display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.field > .lab .hint { font-weight: 400; font-size: 0.76rem; color: var(--gray-color); font-family: var(--font-read), sans-serif; }
.field > small { font-size: 0.76rem; color: var(--gray-color); font-family: var(--font-read), sans-serif; }
.box { position: relative; display: flex; align-items: center; }
.input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: 13px;
  background: var(--background); border: var(--input-border); outline: none;
  font-size: 1rem; color: var(--text-color); transition: border-color 0.15s;
}
.input.mono { font-family: var(--font-main), sans-serif; letter-spacing: 0.04em; }
.box.icon .input { padding-right: 46px; }
.eye { position: absolute; right: 6px; width: 36px; height: 36px; border-radius: 9px; border: none; background: transparent; color: var(--gray-color); cursor: pointer; display: flex; align-items: center; justify-content: center; }
.eye:hover { color: var(--accent-color); background: var(--action-background); }
textarea.input { height: auto; min-height: 112px; padding: 12px 14px; line-height: 1.45; resize: vertical; }
.input:focus { border: var(--input-border-focus); }
.input:-webkit-autofill, .input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--background) inset; -webkit-text-fill-color: var(--text-color); }
::placeholder { color: var(--gray-color); opacity: 0.6; }
.input.code { letter-spacing: 0.5em; text-align: center; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 54px; padding: 0 22px; border-radius: 16px; border: none; cursor: pointer;
  font-size: 1rem; font-weight: 700; letter-spacing: -0.01em;
  background: var(--accent-color); color: var(--dark-white);
  transition: transform var(--motion-fast), filter var(--motion-fast), opacity var(--motion-fast);
}
.btn:active { transform: scale(0.98); }
.btn:hover { filter: brightness(1.06); }
.btn[disabled] { opacity: 0.55; cursor: progress; }
.btn.block { width: 100%; }
a.btn, a.link, .section-title a { text-decoration: none; }
.btn.gold { background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold)); color: var(--dark-white); }
.btn.ghost { background: transparent; color: var(--accent-color); border: var(--action-border); }
.btn.quiet { background: var(--gray-background); color: var(--title-color); }
.link { background: none; border: none; padding: 0; color: var(--accent-color); font-weight: 600; cursor: pointer; font-size: 0.92rem; }
.note { font-size: 0.86rem; color: var(--gray-color); line-height: 1.5; margin: 0; }
.alert { padding: 12px 14px; border-radius: 12px; font-size: 0.9rem; line-height: 1.45; }
.alert.bad { background: var(--error-background); color: var(--error-color); border: var(--error-border); }
.alert.ok { background: var(--success-background); color: var(--success-color); border: var(--success-border); }
.alert.warn { background: var(--warn-background); color: var(--warn-color); border: var(--warn-border); }
.alert:empty { display: none; }
.spin { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ── sign-in ─────────────────────────────────────────────────────────────────────── */
.auth { min-height: 100dvh; display: grid; grid-template-rows: auto 1fr; }
.auth-hero {
  position: relative; overflow: hidden; color: var(--dark-white);
  padding: max(28px, env(safe-area-inset-top)) 24px 72px;
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--brand-gold) 38%, transparent), transparent 60%),
              linear-gradient(160deg, var(--brand-green), var(--brand-green-deep));
}
.auth-hero::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 220px; height: 220px; border-radius: 50%; border: 28px solid color-mix(in srgb, var(--dark-white) 8%, transparent); }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.brand img { width: 44px; height: 44px; border-radius: 12px; background: var(--dark-white); padding: 4px; }
.brand b { display: block; font-family: var(--font-logo), var(--font-main), sans-serif; font-size: 1.15rem; letter-spacing: -0.01em; }
.brand small { display: block; font-size: 0.78rem; opacity: 0.85; }
.auth-hero h1 { margin: 34px 0 8px; font-size: clamp(1.7rem, 6vw, 2.4rem); line-height: 1.1; letter-spacing: -0.03em; max-width: 16ch; }
.auth-hero p { margin: 0; opacity: 0.9; max-width: 34ch; line-height: 1.5; }
.auth-card {
  position: relative; z-index: 1; margin: -44px auto 32px; width: min(460px, calc(100% - 28px));
  background: var(--stat-background); border: var(--border); border-radius: 24px; padding: 22px;
  box-shadow: var(--modal-shadow); display: flex; flex-direction: column; gap: 16px; align-self: start;
}
.seg { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 14px; background: var(--gray-background); }
.seg button { height: 42px; border: none; border-radius: 11px; background: transparent; font-weight: 600; font-size: 0.9rem; color: var(--gray-color); cursor: pointer; }
.seg button.on { background: var(--stat-background); color: var(--title-color); box-shadow: var(--box-shadow); }
.auth-card form { display: flex; flex-direction: column; gap: 14px; }
.steps { display: flex; gap: 6px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--gray-background); }
.steps i.on { background: var(--accent-color); }
.auth-foot { text-align: center; font-size: 0.82rem; color: var(--gray-color); padding: 0 20px 28px; }
@media (min-width: 900px) {
  .auth { grid-template-rows: none; grid-template-columns: 1.1fr 1fr; }
  .auth-hero { padding: 56px 56px; display: flex; flex-direction: column; justify-content: center; }
  .auth-hero h1 { font-size: 3rem; }
  .auth-right { display: flex; flex-direction: column; justify-content: center; }
  .auth-card { margin: 0 auto; }
}

/* ── the portal shell ────────────────────────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(12px, env(safe-area-inset-top)) 18px 12px; background: color-mix(in srgb, var(--background) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: var(--border);
}
.top .hi small { display: block; font-size: 0.78rem; color: var(--gray-color); }
.top .hi b { font-size: 1.05rem; color: var(--title-color); letter-spacing: -0.02em; }
.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 0.9rem; color: var(--dark-white); background: linear-gradient(135deg, var(--brand-green), var(--brand-green-deep)); border: none; cursor: pointer; text-decoration: none; }
main.view { max-width: 720px; margin: 0 auto; padding: 18px 16px calc(120px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 16px; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 2px 0; }
.section-title h2 { margin: 0; font-size: 1rem; color: var(--title-color); letter-spacing: -0.01em; }

.card { background: var(--stat-background); border: var(--border); border-radius: 20px; padding: 18px; box-shadow: var(--box-shadow); }
.loan-card { display: flex; flex-direction: column; gap: 14px; }
.loan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.loan-head .k { font-size: 0.82rem; color: var(--gray-color); font-weight: 600; }
.loan-head .bal { font-size: clamp(1.9rem, 8vw, 2.4rem); font-weight: 800; color: var(--title-color); letter-spacing: -0.04em; line-height: 1.05; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 11px; border-radius: 999px; font-size: 0.76rem; font-weight: 700; white-space: nowrap; }
.chip.ok { background: var(--success-background); color: var(--success-color); }
.chip.warn { background: var(--warn-background); color: var(--warn-color); }
.chip.bad { background: var(--error-background); color: var(--error-color); }
.chip.dim { background: var(--gray-background); color: var(--gray-color); }
.progress { display: flex; flex-direction: column; gap: 8px; }
.bar { height: 12px; border-radius: 6px; background: var(--gray-background); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--accent-alt), var(--accent-color)); transition: width var(--motion-slow) var(--ease); }
.progress .row { display: flex; justify-content: space-between; font-size: 0.84rem; color: var(--gray-color); }
.progress .row b { color: var(--title-color); }
.next { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 14px; border-radius: 16px; background: var(--holding-background); border: var(--border); }
.next.late { background: var(--error-background); border: var(--error-border); }
.next .cal { width: 52px; height: 56px; border-radius: 12px; background: var(--stat-background); border: var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.next .cal small { font-size: 0.68rem; font-weight: 700; color: var(--error-color); text-transform: uppercase; }
.next .cal b { font-size: 1.35rem; color: var(--title-color); }
.next .what small { display: block; font-size: 0.8rem; color: var(--gray-color); }
.next .what b { font-size: 1.15rem; color: var(--title-color); }
.next.late .what small { color: var(--error-color); font-weight: 600; }
.loan-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.loan-actions .btn { height: 48px; font-size: 0.92rem; }

.list { display: flex; flex-direction: column; }
.item { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 2px; border-bottom: var(--border); }
.item:last-child { border-bottom: none; }
.item .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--success-background); color: var(--success-color); }
.item .ic.dim { background: var(--gray-background); color: var(--gray-color); }
.item .ic.bad { background: var(--error-background); color: var(--error-color); }
.item .ic.warn { background: var(--warn-background); color: var(--warn-color); }
.item .t b { display: block; font-size: 0.95rem; color: var(--title-color); }
.item .t small { font-size: 0.8rem; color: var(--gray-color); }
.item .amt { font-weight: 700; color: var(--title-color); text-align: right; }
.item .amt small { display: block; font-weight: 500; font-size: 0.76rem; color: var(--gray-color); }
.empty { text-align: center; padding: 28px 18px; color: var(--gray-color); }
.empty b { display: block; color: var(--title-color); font-size: 1.05rem; margin-bottom: 6px; }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 0; }
.kv dt { color: var(--gray-color); font-size: 0.88rem; padding: 10px 0; border-bottom: var(--border); }
.kv dd { margin: 0; color: var(--title-color); font-weight: 600; text-align: right; padding: 10px 0 10px 12px; border-bottom: var(--border); }
.kv dt:nth-last-of-type(1), .kv dd:last-of-type { border-bottom: none; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--gray-color); text-decoration: none; font-weight: 600; font-size: 0.9rem; }

/* bottom navigation with the Pay button in the middle */
.tabs-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr auto 1fr 1fr; align-items: end;
  padding: 8px 10px max(8px, env(safe-area-inset-bottom)); background: var(--stat-background); border-top: var(--border); box-shadow: var(--footer-shadow);
}
.tabs-bar a, .tabs-bar button.tab { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; font-size: 0.72rem; font-weight: 600; color: var(--gray-color); text-decoration: none; background: none; border: none; cursor: pointer; }
.tabs-bar a.on { color: var(--accent-color); }
.tabs-bar svg { width: 22px; height: 22px; }
.pay-fab {
  margin: -30px 8px 0; width: 70px; height: 70px; border-radius: 50%; border: 5px solid var(--background); cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(135deg, var(--brand-gold-light), var(--brand-gold)); color: var(--dark-white);
  font-weight: 800; font-size: 0.72rem; box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--brand-gold) 70%, transparent);
}
.pay-fab svg { width: 24px; height: 24px; }
@media (min-width: 760px) { .tabs-bar { left: 50%; right: auto; transform: translateX(-50%); width: 560px; bottom: 16px; border-radius: 22px; border: var(--border); } }

/* the pay sheet */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.45); opacity: 0; pointer-events: none; transition: opacity var(--motion); }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 92dvh; overflow-y: auto;
  background: var(--stat-background); border-radius: 26px 26px 0 0; padding: 10px 20px calc(24px + env(safe-area-inset-bottom));
  transform: translateY(105%); visibility: hidden; transition: transform var(--motion) var(--ease), visibility 0s linear var(--motion); display: flex; flex-direction: column; gap: 16px;
}
.sheet.on { transform: none; visibility: visible; transition: transform var(--motion) var(--ease), visibility 0s; }
#pay-body { display: flex; flex-direction: column; gap: 14px; }
.sheet .grip { width: 44px; height: 5px; border-radius: 3px; background: var(--gray-background); margin: 0 auto 4px; }
.sheet h3 { margin: 0; font-size: 1.25rem; color: var(--title-color); letter-spacing: -0.02em; }
@media (min-width: 760px) { .sheet { left: 50%; right: auto; width: 520px; bottom: 24px; border-radius: 26px; transform: translate(-50%, 120%); } .sheet.on { transform: translate(-50%, 0); } }
.amount-box { display: flex; align-items: center; gap: 8px; height: 66px; padding: 0 18px; border-radius: 18px; border: var(--input-border); background: var(--background); }
.amount-box span { font-weight: 700; color: var(--gray-color); }
.amount-box input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; font-size: 1.9rem; font-weight: 800; color: var(--title-color); font-variant-numeric: tabular-nums; }
.amount-box:focus-within { border: var(--input-border-focus); }
.quick { display: flex; gap: 8px; flex-wrap: wrap; }
.quick button { height: 36px; padding: 0 14px; border-radius: 999px; border: var(--border); background: var(--background); font-size: 0.84rem; font-weight: 600; color: var(--title-color); cursor: pointer; }
.quick button.on { border: var(--selected-border); color: var(--accent-color); }
.status { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 18px 6px; }
.status .big { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; }
.status .big.wait { background: var(--holding-background); color: var(--accent-color); }
.status .big.ok { background: var(--success-background); color: var(--success-color); }
.status .big.bad { background: var(--error-background); color: var(--error-color); }
.status .big svg { width: 34px; height: 34px; }
.status b { font-size: 1.15rem; color: var(--title-color); }
.loan-pick { display: flex; flex-direction: column; gap: 8px; }
.loan-pick label { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; border: var(--border); cursor: pointer; }
.loan-pick input { accent-color: var(--accent-color); }
.loan-pick label:has(input:checked) { border: var(--selected-border); }
.install { display: flex; align-items: center; gap: 14px; }
.install img { width: 48px; height: 48px; border-radius: 12px; }
