:root {
  --bg:        #05070e;
  --bg-2:      #090e1a;
  --surface:   #0e1524;
  --surface-2: #131c30;
  --elev:      #1a2338;
  --line:      rgba(255,255,255,0.07);
  --line-2:    rgba(255,255,255,0.12);
  --text:      #eef4ff;
  --muted:     #7b8398;
  --muted-2:   #545c72;
  /* Электрик-блю — основной акцент (из фирменного логотипа) */
  --accent:    #2ea0ff;
  --accent-2:  #0a6cf0;
  --accent-ink:#9cd0ff;
  /* Золото — вторичный акцент (пара к синему, как на брендовой картинке) */
  --gold:      #f5c451;
  --gold-ink:  #ffd977;
  --red:       #ff3b4e;
  --green:     #34d17d;
  --amber:     #f2b53c;
  --radius:    14px;
  --radius-sm: 11px;
  --shadow:    0 18px 40px -22px rgba(0,0,0,0.92);
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overscroll-behavior: none;
  font-feature-settings: "cv11", "ss01";
}

body {
  min-height: 100vh;
  padding-bottom: 92px;
  background:
    radial-gradient(720px 440px at 50% -10%, rgba(46,160,255,0.22), transparent 60%),
    radial-gradient(520px 360px at 92% 4%, rgba(245,196,81,0.08), transparent 62%),
    var(--bg);
}

/* Заголовочный шрифт (витрина логотипа/секций) — Oswald задаёт «терминальный»
   характер; цифры и текст остаются на Inter ради табличных цифр. */
.font-display { font-family: "Oswald", "Inter", sans-serif; }

b { font-weight: 700; }

/* Иконки */
.ic    { width: 22px; height: 22px; display: block; color: inherit; }
.ic-sm { width: 16px; height: 16px; display: block; color: inherit; }
.ic-xs { width: 12px; height: 12px; display: block; color: inherit; }
svg use { color: inherit; }

