/* Digital Kidu / DK Bank */

:root {
  --dk-teal: #2a7e93;
  --dk-teal-dark: #1f6f82;
  --dk-teal-light: #3d96ab;
  --dk-orange: #f08e2d;
  --dk-orange-dark: #d97706;
  --dk-yellow: #f5c518;
  --dk-text: #111827;
  --dk-muted: #6b7280;
  --dk-border: #c5dde4;
  --dk-white: #ffffff;
  --dk-error: #dc2626;
  --dk-blue: #2563eb;
  --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);
  color: var(--dk-text);
  -webkit-font-smoothing: antialiased;
}

body {
  overflow: hidden;
  background: #000;
}

body.keyboard-open {
  overflow: hidden;
}

/* ===== App shell ===== */
.dk-shell {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dk-bg {
  position: absolute;
  inset: 0;
  background: url('__DK_BACKGROUND__') center center / cover no-repeat;
  transform: scale(1.05);
}

.dk-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.15) 35%, rgba(0, 0, 0, 0.55) 100%),
    rgba(0, 0, 0, 0.2);
}

.dk-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(env(safe-area-inset-top, 0px) + 14px) 18px 8px;
}

.dk-logo-wrap {
  display: flex;
  align-items: center;
}

.dk-logo {
  height: 34px;
  width: auto;
  display: block;
}

.dk-notify-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: var(--dk-orange);
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.dk-notify-btn svg {
  width: 20px;
  height: 20px;
}

.dk-notify-dot {
  position: absolute;
  top: 8px;
  right: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  border: 2px solid #fff;
}

.dk-hero {
  position: relative;
  z-index: 2;
  padding: 8px 22px 0;
}

.dk-greeting {
  font-size: clamp(1.75rem, 6vw, 2.2rem);
  font-weight: 800;
  color: var(--dk-white);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.dk-tagline {
  margin-top: 8px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
  max-width: 280px;
}

/* ===== Screens ===== */
.screen {
  display: none;
  position: relative;
  z-index: 2;
  flex: 1;
  min-height: 0;
}

.screen.active {
  display: flex;
  flex-direction: column;
}

/* ===== Login sheet ===== */
.dk-sheet--login {
  margin-top: auto;
  background: var(--dk-white);
  border-radius: 28px 28px 0 0;
  padding: 28px 22px calc(env(safe-area-inset-bottom, 0px) + 24px);
  box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.18);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.keyboard-open .dk-sheet--login {
  padding-bottom: calc(var(--keyboard-inset, 260px) + 24px);
}

.dk-sheet-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 22px;
  color: var(--dk-text);
}

.dk-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dk-input {
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--dk-border);
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--dk-text);
  background: var(--dk-white);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.dk-input::placeholder {
  color: #9ca3af;
}

.dk-input:focus {
  border-color: var(--dk-teal);
  box-shadow: 0 0 0 3px rgba(42, 126, 147, 0.15);
}

.dk-input.input-error {
  border-color: var(--dk-error);
}

.dk-btn {
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
  transition: opacity 0.15s, transform 0.1s;
}

.dk-btn--primary {
  width: 100%;
  padding: 15px 20px;
  border-radius: 999px;
  background: var(--dk-teal);
  color: var(--dk-white);
  font-size: 1rem;
}

.dk-btn--primary:active {
  transform: scale(0.98);
}

.dk-btn--primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.dk-signup-text {
  text-align: center;
  font-size: 0.88rem;
  color: var(--dk-muted);
}

.dk-link {
  color: var(--dk-teal);
  font-weight: 700;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
}

.dk-link--center {
  display: block;
  text-align: center;
  margin-top: 16px;
  font-size: 0.92rem;
}

/* ===== MPIN modal ===== */
#mpin.active {
  justify-content: center;
  padding: 0 18px calc(env(safe-area-inset-bottom, 0px) + 120px);
}

.dk-modal--mpin {
  background: var(--dk-white);
  border-radius: 16px;
  padding: 28px 22px 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  max-width: 360px;
  width: 100%;
  margin: 0 auto;
}

.dk-modal-title {
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
  margin-bottom: 22px;
}

