/* ============================================================
   Регистрация внутри Mini App (онбординг).
   Экраны: welcome → register → checking → deposit → unlocked.
   ============================================================ */
.onb {
  position: fixed;
  z-index: 90;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
  color: var(--text);
}
.onb[hidden] { display: none; }
.is-onboarding-preview .onb__screen { padding-bottom: 130px; }
.onb-preview { position: fixed; z-index: 120; bottom: 0; left: 0; right: 0; padding: 9px 12px max(9px, var(--safe-bottom)); border-top: 1px solid #22d3b6; background: #101a2a; color: #e3edf9; display: grid; gap: 6px; font: 12px/1.3 system-ui, sans-serif; }
.onb-preview__controls { display: flex; gap: 7px; }
.onb-preview select, .onb-preview button { min-height: 40px; min-width: 0; padding: 7px 10px; border-radius: 9px; border: 1px solid #34455e; background: #182338; color: #e3edf9; font: inherit; }
.onb-preview select { flex: 1; width: 0; }
.onb-preview__note { color: #a7b9cc; font-size: 11px; }

.onb__screen {
  min-height: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: max(20px, calc(var(--safe-top) + 10px)) 18px max(24px, calc(var(--safe-bottom) + 14px));
  animation: onbIn .28s ease-out;
}
.onb__screen[hidden] { display: none; }
@keyframes onbIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.onb__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.onb__top .onb__chip { min-width: 0; text-align: center; }
.onb__top .onb__lang, .onb__top .onb__back { flex-shrink: 0; }
.onb__brand { display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.onb__brand .brand__mark { width: 34px; height: 34px; }
.onb__lang {
  height: 32px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-soft); font-size: 12px; font-weight: 700; cursor: pointer;
}
.onb__back {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 11px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-soft);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.onb__back svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.onb__steps { flex-grow: 1; display: flex; flex-direction: column; gap: 6px; }
.onb__steps-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.onb__bar { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.onb__bar span { height: 4px; border-radius: 4px; background: var(--surface-3); }
.onb__bar span.is-on { background: var(--accent); }

.onb__hero { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.onb__chip {
  align-self: flex-start; padding: 5px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.onb__title { margin: 0; font-size: 28px; line-height: 1.14; font-weight: 800; letter-spacing: -.02em; }
.onb__text { margin: 0; color: var(--text-soft); font-size: 14px; line-height: 1.5; }

.onb__stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.onb__stat { background: var(--surface); border: 1px solid #1d2940; border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 4px; }
.onb__stat strong { font-size: 22px; font-weight: 800; }
.onb__stat span { color: var(--text-soft); font-size: 12px; }

.onb__box { background: var(--bg-elevated); border: 1px solid #1d2940; border-radius: 18px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.onb__box--card { background: var(--surface); gap: 14px; }
.onb__box-label { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.onb__step { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.onb__num { width: 26px; height: 26px; flex-shrink: 0; border-radius: 8px; background: var(--surface-2); color: var(--accent); font-size: 12px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.onb__item { display: flex; gap: 12px; align-items: flex-start; }
.onb__item-ic { width: 32px; height: 32px; flex-shrink: 0; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.onb__item-ic svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.onb__item strong { display: block; font-size: 14px; }
.onb__item span { color: var(--text-soft); font-size: 13px; }

.onb__warn { display: flex; gap: 10px; align-items: flex-start; background: rgba(245,196,81,.08); border: 1px solid rgba(245,196,81,.25); border-radius: 14px; padding: 12px 14px; color: #f2dca3; font-size: 13px; line-height: 1.45; }
.onb__warn svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; stroke: var(--vip); stroke-width: 2; fill: none; stroke-linecap: round; }
.onb__ok { display: flex; align-items: center; gap: 10px; background: rgba(32,201,120,.1); border: 1px solid rgba(32,201,120,.3); border-radius: 14px; padding: 11px 14px; font-size: 14px; color: #c9f3dd; }
.onb__ok svg { width: 20px; height: 20px; flex-shrink: 0; stroke: var(--buy); stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.onb__ok strong { color: var(--text); }

.onb__spacer { flex-grow: 1; }
.onb__actions { display: flex; flex-direction: column; gap: 10px; }
.onb__btn {
  height: 52px; border: 0; border-radius: 16px; cursor: pointer;
  background: var(--accent); color: #04211c;
  font-size: 16px; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.onb__btn:active { transform: scale(.985); }
.onb__btn svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.onb__btn--ghost { height: 48px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 15px; font-weight: 700; }
.onb__link { height: 44px; border: 0; background: none; color: var(--text-soft); font-size: 14px; font-weight: 600; cursor: pointer; }
.onb__note { text-align: center; color: var(--muted); font-size: 12px; }

.onb__center { flex-grow: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; text-align: center; }
.onb__center .onb__title { font-size: 25px; }
.onb__center .onb__text { max-width: 320px; }
.onb__spin { position: relative; width: 112px; height: 112px; display: flex; align-items: center; justify-content: center; }
.onb__spin::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: onbSpin 1.1s linear infinite; }
.onb__spin-ic, .onb__unlock { width: 70px; height: 70px; border-radius: 22px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; }
.onb__spin-ic svg { width: 32px; height: 32px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.onb__unlock { width: 96px; height: 96px; border-radius: 30px; border: 1px solid rgba(34,211,182,.35); }
.onb__unlock svg { width: 44px; height: 44px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
@keyframes onbSpin { to { transform: rotate(360deg); } }
.onb__pill { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid #1d2940; color: var(--muted); font-size: 12px; }
.onb__pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: onbPulse 1.4s ease-in-out infinite; }
@keyframes onbPulse { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.onb__progress-head { display: flex; justify-content: space-between; align-items: baseline; }
.onb__progress-head span { color: var(--muted); font-size: 12px; font-weight: 600; }
.onb__progress-head b { font-size: 13px; color: var(--text-soft); font-weight: 500; }
.onb__progress-head b strong { font-size: 20px; color: var(--text); font-weight: 800; }
.onb__track { height: 8px; border-radius: 8px; background: var(--surface-3); overflow: hidden; }
.onb__track div { height: 100%; width: 0; background: var(--accent); border-radius: 8px; transition: width .5s ease; }

.onb__tiers { padding: 6px 14px; gap: 0; }
.onb__tiers .onb__box-label { padding: 10px 0 6px; }
.onb__tier { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; border-top: 1px solid #172238; font-size: 13px; }
.onb__tier b { font-weight: 700; }
.onb__tier span { color: var(--text-soft); }
.onb__tier.is-start b { color: var(--accent); }
.onb__tier.is-vip b { color: var(--vip); }

.onb__grid2 { width: 100%; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.onb__grid2 .onb__stat { text-align: left; }
.onb__grid2 .onb__stat strong { font-size: 20px; }
.onb__accent { color: var(--accent); }

.onb__guide-links { display: grid; gap: 8px; }
.onb__guide-topics { display: flex; flex-wrap: wrap; gap: 7px; }
.onb__guide-tab { border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; background: var(--surface); color: var(--text-soft); font: inherit; font-size: 12px; cursor: pointer; }
.onb__guide-tab[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.onb__guide-card { gap: 12px; }
.onb__guide-card h2 { margin: 0; font-size: 20px; line-height: 1.3; }
.onb__guide-card figure { margin: 0; }
.onb__guide-card img { display: block; width: 100%; max-height: 290px; object-fit: contain; border-radius: 9px; background: var(--bg); }
.onb__guide-card figcaption { margin-top: 8px; color: var(--muted); font-size: 11px; }
.onb__guide-card .onb__link { height: auto; min-height: 32px; text-align: left; color: var(--accent); }
.onb__guide-source { color: var(--text-soft); font-size: 12px; text-underline-offset: 3px; }
.onb__register-guide { gap: 10px; }
.onb__register-guide img { max-height: 210px; }
.onb__register-guide h2 { font-size: 17px; }
.onb__embedded-guide img { max-height: 240px; }
.onb__embedded-guide h3 { margin: 0; font-size: 16px; line-height: 1.3; }
.onb__register-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.onb__register-head .onb__link { font-size: 11px; min-height: 28px; }
.onb__register-navigation { display: flex; justify-content: space-between; gap: 12px; }
.onb__register-navigation button { border: 1px solid var(--border); border-radius: 8px; min-height: 36px; padding: 6px 14px; background: var(--surface); color: var(--text-soft); font: inherit; font-size: 12px; cursor: pointer; }
.onb__guide-navigation { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; margin-top: auto; padding-top: 10px; }
.onb__guide-zoom { width: min(96vw, 1200px); max-width: 96vw; padding: 12px; border: 1px solid var(--border); border-radius: 15px; background: var(--bg); color: var(--text); }
.onb__guide-zoom::backdrop { background: rgba(0,0,0,.8); }
.onb__guide-zoom button { display: block; margin: 0 0 12px auto; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); min-height: 40px; padding: 0 15px; cursor: pointer; }
.onb__guide-zoom-scroll { overflow: auto; max-height: 75dvh; }
.onb__guide-zoom img { display: block; width: auto; max-width: none; height: auto; }

.onb__trial-pairs { display: grid; gap: 10px; }
.onb__trial-pair { justify-content: space-between; padding: 0 18px; text-align: left; }
.onb__trial-direction { font-size: 34px; line-height: 1.2; font-weight: 800; color: var(--accent); }
.onb__trial-direction.is-down { color: var(--sell); }
.onb__trial-time { display: flex; align-items: center; justify-content: space-between; }
.onb__more { padding: 12px 0; }
.onb__more summary { cursor: pointer; color: var(--text-soft); font-size: 13px; }
.onb__btn { flex-shrink: 0; min-height: 48px; height: auto; padding: 10px 14px; font-size: 15px; line-height: 1.3; text-align: center; }
.onb__link { min-height: 40px; height: auto; padding: 8px 6px; line-height: 1.4; }
.onb__text, .onb__note { line-height: 1.45; }
#onbTrialStatus { margin: 0; }
.onb__embedded-guide { gap: 10px; }
.onb__embedded-guide h2 { font-size: 18px; }
.onb__embedded-guide [data-inline-part="note"] { font-size: 12px; }
.onb__embedded-guide[data-inline-guide="deposit"] [data-inline-part="note"] { display: none; }
.onb__activation { border-color: rgba(34,211,182,.35); background: linear-gradient(135deg, rgba(34,211,182,.09), var(--surface)); gap: 14px; }
.onb__activation-main { display: flex; align-items: center; gap: 12px; }
.onb__activation-main > strong { color: var(--accent); font-size: 46px; line-height: 1; font-weight: 800; }
.onb__activation-main > div { display: grid; gap: 3px; }
.onb__activation-main b { font-size: 17px; }
.onb__activation-main div span { color: var(--text-soft); font-size: 13px; }
.onb__activation-tier { margin-left: auto; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .06em; }
.onb__activation-tools { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--text-soft); font-size: 12px; }
.onb__activation-tools span::before { content: '✓'; margin-right: 6px; color: var(--accent); }
.onb__activation-note { margin: 0; padding-top: 10px; border-top: 1px solid rgba(34,211,182,.16); color: var(--text-soft); font-size: 12px; line-height: 1.45; }
@media (max-width: 480px) {
  .onb__title { font-size: 26px; }
  .onb__top { gap: 8px; }
  .onb__top .onb__chip { font-size: 10px; letter-spacing: .02em; }
  .onb__box { padding: 14px; }
  .onb__register-guide img { max-height: 180px; }
  .onb__embedded-guide img { max-height: 200px; }
  .onb__register-guide h2 { font-size: 16px; }
}
.onb__back { width: auto; min-width: 36px; padding: 0 10px; font-size: 12px; }
.onb button:disabled { opacity: .55; cursor: wait; }
.onb [hidden] { display: none !important; }
.onb button:focus-visible, .onb summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .onb *, .onb *::before { animation: none !important; transition: none !important; } }
/* Binodex-бот (класс ставит backend/branding.py): инструкции с картинками — от Pocket Option, прячем. */
.platform-binodex [data-onb-guide], .platform-binodex .onb__embedded-guide, .platform-binodex .onb__register-guide { display: none !important; }

/* Регистрация прямо в приложении (Partners API) */
.onb__form { gap: 14px; }
.onb__field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.onb__field input { width: 100%; min-height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 16px; box-sizing: border-box; }
.onb__field input:focus { outline: 2px solid var(--accent, #3b82f6); outline-offset: 1px; }
.onb__pass { position: relative; display: block; }
.onb__pass input { padding-right: 84px; }
.onb__pass .onb__link { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.onb__check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: var(--text); }
.onb__check input { width: 20px; height: 20px; margin: 0; flex-shrink: 0; }
.onb__error { margin: 0; color: #ff8a8a; font-size: 13px; line-height: 1.45; }
.onb__form .onb__btn[disabled] { opacity: .6; }

/* Платный доступ без нового аккаунта (экран «У меня уже есть счёт») */
.onb__paid h2 { margin: 0; font-size: 18px; }
.onb__paid-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.onb__paid-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; }
.onb__paid-list b { color: var(--text); }
.onb__paid-list span { color: var(--muted); }
.onb__paid-list li > span:first-child { display: grid; gap: 2px; }
.onb__paid-list li > span:last-child { white-space: nowrap; color: var(--text); font-weight: 700; }

/* Ошибки формы бывают с пошаговой инструкцией в несколько строк. */
#onbApiError { white-space: pre-line; }

/* Касса Binodex поверх экрана пополнения. */
.onb-pay { position: fixed; inset: 0; z-index: 1000; overflow-y: auto; padding: 16px 16px 32px;
  background: var(--bg); display: flex; flex-direction: column; gap: 12px; }
.onb-pay__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.onb-pay__head b { font-size: 18px; }
.onb-pay__status { margin: 0; color: #8a96ad; }
.onb-pay__status:empty { display: none; }
.onb-pay iframe { width: 100%; height: 640px; border: 0; background: transparent; display: block; }
.onb-pay iframe[hidden] { display: none; }