/* Числа — табличные */
.stat-val, .rh-val, .rb-val, .hist-amount, .dyn-row .r, .hero-pills b, #successCount {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* ============ ЛОГОТИП (хром-металлик, как на брендовой картинке) ============ */
.logo {
  font-family: "Oswald", "Inter", sans-serif;
  font-weight: 700; font-size: 22px; letter-spacing: 0.01em;
  display: inline-flex; text-transform: uppercase; line-height: 1;
}
/* Металлический блик: светлое сверху → тень в центре → блик снизу */
.logo-a, .logo-b {
  background: linear-gradient(180deg, #ffffff 6%, #d3dcec 38%, #8b97ad 54%, #f4f8ff 72%, #b7c1d4 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
/* Вторую половину слегка подсвечиваем электрик-блю — узнаваемая двойная подача */
.logo-b {
  background: linear-gradient(180deg, #cfeaff 8%, #7cc4ff 52%, #2ea0ff 100%);
  -webkit-background-clip: text; background-clip: text;
}
.logo-lg {
  font-size: 46px; letter-spacing: 0.005em;
  filter: drop-shadow(0 6px 20px rgba(46,160,255,0.35));
}

/* ============ SPLASH ============ */
.splash {
  position: fixed; inset: 0; z-index: 999; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .55s ease, visibility .55s ease;
}
.splash.hide { opacity: 0; visibility: hidden; }
.splash-glow {
  position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(46,160,255,0.35), transparent 65%);
  filter: blur(30px);
}
.splash-inner { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.splash-tag { color: var(--muted); font-size: 13px; letter-spacing: 0.04em; margin-bottom: 22px; }
.loader-ring {
  width: 42px; height: 42px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,0.1);
  border-top-color: var(--accent); border-right-color: var(--accent-2);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ ШАПКА ============ */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  background: rgba(7,8,16,0.72);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar-l { display: flex; align-items: center; gap: 9px; }
.badge-247 {
  font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--accent-ink);
  background: rgba(46,160,255,0.13); border: 1px solid rgba(46,160,255,0.28);
  padding: 3px 7px; border-radius: 7px;
}
.icon-btn {
  width: 40px; height: 36px; border-radius: 11px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line-2); color: var(--muted); cursor: pointer;
  transition: .15s;
}
.icon-btn:active { transform: scale(0.94); color: var(--text); }

/* ============ LAYOUT ============ */
#app { position: relative; z-index: 1; padding: 20px 18px; max-width: 620px; margin: 0 auto; }
.page { animation: fade .28s cubic-bezier(.2,.7,.3,1); }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ ГЛАВНАЯ · HERO ============ */
.hero { margin-bottom: 24px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.hero-ava-ring {
  width: 86px; height: 86px; border-radius: 50%; padding: 3px; margin-bottom: 13px;
  background: conic-gradient(from 210deg, var(--accent), var(--gold), var(--accent-2), var(--accent));
  box-shadow: 0 10px 30px -10px rgba(46,160,255,0.55);
}
.hero-ava {
  width: 100%; height: 100%; border-radius: 50%; overflow: hidden;
  background: var(--surface-2); border: 3px solid var(--bg);
  display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: var(--accent-ink); letter-spacing: 0.02em;
}
.hero-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-name { font-family: "Oswald", "Inter", sans-serif; font-size: 27px; font-weight: 600; letter-spacing: 0.01em; }
.hero-handle { color: var(--muted); font-size: 13.5px; margin-top: 2px; font-weight: 500; }
.hero-pills { display: flex; gap: 9px; flex-wrap: wrap; justify-content: center; margin-top: 14px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; padding: 8px 13px; font-size: 13px; font-weight: 600; color: var(--muted);
}
.pill b { color: var(--text); margin-left: 2px; }
.pill svg { color: var(--muted-2); }
.pill-accent { color: var(--accent-ink); background: rgba(46,160,255,0.1); border-color: rgba(46,160,255,0.24); }
.pill-accent svg { color: var(--accent); }

/* ============ STAT CARDS ============ */
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 18px; }
.stat-card {
  display: flex; align-items: center; gap: 13px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.stat-wide { grid-column: 1 / -1; }
.stat-icon {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(46,160,255,0.12); border: 1px solid rgba(46,160,255,0.2); color: var(--accent-ink);
}
.stat-body { min-width: 0; flex: 1; }
.stat-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stat-val { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }
.stat-label { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.stat-wide .stat-head { justify-content: flex-start; }

/* ============ ГЛАВНОЕ ДЕЙСТВИЕ ============ */
.action-primary {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 17px 18px; margin-bottom: 14px; cursor: pointer; text-align: left;
  color: #fff; border: none; border-radius: var(--radius);
  background: linear-gradient(120deg, #2ea0ff 0%, #0a6cf0 58%, #0a84ff 100%);
  box-shadow: 0 16px 34px -16px rgba(46,160,255,0.7), inset 0 1px 0 rgba(255,255,255,0.22);
  position: relative; overflow: hidden;
}
.action-primary::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(160px 70px at 85% 0%, rgba(255,255,255,0.22), transparent 70%);
  pointer-events: none;
}
.action-primary:active { transform: scale(0.99); }
.ap-l { display: flex; align-items: center; gap: 14px; }
.ap-icon {
  width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center;
  background: rgba(255,255,255,0.16); backdrop-filter: blur(4px);
}
.ap-title { display: block; font-weight: 800; font-size: 16px; letter-spacing: -0.01em; }
.ap-sub { display: block; font-size: 12.5px; color: rgba(255,255,255,0.78); margin-top: 1px; }
.ap-arrow { opacity: 0.9; }

/* ============ MINI CARDS ============ */
.row-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; cursor: pointer; text-align: left; color: var(--text); box-shadow: var(--shadow);
}
.mini-card:active { transform: scale(0.99); }
.mc-icon {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 8px;
}
.mc-blue  { background: rgba(46,160,255,0.13); border: 1px solid rgba(46,160,255,0.22); color: var(--accent-ink); }
.mc-amber { background: rgba(242,181,60,0.12);  border: 1px solid rgba(242,181,60,0.22);  color: var(--amber); }
.mc-title { font-weight: 700; font-size: 15px; }
.mc-sub { color: var(--muted); font-size: 12.5px; }

/* ============ SUCCESS LINE ============ */
.success-line {
  margin-top: 20px; display: flex; align-items: center; gap: 11px;
  color: var(--muted); font-size: 13.5px;
  padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
}
.success-line b { color: var(--text); }
.sl-check {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(52,209,125,0.13); border: 1px solid rgba(52,209,125,0.28); color: var(--green);
}

/* ============ PAGE HERO ============ */
.page-hero {
  display: flex; align-items: center; gap: 14px; margin-bottom: 18px;
  padding: 18px; border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); box-shadow: var(--shadow);
}
.ph-icon {
  width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(46,160,255,0.12); border: 1px solid rgba(46,160,255,0.22); color: var(--accent-ink);
}
.ph-title { font-family: "Oswald", "Inter", sans-serif; font-size: 23px; font-weight: 600; letter-spacing: 0.01em; }
.ph-sub { color: var(--muted); font-size: 13px; margin-top: 1px; }

/* ============ PANEL ============ */
.panel {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.panel-title { font-family: "Oswald", "Inter", sans-serif; font-weight: 600; font-size: 17px; margin-bottom: 15px; letter-spacing: 0.02em; }
.panel-title.with-icon { display: flex; align-items: center; gap: 9px; }
.panel-title.with-icon svg { color: var(--accent-ink); }

/* ============ КУРСЫ ============ */
.rate-heads { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 22px; }
.rate-head {
  text-align: center; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 12px;
  background: var(--bg-2);
}
.rh-top { display: flex; align-items: center; justify-content: center; gap: 7px; margin-bottom: 8px; }
.coin { width: 20px; height: 20px; display: block; flex-shrink: 0; }
.rh-name { color: var(--muted); font-size: 11px; letter-spacing: 0.1em; font-weight: 700; }
.rh-val { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; }
.dyn-title { font-weight: 700; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.dyn-list { display: flex; flex-direction: column; }
.dyn-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 2px; border-bottom: 1px solid var(--line); font-size: 14.5px;
}
.dyn-row span:first-child { color: var(--muted); }
.dyn-row:last-child { border-bottom: none; }
.dyn-row .r { font-weight: 700; }
.mins {
  display: flex; align-items: center; gap: 14px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line); color: var(--muted); font-size: 13px;
}
.mins b { color: var(--text); margin-left: 4px; }
.mins-div { width: 1px; height: 14px; background: var(--line-2); }

/* ============ VIP ============ */
.vip-panel { padding: 16px 18px; }
.vip-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.vip-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.vip-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em; color: var(--accent-ink);
  background: rgba(46,160,255,0.14); padding: 2px 7px; border-radius: 6px;
}
.vip-note { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.switch { position: relative; display: inline-block; width: 50px; height: 30px; flex-shrink: 0; }
.switch input { display: none; }
.slider { position: absolute; inset: 0; background: #2a3048; border-radius: 999px; transition: .22s; cursor: pointer; }
.slider::before {
  content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .22s; box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}
.switch input:checked + .slider { background: linear-gradient(120deg, var(--accent), var(--accent-2)); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ============ FIELDS ============ */
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.field label { color: var(--muted); font-size: 12px; font-weight: 600; }
.field .opt { color: var(--muted-2); font-weight: 400; }
.field input, .select-wrap select {
  background: var(--bg-2); border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  padding: 13px 14px; color: var(--text); font-size: 15px; width: 100%; outline: none;
  font-family: inherit; transition: border-color .15s;
}
.field input::placeholder { color: var(--muted-2); }
.field input:focus, .select-wrap select:focus { border-color: var(--accent); }
.select-wrap { position: relative; }
.select-wrap select { appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer; }
.select-wrap::after {
  content: ""; position: absolute; right: 15px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}

/* ============ RESULT ============ */
.result-box {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 16px; border-radius: var(--radius-sm); margin: 4px 0 4px;
  background: linear-gradient(120deg, rgba(46,160,255,0.14), rgba(10,108,240,0.07));
  border: 1px solid rgba(46,160,255,0.26);
}
.rb-label { color: var(--muted); font-size: 13px; }
.rb-val { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent-ink); }
.calc-rate-note { color: var(--muted); font-size: 12px; margin-top: 10px; text-align: right; min-height: 15px; }

/* ============ ЗАЯВКА ============ */
.deal-vip-row {
  padding: 14px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg-2); margin-bottom: 16px; transition: .15s;
}
.deal-vip-row:has(input:checked) { border-color: rgba(46,160,255,0.5); background: rgba(46,160,255,0.07); }

.req-block {
  padding: 14px 14px 0; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg-2); margin-bottom: 16px;
}
.req-head { margin-bottom: 12px; }
.req-title { font-weight: 700; font-size: 14.5px; }
.submit-btn {
  width: 100%; padding: 16px; border: none; border-radius: var(--radius-sm); margin-top: 6px;
  background: linear-gradient(120deg, #2ea0ff, #0a6cf0); color: #fff; font-size: 16px; font-weight: 800;
  cursor: pointer; font-family: inherit; box-shadow: 0 14px 30px -14px rgba(46,160,255,0.75);
}
.submit-btn:active { transform: scale(0.99); }
.submit-btn:disabled { opacity: 0.6; cursor: default; }
.form-hint { color: var(--muted-2); font-size: 11.5px; text-align: center; margin-top: 12px; }

/* ============ ИСТОРИЯ ============ */
.history-list { display: flex; flex-direction: column; gap: 11px; }
.hist-item {
  border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 15px 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface)); box-shadow: var(--shadow);
}
.hist-top { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.hist-id { font-weight: 800; font-size: 14px; letter-spacing: -0.01em; }
.hist-date { color: var(--muted); font-size: 12px; }
.hist-status { margin-left: auto; font-size: 11px; font-weight: 700; padding: 4px 11px; border-radius: 999px; }
.st-new    { background: rgba(46,160,255,0.16); color: var(--accent-ink); }
.st-done   { background: rgba(52,209,125,0.13); color: var(--green); }
.st-cancel { background: rgba(124,130,152,0.14); color: #9aa1b8; }
.st-reject { background: rgba(255,59,78,0.13);  color: var(--red); }
.hist-empty {
  padding: 26px 18px; text-align: center; color: var(--muted); font-size: 13.5px; line-height: 1.5;
  border: 1px dashed var(--line-2); border-radius: var(--radius-sm);
}
.hist-amount { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.hist-amount .arrow { color: var(--muted-2); width: 18px; height: 18px; flex-shrink: 0; }

/* ============ TABBAR ============ */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around;
  background: rgba(9,10,20,0.82); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding: 9px 6px calc(9px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; background: none; border: none; cursor: pointer; color: var(--muted-2);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 10.5px; font-weight: 600; padding: 7px 4px; border-radius: 13px;
  transition: color .15s, background .15s; font-family: inherit; position: relative;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--accent-ink); background: rgba(46,160,255,0.1); }
.tab.active::before {
  content: ""; position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.tab.active svg { color: var(--accent); filter: drop-shadow(0 0 8px rgba(46,160,255,0.5)); }

@media (max-width: 360px) {
  .stat-val { font-size: 18px; }
  .rh-val { font-size: 20px; }
  .tab { font-size: 9.5px; }
}