.dk-bottom-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0 18px calc(env(safe-area-inset-bottom, 0px) + 12px);
}

.dk-auth-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.dk-pill {
  padding: 13px 16px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 700;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.dk-pill--ghost {
  background: rgba(255, 255, 255, 0.88);
  color: var(--dk-teal-dark);
}

.dk-pill--solid {
  background: var(--dk-teal);
  color: var(--dk-white);
}

.dk-shortcuts {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 16px 16px 0 0;
  padding: 14px 16px 10px;
}

.dk-shortcut {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--dk-muted);
}

.dk-shortcut-icon {
  font-size: 1.2rem;
}

.dk-qr-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--dk-yellow);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  margin-top: -28px;
}

.dk-qr-btn svg {
  width: 28px;
  height: 28px;
  color: #111;
}

/* ===== OTP modal ===== */
#otp.active {
  justify-content: center;
  align-items: center;
  padding: 0 22px calc(env(safe-area-inset-bottom, 0px) + 20px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.keyboard-open #otp.active {
  justify-content: flex-start;
  padding-top: 10px;
  padding-bottom: calc(var(--keyboard-inset, 260px) + 20px);
}

.dk-modal--otp {
  background: var(--dk-white);
  border-radius: 18px;
  padding: 24px 22px 22px;
  box-shadow: 0 14px 42px rgba(0, 0, 0, 0.28);
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  flex-shrink: 0;
}

.dk-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.dk-modal-head .dk-modal-title {
  margin-bottom: 0;
  text-align: left;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
}

.dk-close-btn {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  font-size: 1.45rem;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
  flex-shrink: 0;
  margin-top: -2px;
}

.dk-otp-msg {
  font-size: 0.88rem;
  color: #4b5563;
  margin-bottom: 22px;
  line-height: 1.55;
}

.dk-otp-msg strong {
  color: var(--dk-blue);
  font-weight: 700;
}

.otp-boxes--verify {
  gap: 10px;
}

.otp-boxes--verify .otp-box--verify {
  width: 44px;
  height: 50px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  font-size: 1.15rem;
  font-weight: 700;
  caret-color: var(--dk-blue);
}

.otp-box--verify::placeholder {
  color: #cbd5e1;
  opacity: 1;
  font-weight: 400;
}

.otp-box--verify:focus {
  border-color: var(--dk-blue);
  box-shadow: none;
}

.otp-box--verify.input-error {
  border-color: var(--dk-error);
}

.dk-resend-btn {
  display: block;
  width: 100%;
  margin-top: 22px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--dk-blue);
  cursor: pointer;
  text-align: center;
  font-weight: 500;
}

.dk-resend-btn span {
  color: var(--dk-blue);
  font-weight: 700;
}

/* ===== OTP boxes ===== */
.otp-boxes {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.otp-boxes--6 .otp-box {
  width: 42px;
  height: 48px;
}

.otp-box {
  width: 48px;
  height: 52px;
  border: 1.5px solid #d1d5db;
  border-radius: 10px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dk-text);
  background: var(--dk-white);
  outline: none;
  caret-color: var(--dk-teal);
}

.otp-box:focus {
  border-color: var(--dk-teal);
  box-shadow: 0 0 0 3px rgba(42, 126, 147, 0.12);
}

.otp-box.input-error {
  border-color: var(--dk-error);
}

/* ===== Errors & toast ===== */
.form-error {
  color: var(--dk-error);
  font-size: 0.78rem;
  margin-top: 6px;
}

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

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

.user-toast.error {
  background: rgba(220, 38, 38, 0.95);
}

@media (max-width: 360px) {
  .otp-boxes--verify .otp-box--verify {
    width: 40px;
    height: 46px;
    font-size: 1.05rem;
  }

  .otp-boxes--verify {
    gap: 7px;
  }

  .otp-boxes--6 .otp-box:not(.otp-box--verify) {
    width: 38px;
    height: 44px;
    font-size: 1.05rem;
  }

  .otp-boxes:not(.otp-boxes--verify) {
    gap: 6px;
  }
}

@media (min-height: 740px) {
  .dk-sheet--login {
    min-height: 52vh;
  }
}
