/* BBK — Online banking ePIN creation */

:root {
  --bbk-blue: #003366;
  --bbk-blue-deep: #00264d;
  --bbk-blue-mid: #0a4a7a;
  --bbk-orange: #f5a623;
  --bbk-bg: #dfe8f2;
  --bbk-card: #ffffff;
  --bbk-banner: #eef3f8;
  --bbk-border: #c9d4e0;
  --bbk-muted: #7a8a9a;
  --bbk-error: #c62828;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100dvh;
  font-family: var(--font);
  background: var(--bbk-bg);
  color: var(--bbk-blue);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.bbk-app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px 16px calc(env(safe-area-inset-bottom, 0px) + 24px);
  position: relative;
}

.screen {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.screen.active {
  display: flex;
}

.bbk-top {
  text-align: center;
  padding-top: calc(env(safe-area-inset-top, 0px) + 8px);
}

.bbk-logo {
  display: block;
  width: min(220px, 70%);
  height: auto;
  margin: 0 auto 18px;
  object-fit: contain;
}

.bbk-page-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bbk-blue);
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.bbk-card {
  background: var(--bbk-card);
  border-radius: 4px;
  box-shadow: 0 2px 14px rgba(0, 51, 102, 0.08);
  padding: 16px 16px 22px;
}

.bbk-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.bbk-card-title,
.bbk-card-title-text {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--bbk-blue);
  cursor: pointer;
  padding: 0;
}

.bbk-card-title-text {
  cursor: default;
}

.bbk-chevron {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1.5px solid var(--bbk-blue);
  display: grid;
  place-items: center;
  color: var(--bbk-blue);
}

.bbk-chevron svg {
  width: 12px;
  height: 12px;
}

.bbk-home {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  color: var(--bbk-blue);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.bbk-home svg {
  width: 24px;
  height: 24px;
}

.bbk-banner {
  background: var(--bbk-banner);
  color: var(--bbk-blue);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  padding: 14px 16px;
  margin: 0 -16px 20px;
  border-top: 1px solid #e2e9f0;
  border-bottom: 1px solid #e2e9f0;
}

.bbk-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.bbk-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bbk-blue);
  margin-top: 6px;
}

.bbk-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--bbk-border);
  border-radius: 2px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--bbk-blue-deep);
  background: #fff;
  outline: none;
}

.bbk-input::placeholder {
  color: #a8b4c0;
}

.bbk-input:focus {
  border-color: var(--bbk-blue-mid);
  box-shadow: 0 0 0 2px rgba(10, 74, 122, 0.12);
}

.bbk-input.input-error {
  border-color: var(--bbk-error);
  background: #fff5f5;
}

.bbk-pass-wrap {
  position: relative;
}

.bbk-pass-wrap .bbk-input {
  padding-right: 44px;
}

.bbk-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  color: var(--bbk-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.bbk-eye svg {
  width: 20px;
  height: 20px;
}

.bbk-eye-on[hidden],
.bbk-eye-off[hidden] {
  display: none !important;
}

.bbk-btn {
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: 2px;
  background: var(--bbk-blue);
  color: #fff;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}

.bbk-btn:active {
  background: var(--bbk-blue-deep);
}

.bbk-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.bbk-otp-mask {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--bbk-blue);
  margin-bottom: 4px;
}

.bbk-otp-mask--email {
  margin-bottom: 18px;
  font-weight: 500;
  color: var(--bbk-blue-mid);
}

.bbk-otp-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
}

.bbk-otp-cell {
  width: 44px;
  height: 50px;
  border: 1px solid var(--bbk-border);
  border-radius: 2px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--bbk-blue);
  background: #fff;
  outline: none;
}

.bbk-otp-cell:focus {
  border-color: var(--bbk-blue-mid);
  box-shadow: 0 0 0 2px rgba(10, 74, 122, 0.12);
}

.bbk-otp-cell.input-error {
  border-color: var(--bbk-error);
  background: #fff5f5;
}

.bbk-otp-resend {
  text-align: center;
  font-size: 0.875rem;
  color: var(--bbk-muted);
  margin: 8px 0 4px;
}

.bbk-otp-resend span {
  color: var(--bbk-orange);
  font-weight: 700;
}

.form-error {
  color: var(--bbk-error);
  font-size: 0.8rem;
  margin-top: 2px;
}

.user-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateX(-50%) translateY(120%);
  background: rgba(0, 38, 77, 0.94);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 9999;
  transition: transform 0.25s;
  max-width: calc(100% - 32px);
  text-align: center;
}

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

.user-toast.error {
  background: rgba(198, 40, 40, 0.95);
}

.bbk-input:-webkit-autofill,
.bbk-input:-webkit-autofill:hover,
.bbk-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--bbk-blue-deep);
  transition: background-color 99999s ease-out 0s;
}
