/* =========================================================================
   M-Belarusbank — имитация интерфейса
   Приложение занимает весь экран телефона и не рисует ничего «от системы»:
   ни часов, ни заряда, ни «острова» — это делает сам телефон.
   Базовый макет: 393 × 852 pt, масштабируется целиком.
   ========================================================================= */

:root {
  --bg:        #1c1c1e;   /* фон приложения            */
  --panel:     #252527;   /* тёмные карточки-секции    */
  --panel-2:   #2b2d31;   /* плитки внутри секций      */
  --txt:       #ffffff;
  --txt-soft:  #e9ebef;
  --label:     #8d8d92;
  --green:     #22c55e;   /* акцент                    */
  --green-lit: #2fd06a;   /* акцент поярче            */
  --red:       #ff4b3e;
  --r-panel:   22px;

  /* отступы под вырез/жесты конкретного телефона */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #0a0a0b;
}

/* Приложение не скроллит страницу: на телефоне адресная строка и «прыжки»
   при фокусе в поле ввода ломали бы ощущение отдельного приложения. */
body {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable",
               "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--txt);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  user-select: none;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------------------------------------------------------------- каркас -- */
.stage { width: 100vw; height: 100vh; display: grid; place-items: center; overflow: hidden; }

.frame {
  position: relative;
  width: 393px;
  height: 852px;
  transform-origin: center center;
    /* масштаб задаётся из JS */
}

.app {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--bg);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
}

/* На телефоне приложение занимает весь экран: без рамки, без масштабирования,
   без пустых полос по краям — как обычное приложение.
   Высоту берём от вьюпорта (100%), а не от 100dvh: на iPhone dvh не учитывает
   панель Safari, из-за чего снизу оставалась чёрная полоса. */
html.is-phone { background: var(--bg); }
body.is-phone { background: var(--bg); }
body.is-phone .stage,
body.is-phone .frame {
  width: 100%;
  height: 100%;
}
body.is-phone .frame { transform: none !important; }
body.is-phone .app { border-radius: 0; box-shadow: none; }

/* --------------------------------------------------------------- экраны -- */
.screen {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity .32s ease;
  z-index: 10;
}
.screen.is-active { opacity: 1; visibility: visible; }

/* Заглушка, чтобы taps не проваливались в неактивные экраны */
.screen:not(.is-active) { pointer-events: none; }

/* ============================================================ 1. SPLASH == */
.screen--splash {
  z-index: 40;
  background: var(--bg);
  display: grid;
  place-items: center;
}

.splash { display: grid; justify-items: center; gap: 18px; margin-top: -30px; }

.logo-tile {
  width: 106px; height: 106px;
  border-radius: 25px;
  background: #262626;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #35d16a;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .55), inset 0 0 0 1px rgba(255, 255, 255, .04);
  animation: logoIn .7s cubic-bezier(.2, .8, .2, 1) both;
}
.logo-tile img { width: 100%; height: 100%; display: block; object-fit: cover; }
.logo-tile .face-svg { width: 62px; height: 62px; }

.splash-title {
  margin: 0;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: .2px;
  color: #fff;
  animation: fadeUp .6s .12s ease both;
}

.splash-loader {
  position: absolute;
  bottom: 74px; left: 50%;
  transform: translateX(-50%);
  display: flex; gap: 7px;
}
.splash-loader i {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, .22);
  animation: dotPulse 1.2s infinite;
}
.splash-loader i:nth-child(2) { animation-delay: .18s; }
.splash-loader i:nth-child(3) { animation-delay: .36s; }

