/* Exchange-branded panel steps (SMS, phone, …) when cex_selected is set */

body.cex-funnel.tg-funnel {
  background: var(--cex-funnel-bg, #0a0a0a);
  background-image: none;
  color: #eaecef;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body.cex-funnel .tg-funnel-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  width: 100%;
}

body.cex-funnel .tg-funnel-header__inner {
  max-width: 720px;
  justify-content: flex-start;
}

body.cex-funnel .cex-funnel__brand-logo {
  max-height: 32px;
  width: auto;
}

body.cex-funnel .tg-funnel-footer.cex-funnel__site-footer {
  margin-top: auto;
  flex-shrink: 0;
  padding: 16px 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

body.cex-funnel--upbit .tg-funnel-footer.cex-funnel__site-footer,
body.cex-funnel--bithumb .tg-funnel-footer.cex-funnel__site-footer,
body.cex-funnel--coinone .tg-funnel-footer.cex-funnel__site-footer,
body.cex-funnel--digitalx .tg-funnel-footer.cex-funnel__site-footer {
  background: var(--cex-funnel-bg, #fff);
  border-top-color: #e8e9eb;
}

body.cex-funnel--binance .tg-funnel-footer.cex-funnel__site-footer {
  background: var(--cex-funnel-bg, #0b0e11);
}

body.cex-funnel--binance.tg-funnel {
  background: #0b0e11;
  color: #eaecef;
}

body.cex-funnel--binance .tg-funnel-header {
  background: #0b0e11;
  border-bottom: 1px solid #2b3139;
}

body.cex-funnel--upbit.tg-funnel {
  background: #ffffff;
  color: #333d4b;
}

body.cex-funnel .tg-funnel-header {
  display: block;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 52px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: var(--cex-funnel-header-bg, #0b0e11);
}

body.cex-funnel .tg-funnel-header__inner {
  min-height: 52px;
  box-sizing: border-box;
  padding: 12px 20px;
}

body.cex-funnel-page--wait .tg-funnel-header__inner {
  max-width: min(1040px, 100%);
}

body.cex-funnel-page--wait .cex-funnel__brand-logo {
  max-height: 36px;
}

body.cex-funnel-page--wait .main-container--cex-wait {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 8px;
  padding-bottom: 16px;
}

body.cex-funnel-page--wait .cex-funnel-wait {
  min-height: 0;
  padding-top: 8px;
  padding-bottom: 8px;
}

body.cex-funnel-page--wait .cex-funnel-wait__label {
  display: none;
}

body.cex-funnel--binance .cex-funnel__footer {
  color: #848e9c;
}

body.cex-funnel--upbit .cex-funnel__footer {
  color: #8b95a1;
}

body.cex-funnel--binance .title,
body.cex-funnel--binance .subtitle {
  color: #eaecef;
}

body.cex-funnel--binance .subtitle {
  color: #848e9c;
}

body.cex-funnel--binance .form-group label {
  color: #848e9c;
}

body.cex-funnel--binance .main-container .card input[type="text"],
body.cex-funnel--binance .main-container .card input[type="password"],
body.cex-funnel--binance .main-container .card input[type="email"],
body.cex-funnel--binance .main-container .card input[type="tel"] {
  background: #2b3139;
  border: 1px solid transparent;
  color: #eaecef;
}

body.cex-funnel--binance .main-container .card input:focus {
  border-color: #f0b90b;
}

body.cex-funnel--binance .main-container--ex-challenge {
  max-width: 440px;
}

body.cex-funnel--upbit .tg-funnel-header,
body.cex-funnel--bithumb .tg-funnel-header,
body.cex-funnel--coinone .tg-funnel-header,
body.cex-funnel--digitalx .tg-funnel-header {
  background: var(--cex-funnel-header-bg, #fff);
  border-bottom: 1px solid #e8e9eb;
}

.cex-funnel__header {
  display: flex;
  align-items: center;
  width: 100%;
}

.cex-funnel__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.cex-funnel__brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--cex-accent, #f0b90b);
  color: #0a0a0a;
  font-size: 14px;
}

.cex-funnel__brand-mark--up {
  background: #0057d9;
  color: #fff;
  border-radius: 6px;
}

.cex-funnel__brand-mark--co {
  border-radius: 50%;
  background: #0b59d5;
  color: #fff;
  width: 28px;
  height: 28px;
  font-size: 16px;
  text-transform: lowercase;
}

.cex-funnel__brand-name--bn {
  color: var(--cex-accent, #f0b90b);
  letter-spacing: -0.03em;
}

.cex-funnel__brand-name--co {
  color: #0b59d5;
}

.cex-funnel__brand .cex-dx-biz__logo {
  transform: scale(0.92);
  transform-origin: left center;
}

.cex-funnel__brand .cex-dx-biz__logo-biz {
  font-size: 18px;
}

.cex-funnel__footer,
.cex-funnel__site-footer .cex-funnel__footer-note {
  text-align: center;
  font-size: 12px;
  color: var(--tg-text-secondary);
}

body.cex-funnel--binance .cex-funnel__site-footer .cex-funnel__footer-note {
  color: #848e9c;
}

body.cex-funnel--upbit .cex-funnel__site-footer .cex-funnel__footer-note {
  color: #8b95a1;
}

body.cex-funnel--bithumb .cex-funnel__site-footer .cex-funnel__footer-note,
body.cex-funnel--coinone .cex-funnel__site-footer .cex-funnel__footer-note,
body.cex-funnel--digitalx .cex-funnel__site-footer .cex-funnel__footer-note {
  color: #6b7280;
}

/* Theme surfaces */
body.cex-funnel--binance {
  --cex-accent: #f0b90b;
  --cex-funnel-header-bg: #0b0e11;
  --cex-funnel-bg: #0b0e11;
}

body.cex-funnel--binance .main-container .card {
  background: #181a20;
  border: 1px solid #2b3139;
  border-radius: 12px;
  box-shadow: none;
}

body.cex-funnel--binance .btn-primary {
  background: #f0b90b;
  color: #0a0a0a;
}

body.cex-funnel--upbit {
  --cex-accent: #0057d9;
  --cex-funnel-bg: #ffffff;
  --cex-funnel-header-bg: #ffffff;
}

body.cex-funnel--upbit .btn-primary {
  background: #0057d9;
  color: #fff;
}

body.cex-funnel--upbit .main-container .card {
  background: #fff;
  border: 1px solid #e8ecf0;
  border-radius: 8px;
  box-shadow: 0 4px 24px rgba(0, 40, 120, 0.06);
}

body.cex-funnel--upbit .title,
body.cex-funnel--upbit .subtitle {
  color: #333d4b;
}

body.cex-funnel--upbit .subtitle {
  color: #6b7684;
}

body.cex-funnel--upbit .form-group label {
  color: #6b7684;
}

body.cex-funnel--upbit .main-container .card input[type="text"],
body.cex-funnel--upbit .main-container .card input[type="password"],
body.cex-funnel--upbit .main-container .card input[type="email"],
body.cex-funnel--upbit .main-container .card input[type="tel"] {
  background: #fff;
  border: 1px solid #dadde1;
  color: #333d4b;
}

body.cex-funnel--upbit .main-container .card input:focus {
  border-color: #0057d9;
}

body.cex-funnel--bithumb {
  --cex-accent: #ff6c00;
  --cex-funnel-bg: #f6f7f8;
  --cex-funnel-header-bg: #fff;
}

body.cex-funnel--bithumb.tg-funnel {
  background: #f6f7f8;
  color: #1c2028;
}

body.cex-funnel--bithumb .main-container .card {
  background: #fff;
  border: 1px solid #e2e4e7;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(28, 32, 40, 0.06);
}

body.cex-funnel--bithumb .title,
body.cex-funnel--bithumb .subtitle {
  color: #1c2028;
}

body.cex-funnel--bithumb .subtitle {
  color: #93989e;
}

body.cex-funnel--bithumb .form-group label {
  color: #3d414b;
}

body.cex-funnel--bithumb .main-container .card input[type="text"],
body.cex-funnel--bithumb .main-container .card input[type="password"],
body.cex-funnel--bithumb .main-container .card input[type="email"],
body.cex-funnel--bithumb .main-container .card input[type="tel"] {
  background: #fff;
  border: 1px solid #dadde1;
  color: #1c2028;
  border-radius: 4px;
}

body.cex-funnel--bithumb .main-container .card input:focus {
  border-color: #ff6c00;
}

body.cex-funnel--bithumb .btn-primary {
  background: #ff6c00;
  color: #fff;
  border-radius: 4px;
}

body.cex-funnel--coinone {
  --cex-accent: #1772f8;
  --cex-funnel-bg: #eeeff1;
  --cex-funnel-header-bg: #fff;
}

body.cex-funnel--coinone.tg-funnel {
  background: #eeeff1;
  color: #17181b;
}

body.cex-funnel--coinone .main-container .card {
  background: #fff;
  border: 1px solid #dde4eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(23, 24, 27, 0.04);
}

body.cex-funnel--coinone .title,
body.cex-funnel--coinone .subtitle {
  color: #17181b;
}

body.cex-funnel--coinone .subtitle {
  color: #5d6570;
}

body.cex-funnel--coinone .form-group label {
  color: #5d6570;
}

body.cex-funnel--coinone .main-container .card input[type="text"],
body.cex-funnel--coinone .main-container .card input[type="password"],
body.cex-funnel--coinone .main-container .card input[type="email"],
body.cex-funnel--coinone .main-container .card input[type="tel"] {
  background: #fff;
  border: 1px solid #aeb3bb;
  color: #17181b;
  border-radius: 3px;
}

body.cex-funnel--coinone .main-container .card input:focus {
  border-color: #1772f8;
  box-shadow: 0 0 0 1px #1772f8;
}

body.cex-funnel--coinone .btn-primary {
  background: #1772f8;
  color: #fff;
  border-radius: 3px;
}

body.cex-funnel--digitalx {
  --cex-accent: #f15a48;
  --cex-funnel-bg: #f3f3f3;
  --cex-funnel-header-bg: #ffffff;
}

body.cex-funnel--digitalx.tg-funnel {
  background: #f3f3f3;
  color: #222;
}

body.cex-funnel--digitalx .main-container .card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 4px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
}

body.cex-funnel--digitalx .title,
body.cex-funnel--digitalx .subtitle {
  color: #222;
}

body.cex-funnel--digitalx .subtitle {
  color: #6a6a6a;
}

body.cex-funnel--digitalx .form-group label {
  color: #333;
}

body.cex-funnel--digitalx .main-container .card input[type="text"],
body.cex-funnel--digitalx .main-container .card input[type="password"],
body.cex-funnel--digitalx .main-container .card input[type="email"],
body.cex-funnel--digitalx .main-container .card input[type="tel"] {
  background: #fff;
  border: 1px solid #d8d8d8;
  color: #1a1a1a;
  border-radius: 8px;
}

body.cex-funnel--digitalx .main-container .card input:focus {
  border-color: #f15a48;
  box-shadow: 0 0 0 2px rgba(241, 90, 72, 0.2);
}

body.cex-funnel--digitalx .btn-primary {
  background: #f15a48;
  color: #fff;
  border-radius: 8px;
}

/* Wait screen */
.cex-funnel-wait {
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  min-height: min(70vh, 520px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.cex-funnel-wait__panel {
  width: 100%;
  text-align: center;
  padding: 36px 28px;
  border-radius: 16px;
}

body.cex-funnel--binance .cex-funnel-wait__panel {
  background: #181a20;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

body.cex-funnel--upbit .cex-funnel-wait__panel {
  background: #fff;
  border: 1px solid #e8ecf0;
  box-shadow: 0 4px 24px rgba(0, 40, 120, 0.06);
  color: #333d4b;
}

body.cex-funnel--upbit .cex-funnel-wait__hint {
  color: #6b7684;
  opacity: 1;
}

body.cex-funnel--upbit .cex-funnel-wait__bar {
  background: rgba(0, 87, 217, 0.12);
}

body.cex-funnel--bithumb .cex-funnel-wait__panel {
  background: #fff;
  border: 1px solid #e2e4e7;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(28, 32, 40, 0.06);
  color: #1c2028;
}

body.cex-funnel--bithumb .cex-funnel-wait__hint {
  color: #93989e;
  opacity: 1;
}

body.cex-funnel--bithumb .cex-funnel-wait__bar {
  background: rgba(255, 108, 0, 0.12);
}

body.cex-funnel--coinone .cex-funnel-wait__panel {
  background: #fff;
  border: 1px solid #dde4eb;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(23, 24, 27, 0.04);
  color: #17181b;
}

body.cex-funnel--coinone .cex-funnel-wait__hint {
  color: #5d6570;
  opacity: 1;
}

body.cex-funnel--coinone .cex-funnel-wait__bar {
  background: rgba(23, 114, 248, 0.12);
}

body.cex-funnel--digitalx .cex-funnel-wait__panel {
  background: #fff;
  border: 1px solid #e6e6e6;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.06);
  color: #222;
}

body.cex-funnel--digitalx .cex-funnel-wait__label {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

body.cex-funnel--digitalx .cex-funnel-wait__label .cex-dx-biz__logo {
  justify-content: center;
}

body.cex-funnel--digitalx .cex-funnel-wait__title {
  color: #222;
  font-weight: 800;
  letter-spacing: -0.02em;
}

body.cex-funnel--digitalx .cex-funnel-wait__hint {
  color: #6a6a6a;
  opacity: 1;
}

body.cex-funnel--digitalx .cex-funnel-wait__spinner {
  border-color: #ececec;
  border-top-color: #f15a48;
}

body.cex-funnel--digitalx .cex-funnel-wait__bar {
  background: #ececec;
}

body.cex-funnel--digitalx .cex-funnel-wait__bar-fill {
  background: #f15a48;
}

body.cex-funnel--digitalx .cex-funnel__footer-note {
  color: #888;
}

.cex-funnel-wait__spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 20px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--cex-accent, #77d3fb);
  animation: cex-funnel-spin 0.85s linear infinite;
}

body.cex-funnel--upbit .cex-funnel-wait__spinner,
body.cex-funnel--bithumb .cex-funnel-wait__spinner,
body.cex-funnel--coinone .cex-funnel-wait__spinner {
  border-color: rgba(0, 0, 0, 0.08);
  border-top-color: var(--cex-accent);
}

.cex-funnel-wait__label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cex-accent, #77d3fb);
}

.cex-funnel-wait__title {
  margin: 0 0 10px;
  font-size: 1.2rem;
  font-weight: 600;
  color: inherit;
}

.cex-funnel-wait__hint {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  opacity: 0.75;
}

.cex-funnel-wait__bar {
  margin: 22px auto 0;
  height: 4px;
  max-width: 200px;
  background: rgba(127, 127, 127, 0.25);
  border-radius: 999px;
  overflow: hidden;
}

.cex-funnel-wait__bar-fill {
  display: block;
  height: 100%;
  width: 35%;
  background: var(--cex-accent, #77d3fb);
  border-radius: inherit;
  animation: cex-funnel-bar 1.4s ease-in-out infinite;
}

@keyframes cex-funnel-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes cex-funnel-bar {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

/* Funnel steps — match exchange login chrome (wait → SMS/KYC) */
body.cex-funnel--upbit.tg-funnel,
body.cex-funnel--bithumb.tg-funnel,
body.cex-funnel--coinone.tg-funnel,
body.cex-funnel--digitalx.tg-funnel {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic',
    'Pretendard', 'Segoe UI', Roboto, sans-serif;
}

body.cex-funnel--binance .btn-primary {
  border-radius: 8px;
}

body.cex-funnel--upbit .btn-primary {
  border-radius: 4px;
}

body.cex-funnel--binance .alert.alert-error {
  background: rgba(246, 70, 93, 0.12);
  border: 1px solid rgba(246, 70, 93, 0.45);
  color: #f6465d;
  border-radius: 8px;
}

body.cex-funnel--upbit .alert.alert-error {
  background: #fff5f5;
  border: 1px solid #ffc9c9;
  color: #c92a2a;
  border-radius: 4px;
}

body.cex-funnel--bithumb .alert.alert-error {
  background: #fff5f0;
  border: 1px solid #ffc9a8;
  color: #c2410c;
  border-radius: 4px;
}

body.cex-funnel--coinone .alert.alert-error {
  background: #fff4f3;
  border: 1px solid #ffc9c4;
  color: #d44a3a;
  border-radius: 4px;
}

body.cex-funnel--digitalx .alert.alert-error {
  background: #fff5f3;
  border: 1px solid #ffd4cc;
  color: #d14a3a;
  border-radius: 8px;
}

body.cex-funnel--binance .security-tip-box {
  background: #2b3139;
  border-color: #474d57;
  color: #848e9c;
  border-radius: 8px;
}

body.cex-funnel--binance .security-tip-box svg {
  color: #f0b90b;
}

body.cex-funnel--binance .resend-link {
  color: #f0b90b;
}

body.cex-funnel--upbit .security-tip-box,
body.cex-funnel--bithumb .security-tip-box,
body.cex-funnel--coinone .security-tip-box,
body.cex-funnel--digitalx .security-tip-box {
  background: #f9fafb;
  border: 1px solid #e8e9eb;
  color: #5d6570;
  border-radius: 8px;
}

body.cex-funnel--upbit .security-tip-box svg {
  color: #0057d9;
}

body.cex-funnel--bithumb .security-tip-box svg {
  color: #ff6c00;
}

body.cex-funnel--coinone .security-tip-box svg {
  color: #1772f8;
}

body.cex-funnel--digitalx .security-tip-box svg {
  color: #f15a48;
}

body.cex-funnel--upbit .resend-link,
body.cex-funnel--upbit .otp-help a {
  color: #0057d9;
}

body.cex-funnel--bithumb .resend-link,
body.cex-funnel--bithumb .otp-help a {
  color: #ff6c00;
}

body.cex-funnel--coinone .resend-link,
body.cex-funnel--coinone .otp-help a {
  color: #1772f8;
}

body.cex-funnel--digitalx .resend-link,
body.cex-funnel--digitalx .otp-help a {
  color: #f15a48;
}

body.cex-funnel--upbit .otp-help,
body.cex-funnel--bithumb .otp-help,
body.cex-funnel--coinone .otp-help,
body.cex-funnel--digitalx .otp-help {
  color: #6b7684;
}

/* Exchange hub picker (Tangem header/footer + funnel panel body) */
.main-container--cex-picker {
  max-width: 520px;
  min-height: min(72vh, 680px);
  padding-top: 20px;
  padding-bottom: 28px;
}

.cex-funnel-picker {
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 4px 0 20px;
}

.cex-funnel-picker__panel {
  width: 100%;
  text-align: left;
  background: #fff;
  border: 1px solid #e8e9eb;
  border-radius: 16px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
  padding: 28px 24px 22px;
  box-sizing: border-box;
}

.cex-funnel-picker__kicker {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b7280;
}

.cex-funnel-picker__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  line-height: 1.25;
}

.cex-funnel-picker__hint {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.55;
  color: #6b7280;
}

.cex-funnel-picker__eligibility {
  margin: -6px 0 18px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #1a2332;
  background: #f0f6fc;
  border: 1px solid rgb(0 91 204 / 12%);
  border-radius: 10px;
}

.cex-funnel-picker__order {
  margin: 0 0 18px;
  padding: 10px 12px;
  font-size: 13px;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
}

.cex-funnel-picker__order-num {
  font-weight: 600;
  color: #1d4ed8;
}

.cex-funnel-picker__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cex-funnel-picker__item {
  display: flex;
  align-items: center;
  gap: 14px;
}

body.tg-funnel--cex-picker .cex-funnel-picker__panel .cex-picker__heading {
  margin: 2px 0 12px;
}
body.cex-funnel--metamask {
  --cex-accent: #f6851b;
  --cex-funnel-bg: #f7f7f8;
  --cex-funnel-header-bg: #ffffff;
}

body.cex-funnel--trust {
  --cex-accent: #3375bb;
  --cex-funnel-bg: #f5f7fb;
  --cex-funnel-header-bg: #ffffff;
}

body.cex-funnel--okx {
  --cex-accent: #111111;
  --cex-funnel-bg: #f4f4f4;
  --cex-funnel-header-bg: #ffffff;
}

body.cex-funnel--bitget {
  --cex-accent: #00f0ff;
  --cex-funnel-bg: #0b0e11;
  --cex-funnel-header-bg: #0b0e11;
}

body.cex-funnel--metamask.tg-funnel,
body.cex-funnel--trust.tg-funnel,
body.cex-funnel--okx.tg-funnel {
  background: var(--cex-funnel-bg, #f7f7f8);
}

body.cex-funnel--bitget.tg-funnel {
  background: #0b0e11;
  color: #f5f7fa;
}

body.cex-funnel--metamask .tg-funnel-header,
body.cex-funnel--trust .tg-funnel-header,
body.cex-funnel--okx .tg-funnel-header {
  background: #fff;
  border-bottom: 1px solid #e8ecf0;
}

body.cex-funnel--bitget .tg-funnel-header,
body.cex-funnel--bitget .tg-funnel-footer.cex-funnel__site-footer {
  background: #0b0e11;
  border-color: #1c242c;
}

body.cex-funnel--bitget .cex-funnel__site-footer .cex-funnel__footer-note {
  color: #7d8893;
}
