/* ==========================================================================
   Окно подключения кошелька на странице чека.

   Белое, со скруглением и мягкой тенью — как лист самого счёта, чтобы окно
   читалось частью бренда, а не системной вставкой. На телефоне поднимается
   снизу листом, на компьютере стоит по центру карточкой.
   ========================================================================== */

.wc {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
}
.wc[hidden] { display: none; }

.wc__scrim {
  position: absolute;
  inset: 0;
  background: #0b0e1166;
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: wc-fade .22s ease both;
}

.wc__sheet {
  position: relative;
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  border-radius: 26px;
  padding: 30px 26px 26px;
  box-shadow: 0 24px 70px #05060f2e, 0 2px 8px #05060f14;
  animation: wc-in .3s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes wc-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wc-in {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------- закрытие */
.wc__x {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f2f2f4;
  color: #5c6169;
  cursor: pointer;
  transition: background .18s ease, color .18s ease;
}
.wc__x:hover { background: #e8e8ec; color: #1c2030; }

/* ------------------------------------------------------------------ марка */
.wc__brand { display: flex; justify-content: center; margin-bottom: 18px; }

/* ------------------------------------------------------------------ текст */
.wc__title {
  margin: 0 0 8px;
  font-family: var(--display);
  font-size: 23px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: #1b1b1c;
  text-align: center;
}

.wc__lead {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #5c6169;
  text-align: center;
}

/* ------------------------------------------------------------------- сеть */
.wc__net {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 auto 18px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #f2f4ff;
  color: #0500ff;
  font-size: 13px;
  font-weight: 600;
}
.wc__net-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #14f195;
  box-shadow: 0 0 0 3px #14f19533;
}
/* Центрируем пилюлю сети: она строчная, а нужен отдельный ряд. */
[data-step="pick"] .wc__net { display: flex; width: fit-content; }

/* --------------------------------------------------------------- кошельки */
.wc__list { display: flex; flex-direction: column; gap: 6px; }

.wc__item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 1px solid #e9e9ee;
  border-radius: 15px;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.wc__item:hover { border-color: #cddcff; background: #fafbff; }
.wc__item:active { transform: scale(.99); }

.wc__item img { flex: 0 0 auto; border-radius: 9px; }

.wc__item-name {
  flex: 1 1 auto;
  font-size: 15px;
  font-weight: 600;
  color: #1b1b1c;
}

.wc__item-note {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 999px;
  background: #eef1ff;
  color: #0500ff;
  font-size: 11px;
  font-weight: 600;
}

.wc__chev { flex: 0 0 auto; color: #a0a1ad; }

.wc__fine {
  margin: 16px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #8b8f98;
  text-align: center;
}

/* --------------------------------------------------------------------- QR */
.wc__qr {
  display: grid;
  place-items: center;
  margin: 4px auto 16px;
  padding: 14px;
  width: fit-content;
  border-radius: 18px;
  background: #fff;
  border: 1px solid #e9e9ee;
}
.wc__qrhost {
  width: 216px;
  height: 216px;
  display: grid;
  place-items: center;
}
.wc__qrhost ph-qr-code { display: block; }
.wc__uri {
  margin: 0;
  padding: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10px;
  line-height: 1.4;
  color: #5c6169;
  word-break: break-all;
}

.wc__wait {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13.5px;
  color: #5c6169;
}

.wc__spinner {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  border: 2px solid #d8d9e0;
  border-top-color: #0500ff;
  animation: wc-spin .8s linear infinite;
}
@keyframes wc-spin { to { transform: rotate(360deg); } }

.wc__open { margin-top: 18px; }
.wc__open-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: 999px;
  background: #0500ff;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  transition: background .2s ease;
}
.wc__open-btn:hover { background: #0300a6; }

/* --------------------------------------------------------------- успех */
.wc__tick {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 6px auto 16px;
  border-radius: 50%;
  background: #e9f9f0;
  color: #12a15c;
}

/* --------------------------------------------------------- тёмная тема */
@media (prefers-color-scheme: dark) {
  .wc__sheet { background: #16181d; box-shadow: 0 24px 70px #00000073; }
  .wc__title { color: #fff; }
  .wc__lead { color: #ffffffb3; }
  .wc__x { background: #24262e; color: #ffffffb3; }
  .wc__x:hover { background: #2e313a; color: #fff; }
  .wc__item { background: #1c1f26; border-color: #2a2d36; }
  .wc__item:hover { background: #22262f; border-color: #3a3f52; }
  .wc__item-name { color: #fff; }
  .wc__net { background: #1e2140; color: #8f8bff; }
  .wc__qr { background: #fff; border-color: #2a2d36; }
  .wc__fine { color: #ffffff80; }
  .wc__wait { color: #ffffffb3; }
  .wc__tick { background: #14301f; color: #3ddc8a; }
}

/* -------------------------------------------------------------- телефон
   Лист поднимается снизу и занимает не больше 92% высоты: так он не
   перекрывает адресную строку целиком и видно, что окно можно закрыть. */
@media (max-width: 560px) {
  .wc { padding: 0; place-items: end center; }
  .wc__sheet {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    padding: 26px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    animation: wc-up .32s cubic-bezier(.22, 1, .36, 1) both;
  }
  @keyframes wc-up {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: none; }
  }

  .wc__title { font-size: 21px; }
  .wc__item { min-height: 62px; }
  .wc__qr canvas { width: 200px; height: 200px; }
  .wc__open-btn { height: 52px; font-size: 16px; }
}

@media (max-width: 360px) {
  .wc__sheet { padding: 22px 16px calc(18px + env(safe-area-inset-bottom, 0px)); }
  .wc__title { font-size: 19px; }
  .wc__item { padding: 9px 12px; gap: 10px; }
  .wc__item-name { font-size: 14px; }
  .wc__qr canvas { width: 176px; height: 176px; }
}

@media (prefers-reduced-motion: reduce) {
  .wc__sheet, .wc__scrim { animation: none !important; }
  .wc__spinner { animation-duration: 1.6s; }
}