@keyframes logoIn {
  from { opacity: 0; transform: scale(.86); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
@keyframes dotPulse {
  0%, 100% { opacity: .25; transform: scale(.85); }
  50%      { opacity: 1;   transform: scale(1); }
}

/* ============================================================= 2. FACE ID == */
.screen--face {
  z-index: 45;
  background: var(--bg);
  display: grid;
  place-items: center;
  grid-template-rows: 1fr auto;
  padding-bottom: 120px;
}

.face-stage {
  position: relative;
  width: 190px; height: 190px;
  display: grid; place-items: center;
  align-self: end;
  margin-bottom: 34px;
}

.face-logo {
  position: relative;
  width: 156px; height: 156px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: #35d16a;
  overflow: hidden;
  transition: opacity .3s ease, transform .3s ease;
}
.face-logo .face-svg { width: 92px; height: 92px; animation: facePulse 2s ease-in-out infinite; }
.face-logo::after {
  content: "";
  position: absolute; inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(53, 209, 106, .18);
}

@keyframes facePulse {
  0%, 100% { opacity: .82; }
  50%      { opacity: 1; }
}

/* пробегающая полоса «сканирования» */
.face-scanline {
  position: absolute;
  left: 18%; right: 18%;
  height: 26px;
  background: linear-gradient(180deg, rgba(53, 209, 106, 0), rgba(53, 209, 106, .30), rgba(53, 209, 106, 0));
  top: -26px;
  animation: scanSweep 1.9s ease-in-out infinite;
  filter: blur(6px);
  opacity: .75;
}
@keyframes scanSweep {
  0%   { top: -26px; opacity: 0; }
  20%  { opacity: .75; }
  80%  { opacity: .75; }
  100% { top: 156px; opacity: 0; }
}

/* кольцо проверки */
.ring {
  position: absolute;
  width: 158px; height: 158px;
  border-radius: 50%;
  opacity: 0;
  transform: scale(.92);
  transition: opacity .25s ease, transform .35s ease;
  background: conic-gradient(from 0deg,
      rgba(53, 209, 106, 0) 0deg,
      rgba(53, 209, 106, .15) 90deg,
      #45e07f 200deg,
      rgba(53, 209, 106, .1) 300deg,
      rgba(53, 209, 106, 0) 360deg);
  -webkit-mask: radial-gradient(circle, transparent 62%, #000 63.5%, #000 100%);
          mask: radial-gradient(circle, transparent 62%, #000 63.5%, #000 100%);
  filter: drop-shadow(0 0 16px rgba(53, 209, 106, .55));
  animation: spin 1.15s linear infinite;
}
.ring.is-on { opacity: 1; transform: scale(1); }

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

/* галочка успеха */
.check {
  position: absolute;
  width: 92px; height: 92px;
  border-radius: 50%;
  background: #35d16a;
  color: #0a2412;
  display: grid; place-items: center;
  opacity: 0; transform: scale(.7);
  transition: opacity .22s ease, transform .3s cubic-bezier(.2, 1.3, .4, 1);
}
.check.is-on { opacity: 1; transform: scale(1); }

.face-caption { text-align: center; padding-bottom: 40px; }
.face-caption h2 {
  margin: 0 0 8px;
  font-size: 20px; font-weight: 600; letter-spacing: .2px;
}
.face-caption p {
  margin: 0;
  font-size: 15px;
  color: var(--label);
  transition: color .2s ease;
}

.face-skip {
  position: absolute;
  bottom: 62px; left: 50%;
  transform: translateX(-50%);
  font-size: 14px;
  color: rgba(255, 255, 255, .38);
  padding: 12px 18px;
}
.face-skip:active { color: rgba(255, 255, 255, .7); }

/* =============================================================== 3. HOME == */
.screen--home { z-index: 20; }

.hero {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 660px;
  overflow: hidden;
  z-index: 0;
}
.hero-blur {
  position: absolute;
  inset: -60px;
  background: url("assets/card.png") center top / 150% no-repeat;
  filter: blur(34px) saturate(1.15);
  opacity: .95;
}
.hero-fade {
  position: absolute; inset: 0;
  background: linear-gradient(180deg,
      rgba(232, 235, 241, .94) 0%,
      rgba(231, 234, 239, .93) 20%,
      rgba(229, 232, 237, .91) 36%,
      rgba(214, 217, 222, .88) 50%,
      rgba(150, 152, 156, .84) 62%,
      rgba(46, 46, 49, .93) 74%,
      var(--bg) 84%);
}

.appbar {
  position: absolute;
  top: calc(var(--sat) + 10px); left: 0; right: 0;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}
.appbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.2px;
  color: #101012;
}
.icon-btn { position: relative; display: grid; place-items: center; }
.mail-btn {
  position: absolute;
  right: 18px;
  color: #141416;
}
.badge {
  position: absolute;
  top: -7px; right: -9px;
  min-width: 19px; height: 19px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  display: grid; place-items: center;
  line-height: 1;
}

.scroll {
  position: absolute;
  top: calc(var(--sat) + 56px); left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  z-index: 20;
  padding-bottom: calc(78px + var(--sab));
  scrollbar-width: none;
}
.scroll::-webkit-scrollbar { width: 0; height: 0; }

.row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 0;
  height: 30px;
}
.row-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.3px;
  color: #121214;
}
.link-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 17px;
  color: var(--green);
  letter-spacing: -.1px;
}
.link-all svg { transform: translateY(.5px); opacity: .95; }

