:root {
  --accent: #00e676;
  --accent-dim: #00c853;
  --accent-glow: rgba(0, 230, 118, 0.22);
  --accent-faint: rgba(0, 230, 118, 0.08);
  --bg: #070d12;
  --bg-card: #0e1a22;
  --bg-elevated: #152030;
  --ink: #e8f4ec;
  --ink-2: #8aa89c;
  --ink-3: #4d6b5e;
  --line: rgba(0, 230, 118, 0.14);
  --red: #ff3d6e;
  --red-dim: rgba(255, 61, 110, 0.18);
  --nav-height: 62px;
  --radius-card: 22px;
  --radius-pill: 999px;
}

* {
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

html {
  min-height: 100%;
  background: var(--bg);
  overflow-x: clip;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Sora', sans-serif;
  overflow-x: clip;
}

button {
  font: inherit;
}

.app-shell {
  width: min(100%, 440px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 24px calc(120px + env(safe-area-inset-bottom, 0px));
  background: var(--bg);
  position: relative;
  overflow-x: clip;
}

/* Subtle background texture */
.app-shell::before {
  content: '';
  position: fixed;
  inset: 0;
  width: min(100%, 440px);
  left: 50%;
  transform: translateX(-50%);
  background:
    radial-gradient(ellipse 60% 40% at 15% 10%, rgba(0, 230, 118, 0.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 30% at 85% 80%, rgba(0, 230, 118, 0.04) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 54px;
  padding: 6px 0 14px;
  position: relative;
  z-index: 1;
}

.brand-logo {
  display: block;
  width: min(160px, 44vw);
  height: auto;
}

@media (max-width: 360px) {
  .app-shell {
    padding-right: 18px;
    padding-left: 18px;
  }

  .brand-logo {
    width: min(148px, 44vw);
  }
}

.app-content {
  min-height: calc(100vh - 200px);
  position: relative;
  z-index: 1;
}

/* ─── FOOTER / NAV ─── */
.app-footer {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 100;
  width: min(calc(100% - 32px), 380px);
  transform: translateX(-50%);
}

.bottom-menu {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: center;
  height: var(--nav-height);
  padding: 0 8px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-pill);
  background: rgba(14, 26, 34, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(0, 230, 118, 0.06);
}

.nav-button {
  width: 100%;
  height: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  color: var(--ink-3);
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  border-radius: var(--radius-pill);
  transition: color 200ms ease;
  -webkit-tap-highlight-color: transparent;
  position: relative;
}

.nav-button::after {
  content: '';
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transition: transform 200ms ease;
}

.nav-button.active {
  color: var(--accent);
}

.nav-button.active::after {
  transform: translateX(-50%) scaleX(1);
}

.icon {
  width: 30px;
  height: 30px;
  display: inline-block;
  flex: 0 0 auto;
  background-color: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
}

.icon-account-circle { --icon: url("../icons/account_circle.svg"); }
.icon-alternate-email { --icon: url("../icons/alternate_email.svg"); }
.icon-arrow-back { --icon: url("../icons/arrow_back.svg"); }
.icon-arrow-drop-down { --icon: url("../icons/arrow_drop_down.svg"); }
.icon-bank { --icon: url("../icons/bank.svg"); }
.icon-bybit-refresh { --icon: url("../icons/bybit_refresh.svg"); }
.icon-call { --icon: url("../icons/call.svg"); }
.icon-check { --icon: url("../icons/check.svg"); }
.icon-chevron-right { --icon: url("../icons/chevron_right.svg"); }
.icon-close { --icon: url("../icons/close.svg"); }
.icon-content-copy { --icon: url("../icons/content_copy.svg"); }
.icon-credit-card { --icon: url("../icons/credit_card.svg"); }
.icon-error-circle { --icon: url("../icons/error_circle.svg"); }
.icon-help { --icon: url("../icons/help.svg"); }
.icon-history { --icon: url("../icons/history.svg"); }
.icon-home { --icon: url("../icons/home.svg"); }
.icon-info { --icon: url("../icons/info.svg"); }
.icon-location-on { --icon: url("../icons/location_on.svg"); }
.icon-login { --icon: url("../icons/login.svg"); }
.icon-near-me { --icon: url("../icons/near_me.svg"); }
.icon-orders-empty { --icon: url("../icons/orders_empty.svg"); }
.icon-payments { --icon: url("../icons/payments.svg"); }
.icon-person { --icon: url("../icons/person.svg"); }
.icon-p2p-orders { --icon: url("../icons/p2p_orders.svg"); }
.icon-question-mark { --icon: url("../icons/question_mark.svg"); }
.icon-schedule { --icon: url("../icons/schedule.svg"); }
.icon-support-agent { --icon: url("../icons/support_agent.svg"); }
.icon-telegram-channel { --icon: url("../icons/telegram_channel.svg"); }
.icon-timer { --icon: url("../icons/timer.svg"); }
.icon-usd-coin { --icon: url("../icons/usd_coin.svg"); }
.icon-usdt-coin { --icon: url("../icons/usdt_coin.svg"); }

@media (min-width: 700px) {
  html {
    background: #04070a;
  }

  body {
    background: #04070a;
  }

  .app-shell {
    margin: 24px auto;
    min-height: calc(100vh - 48px);
    border: 1px solid rgba(0, 230, 118, 0.1);
    border-radius: 32px;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 230, 118, 0.04);
    overflow: hidden;
  }

  .app-shell::before {
    border-radius: 32px;
  }

  .app-footer {
    position: absolute;
  }
}

/* ─── Disabled state — единый стиль для всех кнопок приложения ─── */
button:disabled,
button[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.primary-action:disabled,
.tab-two-action:disabled,
.tab-three-action:disabled,
.tab-four-done:disabled,
.tab-four-cancel:disabled {
  box-shadow: none;
  transform: none;
}

.eg-alert-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(7, 13, 18, 0.78);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.eg-alert-box {
  width: min(100%, 360px);
  padding: 24px 20px 18px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(14, 26, 34, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(0, 230, 118, 0.06);
  text-align: center;
  animation: egAlertIn 180ms ease-out;
}

.eg-alert-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-pill);
  color: var(--accent);
  background: var(--accent-faint);
  box-shadow: 0 0 0 1px var(--line), 0 0 24px var(--accent-glow);
}

.eg-alert-message {
  margin: 0 0 18px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
  white-space: pre-line;
}

.eg-alert-button {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #04110a;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 10px 30px var(--accent-glow);
}

.eg-alert-hide {
  animation: egAlertOut 180ms ease-in forwards;
}

@keyframes egAlertIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes egAlertOut {
  to {
    opacity: 0;
  }
}

.eg-confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.eg-confirm-button {
  height: 50px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.eg-confirm-no {
  border: 1.5px solid var(--line);
  background: var(--bg-elevated);
  color: var(--ink);
}

.eg-confirm-yes {
  border: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #04110a;
  box-shadow: 0 10px 30px var(--accent-glow);
}
