/* Commercial Bank */

:root {
  --cb-blue: #1f59a8;
  --cb-blue-dark: #174a8c;
  --cb-blue-light: #2a6bc4;
  --cb-text: #1a4480;
  --cb-muted: #8a8a8a;
  --cb-input-bg: #ececec;
  --cb-white: #ffffff;
  --cb-error: #d32f2f;
  --cb-success: #2e7d32;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--cb-blue);
  color: var(--cb-text);
  -webkit-font-smoothing: antialiased;
}

body { overflow: hidden; }

.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 100dvh;
  min-height: 100svh;
  overflow: hidden;
}

.screen.active { display: flex; }

/* Shared logo */
.cb-logo-img {
  display: block;
  object-fit: contain;
}

.cb-logo-img--header {
  width: min(220px, 58vw);
  margin: 0 auto;
  mix-blend-mode: lighten;
}

.cb-logo-img--otp {
  width: min(260px, 72vw);
  margin: 0 auto;
  mix-blend-mode: lighten;
}

.cb-logo-img--btn {
  width: 40px;
  height: auto;
  mix-blend-mode: lighten;
}

.cb-brand-name {
  display: none;
}

/* Card screen */
.cb-screen {
  background: var(--cb-blue);
}

.cb-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(env(safe-area-inset-top, 16px) + 20px) 24px 28px;
}

.cb-panel {
  flex: 1;
  background: var(--cb-white);
  border-radius: 28px 28px 0 0;
  padding: 28px 22px calc(env(safe-area-inset-bottom, 16px) + 24px);
  overflow-y: auto;
}

.cb-section {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid #e8e8e8;
}

.cb-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.cb-section-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--cb-text);
  margin-bottom: 4px;
}

.cb-section-hint {
  font-size: 0.78rem;
  color: var(--cb-muted);
  margin-bottom: 14px;
}

.cb-input-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--cb-input-bg);
  border-radius: 8px;
  padding: 0 14px;
  min-height: 52px;
}

.cb-input-wrap.input-error {
  outline: 2px solid var(--cb-error);
  outline-offset: 1px;
}

.cb-input-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  color: var(--cb-blue);
}

.cb-input-icon svg {
  width: 100%;
  height: 100%;
}

.cb-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 0.95rem;
  color: #333;
  outline: none;
  min-width: 0;
  padding: 14px 0;
}

.cb-input::placeholder { color: #aaa; }

.cb-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.cb-submit {
  width: 100%;
  margin-top: 28px;
  min-height: 56px;
  border: none;
  border-radius: 14px;
  background: var(--cb-blue);
  color: var(--cb-white);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0 20px;
}

.cb-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.cb-submit .cb-logo svg {
  display: none;
}

.cb-submit-text { flex: 1; text-align: center; }

.form-error {
  color: var(--cb-error);
  font-size: 0.78rem;
  margin-top: 8px;
}

/* OTP screen */
.cb-otp-screen {
  background: var(--cb-blue);
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cb-otp-inner {
  width: 100%;
  max-width: 360px;
  text-align: center;
  color: var(--cb-white);
}

.cb-otp-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}

.cb-otp-brand .cb-logo svg {
  display: none;
}

.cb-otp-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.cb-otp-desc {
  font-size: 0.88rem;
  line-height: 1.5;
  opacity: 0.92;
  margin-bottom: 32px;
  padding: 0 12px;
}

.cb-otp-boxes {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: nowrap;
  margin-bottom: 36px;
}

.cb-otp-box {
  width: 42px;
  height: 52px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  border-radius: 8px;
  background: transparent;
  color: var(--cb-white);
  text-align: center;
  font-size: 1.35rem;
  font-weight: 600;
  outline: none;
  padding: 0;
}

.cb-otp-box:focus {
  border-color: var(--cb-white);
  background: rgba(255, 255, 255, 0.08);
}

.cb-otp-box.input-error {
  border-color: #ffcdd2;
}

.cb-otp-resend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  opacity: 0.95;
}

.cb-otp-resend svg {
  width: 18px;
  height: 18px;
}

.cb-otp-resend span { font-weight: 600; }

.cb-otp-screen .form-error {
  color: #ffcdd2;
  text-align: center;
  margin-top: 16px;
}

/* User toast notification */
.user-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 16px) + 24px);
  transform: translateX(-50%) translateY(120%);
  z-index: 100;
  min-width: min(320px, 90vw);
  max-width: 90vw;
  padding: 14px 18px;
  border-radius: 12px;
  background: #1b5e20;
  color: #fff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  transition: transform 0.35s ease;
}

.user-toast.show {
  transform: translateX(-50%) translateY(0);
}

.user-toast.error {
  background: #c62828;
}

/* Done screen */
.cb-done-screen {
  background: var(--cb-blue);
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  color: var(--cb-white);
}

.cb-done-inner { max-width: 320px; }

.cb-done-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: grid;
  place-items: center;
}

.cb-done-icon svg {
  width: 36px;
  height: 36px;
}

.cb-done-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.cb-done-text {
  font-size: 0.92rem;
  opacity: 0.9;
  line-height: 1.5;
}

@media (max-width: 360px) {
  .cb-row { grid-template-columns: 1fr; gap: 22px; }
  .cb-otp-box { width: 36px; height: 48px; font-size: 1.2rem; }
  .cb-otp-boxes { gap: 6px; }
}
