/* Binance-bridge overlays — auth (dark) + withdraw flow (light, Deriv Partners) */
.db-root {
  --db-red: #ff444f;
  --db-red-dim: #f8c4c7;
  --db-bg: #0e0e0e;
  --db-sheet: #151717;
  --db-text: #ffffff;
  --db-sub: #c2c2c2;
  --db-border: #2a2e33;
  --db-input: #1c2430;
  --db-ok: #12301f;
  --db-err: #3a1e20;
  --wd-bg: #ffffff;
  --wd-text: #0e0e0e;
  --wd-muted: #6e6e6e;
  --wd-card: #f2f3f4;
  --wd-chip: #ffffff;
  --wd-chip-border: #d6d6d6;
  --wd-chip-active: #0e0e0e;
  font-family: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

.db-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  animation: dbFade 0.2s ease;
}

.db-overlay.db-center {
  align-items: center;
  padding: 16px;
}

.db-sheet {
  width: 100%;
  max-width: 480px;
  background: var(--db-sheet);
  color: var(--db-text);
  border-radius: 20px 20px 0 0;
  padding: 20px 18px 28px;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.45);
  animation: dbSlide 0.22s ease;
}

.db-overlay.db-center .db-sheet {
  border-radius: 20px;
  max-height: min(92vh, 640px);
  overflow: auto;
}

.db-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}

.db-sub {
  font-size: 14.5px;
  color: var(--db-sub);
  line-height: 1.45;
  margin: 0 0 18px;
}

.db-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.db-tab {
  flex: 1;
  border: 1px solid var(--db-border);
  background: transparent;
  color: var(--db-sub);
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.db-tab.active {
  background: var(--db-red);
  border-color: var(--db-red);
  color: #fff;
}

.db-label {
  display: block;
  font-size: 13px;
  color: var(--db-sub);
  margin: 0 0 6px;
}

.db-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--db-input);
  border: 1px solid var(--db-border);
  color: var(--db-text);
  border-radius: 12px;
  padding: 14px 14px;
  font-size: 16px;
  margin-bottom: 14px;
  outline: none;
}

.db-input:focus {
  border-color: var(--db-red);
}

.db-btn {
  width: 100%;
  border: 0;
  border-radius: 26px;
  padding: 16px 0;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  background: var(--db-red);
  color: #fff;
  margin-top: 6px;
}

.db-btn:disabled {
  background: var(--db-red-dim);
  cursor: not-allowed;
}

.db-btn.secondary {
  background: transparent;
  border: 1px solid var(--db-border);
  color: var(--db-text);
  margin-top: 10px;
}

.db-error {
  background: var(--db-err);
  border: 1px solid var(--db-red);
  color: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
  margin-bottom: 12px;
}

.db-hint {
  font-size: 13px;
  color: var(--db-sub);
  margin-top: 12px;
  line-height: 1.4;
}

.db-toast {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 92px;
  z-index: 99999;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.db-toast-item {
  background: #12301f;
  border: 1px solid #00a39a;
  color: #fff;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  animation: dbFade 0.22s ease;
}

.db-toast-item.err {
  background: #3a1e20;
  border-color: var(--db-red);
}

.db-auth-chip {
  position: fixed;
  top: max(8px, env(safe-area-inset-top));
  right: 10px;
  z-index: 99980;
  background: rgba(21, 23, 23, 0.88);
  border: 1px solid var(--db-border);
  color: #fff;
  border-radius: 16px;
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  max-width: 42vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  opacity: 0.92;
}

.db-auth-chip.guest {
  background: rgba(255, 68, 79, 0.92);
  border-color: transparent;
}

/* ——— Withdraw flow (light full-screen) ——— */
.db-wd-overlay {
  position: fixed;
  inset: 0;
  z-index: 99990;
  background: var(--wd-bg);
  color: var(--wd-text);
  display: flex;
  flex-direction: column;
}

.db-wd-overlay--enter {
  animation: dbFade 0.22s ease;
}

.db-wd-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  padding-top: max(10px, env(safe-area-inset-top));
  flex-shrink: 0;
}

