/* TradeBot Pro Installer — Stylesheet */
:root {
  --bg:      #090c12;
  --card:    #0f1520;
  --card2:   #141b28;
  --border:  #1a2236;
  --border2: #243049;
  --accent:  #F0B90B;
  --green:   #16c784;
  --red:     #f6465d;
  --blue:    #378ADD;
  --muted:   #3d4f6a;
  --text:    #dce5f0;
  --text2:   #7a90aa;
  --text3:   #4a607a;
  --mono:    'JetBrains Mono', monospace;
  --sans:    'Syne', sans-serif;
  --r:       12px;
  --r-sm:    8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  padding: 2rem 1rem 4rem;
  position: relative;
  overflow-x: hidden;
}

/* Subtle grid background */
.bg-grid {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.018) 1px, transparent 1px);
  background-size: 48px 48px;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  position: relative; z-index: 1;
}

/* ── Logo ─────────────────────────────────────────────── */
.logo {
  text-align: center;
  margin-bottom: 2.5rem;
  animation: fadeUp .5s ease both;
}
.logo-icon {
  width: 60px; height: 60px;
  background: var(--accent);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 800; color: #0a0d12;
  margin-bottom: .9rem;
}
.logo h1 {
  font-size: 1.9rem; font-weight: 800;
  color: #fff; letter-spacing: -.5px;
}
.logo p { color: var(--text2); font-size: .85rem; margin-top: .35rem; }

/* ── Steps bar ───────────────────────────────────────── */
.steps-bar {
  display: flex; gap: 6px;
  margin-bottom: 1.75rem;
  animation: fadeUp .5s .1s ease both;
}
.step-pill {
  flex: 1; display: flex; align-items: center; justify-content: center;
  gap: 6px; padding: .55rem .4rem;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--r-sm); cursor: default;
  transition: all .3s;
}
.pill-num {
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--muted); color: var(--bg);
  font-size: .7rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.pill-label { font-size: .72rem; font-weight: 600; color: var(--text2); }
