/* ==========================================================================
   Светлая тема на всех устройствах.

   Страница чека и клон раньше следовали системной настройке: на телефоне с
   тёмной темой посетитель видел тёмный вариант. Теперь тема всегда светлая —
   так счёт выглядит одинаково у всех и совпадает с тем, как его показывает
   сам Trust Wallet.

   Как это сделано. Блоки @media (prefers-color-scheme: dark) в файлах
   остаются на месте: часть из них — правила чужого CSS, который мы
   подключаем как есть, и переписывать его нельзя. Вместо этого браузеру
   сообщается, что страница светлая (`color-scheme: light`), а тёмные правила
   гасятся здесь, в одном месте.

   Файл подключается последним, поэтому его правила перекрывают прочие при
   равной специфичности.
   ========================================================================== */

/* Браузер красит поля ввода, полосы прокрутки и адресную строку по этому
   значению. `light` — и системная тёмная тема перестаёт на них влиять. */
:root,
html {
  color-scheme: light !important;
}

/* --------------------------------------------------------------------------
   Тёмные правила гасятся переопределением.

   Каждое значение взято из светлой темы того же файла, поэтому вид не
   меняется — меняется только то, что тёмный вариант больше не применяется.
   -------------------------------------------------------------------------- */

@media (prefers-color-scheme: dark) {
  /* ---- токены Trust Wallet ---- */
  :root {
    --v2-chrome-bg: #fff;
    --v2-bg-page: #eeeef0;
    --v2-bg-surface: #fff;
    --v2-bg-light: #f7f7f7;
    --v2-bg-secondary: #f0f0f2;
    --v2-text-primary: #1c2030;
    --v2-text-secondary: #1c2030cc;
    --v2-text-tertiary: #1c203099;
    --v2-text-heading: #262a3f;
    --v2-divider: #a0a1ad52;
    --v2-brand: #0500ff;
  }

  /* ---- основа страницы ---- */
  html, body {
    background: #eeeef0 !important;
    color: #1c2030 !important;
  }

  /* ---- панель ---- */
  .tw-header__inner {
    background: #fff !important;
    border-color: #a0a1ad52 !important;
  }
  .tw-header.is-scrolled .tw-header__inner {
    background: #fff !important;
  }
  .tw-menu {
    background: #fff !important;
    box-shadow: 0 16px 48px #090d2126, 0 0 0 1px #a0a1ad52 !important;
  }
  .tw-menu a { color: #1c2030 !important; }
  .tw-menu a:hover { background: #f7f7f7 !important; }
  .tw-menu__trustsend:hover { background: #f7f7f7 !important; }
  .tw-support { color: #1c2030 !important; }
  .tw-cta { background: #f7f7f7 !important; color: #1c2030 !important; }
  .tw-cta:hover { background: #f0f0f2 !important; }
  .tw-globe, .tw-burger { color: #1c2030 !important; }

  /* ---- список языков ---- */
  .tw-lang__menu {
    background: #fff !important;
    box-shadow: 0 16px 48px #090d2126, 0 0 0 1px #a0a1ad52 !important;
  }
  .tw-lang__item { color: #1c2030 !important; }
  .tw-lang__item:hover { background: #f7f7f7 !important; }
  .tw-lang__item.is-active { background: #eef1ff !important; color: #0500ff !important; }

  /* ---- мобильное меню клона ---- */
  .tw-drawer__sheet { background: #fff !important; }
  .tw-drawer__title { color: #262a3f !important; }
  .tw-drawer__x { background: #f0f0f2 !important; color: #1c2030cc !important; }
  .tw-drawer__item { color: #1c2030 !important; }
  .tw-drawer__item:active { background: #f0f0f2 !important; }
  .tw-drawer__label { color: #1c203099 !important; }

  /* ---- лист чека ---- */
  .sheet {
    background: #fff !important;
    box-shadow: 0 8px 40px #05060f1a !important;
  }
  .sheet__title { color: #1b1b1c !important; }
  .sheet__lead { color: #5c6169 !important; }
  .secure { background: #e9f9f0 !important; color: #12a15c !important; }
  .panel { background: #f7f7f7 !important; border-color: #e9e9ee !important; }
  .label { color: #8b8f98 !important; }
  .amount__value, .sender__name { color: #1b1b1c !important; }
  .amount__network, .amount__fiat { color: #5c6169 !important; }
  .details {
    background: #fff !important;
    border-color: #e9e9ee !important;
  }
  .details__head { color: #1b1b1c !important; background: #fff !important; }
  .details__body .row { border-color: #e9e9ee !important; }
  .details__body .row dt { color: #8b8f98 !important; }
  .details__body .row dd { color: #1b1b1c !important; }
  .pill { background: #fdf0dc !important; color: #b8730a !important; }
  .assurance { color: #8b8f98 !important; }
  .page-error { background: #fdecec !important; color: #c0392b !important; }

  /* ---- шапка чека ---- */
  .topbar { background: transparent !important; }
  .brand__name { color: #1b1b1c !important; }
  .topbar__cta { background: #eef1ff !important; color: #0500ff !important; }

  /* ---- кнопка получения ---- */
  .cta { background: #0500ff !important; color: #fff !important; }
  .cta:hover { background: #0300a6 !important; }

  /* ---- блок TRUST и карточки ---- */
  .promo-hero {
    background: linear-gradient(180deg, #eeeef0 0%, #f7f7f7 100%) !important;
  }
  .promo-hero__word { color: #0500ff !important; }
  .promo-hero__text h2 { color: #1b1b1c !important; }
  .promo-hero__text p { color: #5c6169 !important; }
  .promo-hero::before {
    background: linear-gradient(90deg,
      rgba(5, 0, 255, 0) 0%,
      rgba(5, 0, 255, .22) 22%,
      rgba(5, 0, 255, .22) 78%,
      rgba(5, 0, 255, 0) 100%) !important;
  }

  .promo {
    background: linear-gradient(180deg, #f7f7f7 0%, #eeeef0 100%) !important;
  }
  .promo__title { color: #1b1b1c !important; }
  .promo__card {
    border-color: #cddcff !important;
    background: linear-gradient(323deg, #f4f4f7, rgba(244, 244, 247, 0) 70%) !important;
  }
  .promo__text p { color: #5c6169 !important; }

  /* ---- окно подключения кошелька ---- */
  .wc__sheet { background: #fff !important; box-shadow: 0 24px 70px #05060f2e !important; }
  .wc__title { color: #1b1b1c !important; }
  .wc__lead { color: #5c6169 !important; }
  .wc__x { background: #f2f2f4 !important; color: #5c6169 !important; }
  .wc__item { background: #fff !important; border-color: #e9e9ee !important; }
  .wc__item:hover { background: #fafbff !important; border-color: #cddcff !important; }
  .wc__item-name { color: #1b1b1c !important; }
  .wc__net { background: #f2f4ff !important; color: #0500ff !important; }
  .wc__qr { background: #fff !important; border-color: #e9e9ee !important; }
  .wc__fine { color: #8b8f98 !important; }
  .wc__wait { color: #5c6169 !important; }
  .wc__tick { background: #e9f9f0 !important; color: #12a15c !important; }
  .wc__uri { color: #5c6169 !important; }

  /* ---- футер ---- */
  .tw-footer { background: #fff !important; }
  .tw-footer__nav h4, .tw-footer__bottom h4 { color: #1c2030 !important; }
  .tw-footer__nav a { color: #1c2030cc !important; }
  .tw-footer__nav a:hover { color: #0500ff !important; }
  .tw-footer__btns a { background: #f7f7f7 !important; color: #1c2030 !important; }
  .tw-footer__social a { background: #f7f7f7 !important; color: #1c2030 !important; }
  .tw-footer__bottom p, .tw-footer__copy { color: #1c203099 !important; }
}

/* --------------------------------------------------------------------------
   Значок адресной строки на телефоне.

   Тёмный вариант убран: строка браузера должна оставаться светлой, иначе она
   сливается с тёмной рамкой вокруг светлой страницы.
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {
  meta[name="theme-color"] { content: "#ffffff"; }
}