.db-wd-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 0;
  background: var(--wd-card);
  color: var(--wd-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.18s ease, transform 0.15s ease;
}

.db-wd-icon-btn:active {
  transform: scale(0.94);
  background: #e5e6e7;
}

.db-wd-icon-btn svg {
  width: 20px;
  height: 20px;
}

.db-wd-brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.db-wd-brand span {
  color: var(--db-red);
}

.db-wd-body {
  flex: 1;
  overflow: auto;
  padding: 8px 20px 28px;
  -webkit-overflow-scrolling: touch;
}

.db-wd-step {
  will-change: transform, opacity;
}

.db-wd-step[data-dir="1"] {
  animation: dbWdEnterForward 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.db-wd-step[data-dir="-1"] {
  animation: dbWdEnterBack 0.3s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.db-wd-h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 8px 0 18px;
  line-height: 1.15;
}

.db-wd-method {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.db-wd-method-card {
  border: 0;
  background: var(--wd-card);
  border-radius: 16px;
  padding: 18px 16px 14px;
  text-align: left;
  cursor: pointer;
  color: inherit;
  width: 100%;
  transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease,
    box-shadow 0.18s ease;
}

.db-wd-method-card:hover {
  background: #eceeef;
}

.db-wd-method-card:active,
.db-wd-method-card.selected {
  transform: scale(0.985);
  background: #e6e8ea;
}

.db-wd-method-card h3 {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
}

.db-wd-method-card p {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--wd-muted);
}

.db-wd-method-icons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  min-height: 28px;
}

.db-wd-method-icons img,
.db-wd-coin-mini {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  flex-shrink: 0;
}

.db-wd-more {
  font-size: 13px;
  color: var(--wd-muted);
  font-weight: 600;
}

.db-wd-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.db-wd-badge {
  background: #e8e9ea;
  color: #3d3d3d;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
}

.db-wd-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 14px;
  margin: 0 -4px 6px;
  scrollbar-width: none;
}

.db-wd-chips::-webkit-scrollbar {
  display: none;
}

.db-wd-chip {
  flex-shrink: 0;
  border: 1.5px solid var(--wd-chip-border);
  background: var(--wd-chip);
  color: var(--wd-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.15s ease, box-shadow 0.18s ease;
}

.db-wd-chip:active {
  transform: scale(0.96);
}

.db-wd-chip.active {
  border-color: var(--wd-chip-active);
  background: #fff;
  box-shadow: inset 0 0 0 0.5px var(--wd-chip-active);
}

.db-wd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.db-wd-coin {
  border: 0;
  background: var(--wd-card);
  border-radius: 16px;
  padding: 22px 12px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease,
    box-shadow 0.2s ease;
  animation: dbWdPop 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 35ms);
}

.db-wd-coin:hover {
  background: #eceeef;
  transform: translateY(-1px);
}

.db-wd-coin:active,
.db-wd-coin.selected {
  transform: scale(0.97);
  background: #e4e6e8;
  box-shadow: inset 0 0 0 1.5px #111;
}

.db-wd-coin-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 800;
  color: #fff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.db-wd-coin:hover .db-wd-coin-icon {
  transform: scale(1.04);
}

.db-wd-coin.selected .db-wd-coin-icon {
  transform: scale(0.96);
}

.db-wd-coin span {
  font-size: 15px;
  font-weight: 600;
}

.db-wd-net-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.db-wd-net {
  border: 0;
  background: var(--wd-card);
  border-radius: 14px;
  padding: 14px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  cursor: pointer;
  color: inherit;
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), background 0.18s ease,
    box-shadow 0.2s ease;
  animation: dbWdPop 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 40ms);
}

.db-wd-net:hover {
  background: #eceeef;
}