.step-pill.done   { background: #16c78410; border-color: #16c78430; }
.step-pill.done   .pill-num   { background: var(--green); }
.step-pill.done   .pill-label { color: var(--green); }
.step-pill.active { background: #F0B90B10; border-color: #F0B90B40; }
.step-pill.active .pill-num   { background: var(--accent); }
.step-pill.active .pill-label { color: var(--accent); font-weight: 800; }

/* ── Pages ───────────────────────────────────────────── */
.page { display: none; animation: fadeUp .35s ease both; }
.page.active { display: block; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Card ────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.card-head {
  display: flex; align-items: flex-start; gap: .9rem;
  margin-bottom: 1.25rem;
}
.card-icon {
  width: 38px; height: 38px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.icon-blue   { background: #378ADD20; color: var(--blue); }
.icon-yellow { background: #F0B90B20; color: var(--accent); }
.icon-green  { background: #16c78420; color: var(--green); }
.card-title  { font-size: 1rem; font-weight: 700; color: #fff; }
.card-sub    { font-size: .8rem; color: var(--text2); margin-top: .2rem; line-height: 1.55; }
.card-sub em { color: var(--accent); font-style: normal; }

/* ── Form fields ─────────────────────────────────────── */
.field { margin-bottom: .9rem; }
.field label, .field-label {
  display: block;
  font-size: .72rem; font-weight: 600;
  color: var(--text2); text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: .4rem;
}
.field input, .field select {
  width: 100%;
  background: #0a0f18;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .65rem .9rem;
  color: var(--text);
  font-size: .9rem;
  font-family: var(--mono);
  outline: none;
  transition: border .2s;
}
.field input:focus, .field select:focus { border-color: var(--accent); }
.field input:disabled {
  opacity: .4; cursor: not-allowed;
  background: var(--card2);
}
.field-hint { font-size: .72rem; color: var(--muted); margin-top: .3rem; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
}
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

.input-eye { position: relative; }
.input-eye input { padding-right: 2.5rem; }
.eye-btn {
  position: absolute; right: .7rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--muted); display: flex; align-items: center;
}
.eye-btn:hover { color: var(--text2); }

/* ── Toggle switch ───────────────────────────────────── */
.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  background: #0a0f18;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .75rem 1rem;
  margin-bottom: .9rem;
}
.trow-name { font-size: .87rem; font-weight: 600; color: var(--text); }
.trow-sub  { font-size: .75rem; color: var(--text2); margin-top: .15rem; }
.toggle-sw { position: relative; display: inline-block; }
.toggle-sw input { display: none; }
.sw-track {
  display: block; width: 42px; height: 24px;
  background: var(--muted); border-radius: 24px;
  cursor: pointer; transition: background .25s;
  position: relative;
}
.sw-thumb {
  position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px;
  background: #fff; border-radius: 50%;
  transition: transform .25s;
}
.toggle-sw input:checked ~ .sw-track { background: var(--accent); }
.toggle-sw input:checked ~ .sw-track .sw-thumb { transform: translateX(18px); }

/* ── Mode selector ───────────────────────────────────── */
.mode-grid {
  display: grid; grid-template-columns: repeat(3,1fr); gap: .6rem;
  margin-bottom: .5rem;
}
.mode-card {
  background: #0a0f18;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .75rem;
  text-align: center;
  cursor: pointer; transition: all .2s;
}
.mode-card:hover { border-color: var(--border2); }
.mode-card.active-mode { border-color: var(--green); background: #16c78408; }
.mode-dot {
  width: 8px; height: 8px; border-radius: 50%;
  margin: 0 auto .4rem;
}
.mode-name { font-size: .8rem; font-weight: 700; }
.mode-vals { font-size: .68rem; color: var(--text2); margin-top: .2rem; font-family: var(--mono); }

/* ── Check grid ──────────────────────────────────────── */
.check-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .6rem; margin-bottom: 1rem;
}
.check-item {
  background: #0a0f18; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: .75rem 1rem;
}
.chk-label {
  font-size: .68rem; color: var(--text3);
  text-transform: uppercase; letter-spacing: .5px;
  margin-bottom: .3rem;
}
.chk-val {
  font-size: .85rem; font-family: var(--mono);
  font-weight: 600;
}
.chk-val.pending { color: var(--muted); }
.chk-val.ok      { color: var(--green); }
.chk-val.error   { color: var(--red); }

/* ── Log box ─────────────────────────────────────────── */
.log-box {
  background: #060a10;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .9rem 1rem;
  font-family: var(--mono);
  font-size: .76rem;
  color: var(--text2);
  min-height: 80px; max-height: 220px;
  overflow-y: auto; line-height: 2;
}
.log-ok   { color: var(--green); }
.log-err  { color: var(--red); }
.log-info { color: var(--accent); }
.log-wait { color: var(--text2); }

/* ── Progress ────────────────────────────────────────── */
.progress-wrap { margin-bottom: 1.25rem; }
.progress-header {
  display: flex; justify-content: space-between;
  font-size: .8rem; margin-bottom: .5rem;
}
.progress-label { color: var(--text2); }
.progress-pct   { color: var(--accent); font-weight: 700; font-family: var(--mono); }
.progress-track {
  height: 6px; background: var(--border);
  border-radius: 20px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--accent);
  border-radius: 20px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
  width: 0;
}

/* ── Install steps ───────────────────────────────────── */
.install-steps { display: flex; flex-direction: column; gap: .5rem; }
.ist-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .6rem .9rem;
  background: #0a0f18; border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: .82rem;
  transition: all .3s;
}
.ist-row.done    { border-color: #16c78430; background: #16c78408; }
.ist-row.active  { border-color: #F0B90B40; background: #F0B90B08; }
.ist-row.error   { border-color: #f6465d40; background: #f6465d08; }
.ist-icon { width: 20px; height: 20px; flex-shrink: 0; }
.ist-name { flex: 1; color: var(--text2); }
.ist-row.done   .ist-name  { color: var(--green); }
.ist-row.active .ist-name  { color: var(--accent); }
.ist-row.error  .ist-name  { color: var(--red); }

@keyframes spin { to { transform: rotate(360deg); } }
.spin-icon { animation: spin .7s linear infinite; }

/* ── Cron blocks ─────────────────────────────────────── */
.cron-block {
  background: #060a10;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: .85rem 1rem;
  position: relative;
}
.cron-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .75rem; color: var(--text2);
  margin-bottom: .5rem;
}
.cron-badge {
  font-size: .65rem; font-weight: 700;
  padding: 2px 7px; border-radius: 20px;
  background: #F0B90B20; color: var(--accent);
}
.cron-badge-b { background: #378ADD20; color: var(--blue); }
.cron-code {
  font-family: var(--mono); font-size: .76rem;
  color: var(--green); word-break: break-all; line-height: 1.7;
  padding-right: 4rem;
}
.copy-btn {
  position: absolute; top: .75rem; right: .75rem;
  display: flex; align-items: center; gap: .3rem;
  background: var(--border); border: none;
  color: var(--text2); padding: .3rem .6rem;
  border-radius: 6px; font-size: .72rem;
  cursor: pointer; font-family: var(--sans);
  transition: all .2s;
}
.copy-btn:hover { background: var(--border2); color: var(--accent); }
.copy-btn.copied { color: var(--green); }

/* ── Info / warn boxes ───────────────────────────────── */
.info-box {
  display: flex; align-items: flex-start; gap: .6rem;
  background: #378ADD0c; border: 1px solid #378ADD30;
  border-radius: var(--r-sm); padding: .75rem 1rem;
  font-size: .8rem; color: #7ab8e8; line-height: 1.55;
}
.warn-box {
  display: flex; align-items: flex-start; gap: .6rem;
  background: #f6465d0c; border: 1px solid #f6465d30;
  border-radius: var(--r-sm); padding: .75rem 1rem;
  font-size: .8rem; color: #e88; line-height: 1.55;
}
.warn-box code, .info-box code {
  font-family: var(--mono); font-size: .76rem;
  background: rgba(255,255,255,.06); padding: 1px 5px; border-radius: 4px;
}

/* ── Telegram result ─────────────────────────────────── */
.tg-result {
  font-size: .8rem; margin-top: .5rem; min-height: 1.2rem; line-height: 1.5;
}

/* ── Success banner ──────────────────────────────────── */
.success-banner {
  text-align: center;
  padding: 2rem;
  background: #16c7840c;
  border: 1px solid #16c78430;
  border-radius: var(--r);
  margin-bottom: 1rem;
}
.success-check {
  width: 64px; height: 64px; border-radius: 50%;
  background: #16c78420; border: 2px solid #16c78440;
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: .9rem;
}
.success-title { font-size: 1.4rem; font-weight: 800; color: var(--green); margin-bottom: .4rem; }
.success-sub   { font-size: .85rem; color: var(--text2); line-height: 1.6; }

/* ── Summary grid ────────────────────────────────────── */
.summary-grid {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: .5rem;
}
.sum-item {
  background: #0a0f18; border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: .65rem .85rem;
}
.sum-key { font-size: .68rem; color: var(--text3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: .25rem; }
.sum-val { font-size: .88rem; font-family: var(--mono); color: var(--green); }

/* ── Buttons ─────────────────────────────────────────── */
.btn-row {
  display: flex; gap: .6rem;
  margin-top: .25rem; margin-bottom: .25rem;
}
.btn {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .75rem 1.25rem;
  border-radius: var(--r-sm);
  font-size: .9rem; font-weight: 700;
  font-family: var(--sans); cursor: pointer;
  border: none; transition: all .2s;
  letter-spacing: .2px;
}
.btn-primary {
  flex: 1; justify-content: center;
  background: var(--accent); color: #0a0d12;
}
.btn-primary:hover   { background: #d4a20a; transform: translateY(-1px); }
.btn-primary:disabled{ opacity: .35; cursor: not-allowed; transform: none; }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text2);
}
.btn-ghost:hover { border-color: var(--border2); color: var(--text); }
.btn-sm { padding: .5rem .9rem; font-size: .8rem; }