/* карта */
.card-view { margin: 22px 16px 0; }
.card-view img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 18px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .38), 0 2px 8px rgba(0, 0, 0, .18);
}

.dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 22px;
}
.dots i {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(28, 28, 30, .28);
}
.dots i.on { background: #1c1c1e; }

/* тёмные секции */
.panel {
  margin: 16px 16px 0;
  background: var(--panel);
  border-radius: var(--r-panel);
  padding: 8px 20px 12px;
  overflow: hidden;
}
.panel + .panel { margin-top: 9px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 26px;
}
.panel-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.2px;
  color: #fff;
}

/* круглые кнопки платежей */
.quick-row {
  display: flex;
  gap: 24px;
  margin: 23px 0 0;
  margin-right: -20px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  /* правый край плавно уходит в тень — видно, что ряд можно листать */
  -webkit-mask-image: linear-gradient(90deg, #000 0, #000 88%, rgba(0, 0, 0, .15) 100%);
          mask-image: linear-gradient(90deg, #000 0, #000 88%, rgba(0, 0, 0, .15) 100%);
}
.quick-row::-webkit-scrollbar { height: 0; }
.quick {
  width: 72px;
  display: grid;
  justify-items: center;
  gap: 8px;
}
.quick-circle {
  width: 72px; height: 72px;
  border-radius: 50%;
  overflow: hidden;
  display: block;
}
.quick-circle img { width: 72px; height: 72px; display: block; }
.quick-label {
  font-size: 14.5px;
  line-height: 18px;
  color: #e6e8ec;
  text-align: center;
  letter-spacing: -.1px;
}

.swap-btn {
  display: grid;
  place-items: center;
  margin: 12px 0 0 -4px;
  color: var(--green-lit);
  width: 50px; height: 26px;
}

/* карты лояльности */
.loyalty-add {
  margin-top: 22px;
  width: 80px; height: 80px;
  border-radius: 16px;
  background: var(--panel-2);
  color: #9a9a9f;
  display: grid; place-items: center;
}

/* последние платежи */
.recent-row {
  display: flex;
  gap: 14px;
  margin: 20px -20px 0 0;
}
.recent {
  width: 76px;
  display: grid;
  justify-items: center;
  gap: 14px;
  text-align: center;
}
.recent-circle {
  position: relative;
  width: 56px; height: 56px;
  border-radius: 50%;
  display: grid; place-items: center;
  overflow: visible;
}
.recent-circle > svg { width: 56px; height: 56px; display: block; border-radius: 50%; }
.recent-circle--dark { background: #2e3033; }
.ok-check {
  position: absolute;
  left: -1px; bottom: -2px;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: var(--green-lit);
  display: grid; place-items: center;
}
.recent-label {
  font-size: 13px;
  line-height: 16px;
  color: #d9dbe0;
  letter-spacing: -.1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.recent--cut { margin-right: -30px; }

.scroll-tail { height: 40px; }

/* ------------------------------------------------------------- таб-бар --- */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: #1c1c1c;
  display: flex;
  align-items: flex-start;
  padding: 8px 0 max(6px, var(--sab));
  z-index: 35;
}
.tab {
  flex: 1;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #8a8a90;
}
.tab span { font-size: 10px; letter-spacing: .1px; }
.tab svg { height: 24px; width: auto; max-width: 31px; }
.tab.is-active { color: #2ed35c; }

/* ============================================================= 4. DETAIL == */
/* один цвет на весь экран: никакой «чёрной полосы» под контентом */
.screen--detail { z-index: 50; background: var(--bg); }

.nav {
  position: absolute;
  top: calc(var(--sat) + 14px); left: 0; right: 0;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #262628;
  z-index: 30;
}
/* фон шапки продолжается вверх, под вырез экрана */
.screen--detail::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: calc(var(--sat) + 58px);
  background: #262628;
  z-index: 20;
}
.nav-title { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }

.nav-back {
  position: absolute;
  left: 20px;
  display: grid; place-items: center;
  width: 26px; height: 30px;
  color: #fff;
}
.badge--sm {
  top: -6px; right: -12px;
  min-width: 18px; height: 18px;
  font-size: 11px;
}

.nav-share {
  position: absolute;
  right: 20px;
  color: #fff;
}

.detail-scroll {
  position: absolute;
  top: calc(var(--sat) + 58px); left: 0; right: 0; bottom: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  scrollbar-width: none;
}
.detail-scroll::-webkit-scrollbar { width: 0; }

.detail-body {
  background: var(--bg);
  padding: 17px 20px 16px;
}

.ok-banner {
  display: flex;
  align-items: center;
  gap: 13px;
  background: #17301e;
  border-radius: 12px;
  padding: 0 12px;
  min-height: 47px;
  margin-bottom: 5px;
  color: var(--green-lit);
  font-size: 16px;
  letter-spacing: -.1px;
}
.ok-circle {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: #2ec55e;
  display: grid; place-items: center;
  flex: 0 0 auto;
}

.drow {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 0;
}
.dlbl { font-size: 15px; line-height: 21px; color: var(--label); letter-spacing: -.1px; }
.dval { font-size: 17px; line-height: 21px; color: #fff; font-weight: 500; text-align: right; letter-spacing: -.25px; }
.dval--big { text-align: left; font-weight: 400; }

.dfield { padding: 8px 0 0; }
.dfield .dlbl { display: block; }

.dlink {
  margin: 19px 0 7px;
  font-size: 17px;
  line-height: 21px;
  color: #eceef2;
  letter-spacing: -.25px;
}
.dlink a {
  color: var(--green-lit);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.detail-foot {
  margin-top: auto;
  padding: 6px 16px calc(20px + var(--sab));
  flex: 0 0 auto;
}
.btn-ghost {
  width: 100%;
  height: 42px;
  border-radius: 13px;
  border: 1px solid rgba(126, 190, 150, .45);
  color: var(--green-lit);
  font-size: 17px;
  letter-spacing: -.2px;
  background: transparent;
}

/* ================================================================ SHEET === */
.sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .55);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: opacity .28s ease, visibility .28s;
  z-index: 90;
}
.sheet-backdrop.is-on { opacity: 1; visibility: visible; }

.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  background: var(--bg);
  border-radius: 26px 26px 0 0;
  padding: 8px 20px 0;
  transform: translateY(104%);
  transition: transform .34s cubic-bezier(.22, .85, .3, 1);
  z-index: 95;
  /* тень включаем только когда меню открыто: у закрытого «шторка» уезжает
     за нижний край, и её тень рисовала бы тёмную полосу вдоль всего низа  */
  box-shadow: none;
}
.sheet.is-on {
  transform: translateY(0);
  box-shadow: 0 -20px 50px rgba(0, 0, 0, .5);
}

.sheet-grab {
  width: 38px; height: 5px;
  border-radius: 3px;
  background: #3a3a3e;
  margin: 0 auto 16px;
}
.sheet-title {
  margin: 0 0 18px;
  font-size: 19px;
  font-weight: 600;
  text-align: center;
  letter-spacing: -.2px;
}

.field { display: block; margin-bottom: 14px; }
.field-label {
  display: block;
  font-size: 13px;
  color: var(--label);
  margin-bottom: 7px;
  letter-spacing: -.1px;
}
.field-input {
  width: 100%;
  height: 50px;
  border-radius: 13px;
  background: var(--panel);
  border: 1px solid transparent;
  color: #fff;
  font-size: 17px;
  padding: 0 14px;
  outline: none;
  letter-spacing: -.1px;
  transition: border-color .2s ease, background .2s ease;
}
.field-input::placeholder { color: #5c5c60; }
.field-input:focus { border-color: rgba(46, 197, 94, .7); background: #202022; }

.btn-primary {
  width: 100%;
  height: 50px;
  margin-top: 8px;
  border-radius: 14px;
  background: var(--green);
  color: #06230f;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.2px;
  transition: transform .12s ease, filter .15s ease;
}
.btn-primary:active { transform: scale(.985); filter: brightness(.94); }

.sheet-hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 18px;
  color: #6f6f75;
  letter-spacing: -.1px;
}

.sheet-pad { height: calc(26px + var(--sab)); }

/* --------------------------------------------------- анимация перехода --- */
.slide-in { animation: slideIn .34s cubic-bezier(.22, .85, .3, 1); }
@keyframes slideIn {
  from { transform: translateX(28px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}
.slide-back { animation: slideBack .3s ease; }
@keyframes slideBack {
  from { transform: translateX(-22px); opacity: .4; }
  to   { transform: translateX(0); opacity: 1; }
}