.db-wd-net:active,
.db-wd-net.selected {
  transform: scale(0.985);
  background: #e4e6e8;
  box-shadow: inset 0 0 0 1.5px #111;
}

.db-wd-net-icons {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.db-wd-net-icons .main {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
}

.db-wd-net-icons .sub {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 800;
  color: #fff;
}

.db-wd-net strong {
  display: block;
  font-size: 16px;
  font-weight: 700;
}

.db-wd-net small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--wd-muted);
}

.db-wd-form .db-label {
  color: var(--wd-muted);
}

.db-wd-form .db-input {
  background: var(--wd-card);
  border: 1px solid #e4e4e4;
  color: var(--wd-text);
  margin-bottom: 14px;
}

.db-wd-form .db-input:focus {
  border-color: var(--db-red);
  background: #fff;
}

.db-wd-form .db-btn {
  margin-top: 8px;
}

.db-wd-form .db-btn.secondary {
  border-color: #d6d6d6;
  color: var(--wd-text);
}

.db-wd-form .db-hint {
  color: var(--wd-muted);
}

.db-wd-form .db-error {
  background: #fff0f1;
  border-color: var(--db-red);
  color: #8a1218;
}

.db-wd-verify-lead {
  font-size: 15px;
  line-height: 1.45;
  color: var(--wd-muted);
  margin: 0 0 22px;
}

.db-wd-verify-lead strong {
  color: var(--wd-text);
  font-weight: 700;
}

.db-wd-otp {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 28px;
}

.db-wd-otp input {
  width: 100%;
  max-width: 52px;
  aspect-ratio: 1;
  box-sizing: border-box;
  border: 1.5px solid #d0d0d0;
  border-radius: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--wd-text);
  background: #fff;
  outline: none;
  caret-color: var(--db-red);
}

.db-wd-otp input:focus {
  border-color: var(--db-red);
}

.db-wd-resend {
  margin-top: 8px;
}

.db-wd-resend p {
  margin: 0 0 6px;
  font-size: 14px;
  color: var(--wd-muted);
}

.db-wd-resend button {
  border: 0;
  background: transparent;
  color: var(--wd-text);
  font-size: 15px;
  font-weight: 700;
  padding: 0;
  cursor: pointer;
}

.db-wd-resend button:disabled {
  color: var(--wd-muted);
  cursor: default;
  font-weight: 600;
}

.db-wd-success {
  background: var(--wd-card);
  border-radius: 16px;
  padding: 22px 18px;
  margin-top: 8px;
}

.db-wd-success-label {
  font-size: 13px;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--wd-text);
}

.db-wd-success-amount {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
}

.db-wd-success-row {
  margin-bottom: 16px;
}

.db-wd-success-row:last-child {
  margin-bottom: 0;
}

.db-wd-success-row dt {
  font-size: 13px;
  color: var(--wd-muted);
  margin: 0 0 4px;
}

.db-wd-success-row dd {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  word-break: break-all;
  line-height: 1.4;
}

@keyframes dbFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes dbSlide {
  from {
    transform: translateY(24px);
  }
  to {
    transform: translateY(0);
  }
}

@keyframes dbWdEnterForward {
  from {
    opacity: 0;
    transform: translateX(22px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dbWdEnterBack {
  from {
    opacity: 0;
    transform: translateX(-18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes dbWdPop {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .db-wd-overlay--enter,
  .db-wd-step[data-dir="1"],
  .db-wd-step[data-dir="-1"],
  .db-wd-coin,
  .db-wd-net {
    animation: none !important;
  }

  .db-wd-coin,
  .db-wd-net,
  .db-wd-chip,
  .db-wd-method-card,
  .db-wd-icon-btn,
  .db-wd-coin-icon {
    transition: none !important;
  }
}

@media (min-width: 640px) {
  .db-wd-overlay {
    max-width: 480px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    border-left: 1px solid #ececec;
    border-right: 1px solid #ececec;
  }
}
