/* HaltWatch — global styles
   Aesthetic: Bloomberg terminal × modern SaaS.
   Palette: dark navy bg, cyan accent, red alert. */

:root {
  --bg: #0A1628;
  --bg-elev: #0F1E36;
  --bg-elev-2: #14274A;
  --border: #1F2F4F;
  --border-strong: #2A3F66;
  --fg: #E7EEFA;
  --fg-dim: #B7C4DC;
  --fg-muted: #8FA3C7;
  --accent: #00B4D8;
  --accent-hot: #2BD4F2;
  --alert: #FF3B6B;
  --alert-deep: #C9264F;
  --green: #2BD46B;
  --amber: #FFB84D;
  --shadow: 0 8px 32px rgba(0,0,0,.45);
  --radius: 12px;
  --radius-sm: 8px;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hot); text-decoration: underline; }

button, .btn {
  cursor: pointer;
  border: 0;
  background: var(--accent);
  color: #061321;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--sans);
  transition: background .15s ease, transform .05s ease;
}
button:hover, .btn:hover { background: var(--accent-hot); }
button:active, .btn:active { transform: translateY(1px); }
button:disabled, .btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--bg-elev-2); color: var(--accent-hot); }

.btn-alert {
  background: var(--alert);
  color: #fff;
}
.btn-alert:hover { background: var(--alert-deep); }

input, select, textarea {
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
label { display: block; margin: 14px 0 6px; color: var(--fg-dim); font-size: 13px; font-weight: 600; }

/* ---------- Layout ---------- */
.container { max-width: 1240px; margin: 0 auto; padding: 0 24px; }
.container-narrow { max-width: 560px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10,22,40,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  max-width: 1240px; margin: 0 auto;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 18px; color: var(--fg);
  text-decoration: none; letter-spacing: -.02em;
}
.brand .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--alert);
  box-shadow: 0 0 12px var(--alert);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .55; transform: scale(.85); }
}
.nav-links { display: flex; gap: 22px; align-items: center; }
.nav-links a { color: var(--fg-dim); font-size: 14px; }
.nav-links a:hover { color: var(--accent-hot); text-decoration: none; }
.nav-links a.active { color: var(--accent); }

/* ---------- Hero / marketing ---------- */
.hero { padding: 96px 0 64px; text-align: center; }
.hero h1 {
  font-size: clamp(34px, 5.2vw, 64px);
  line-height: 1.05; margin: 0 0 16px;
  letter-spacing: -.03em; font-weight: 800;
}
.hero h1 .accent { color: var(--accent); }
.hero p.lede {
  color: var(--fg-dim); font-size: 18px; max-width: 640px; margin: 0 auto 32px;
}
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.kicker {
  display: inline-block; padding: 6px 12px;
  background: rgba(0,180,216,.12); color: var(--accent);
  border-radius: 999px; font-size: 12px; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; margin-bottom: 18px;
}

.section { padding: 64px 0; }
.section h2 {
  font-size: clamp(26px, 3.4vw, 36px); margin: 0 0 12px;
  letter-spacing: -.02em; font-weight: 800;
}
.section .sub { color: var(--fg-muted); margin-bottom: 36px; max-width: 580px; }

.feature-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.feature {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  transition: border-color .15s ease, transform .15s ease;
}
.feature:hover { border-color: var(--accent); transform: translateY(-2px); }
.feature .icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(0,180,216,.12); color: var(--accent);
  display: grid; place-items: center; font-size: 18px; margin-bottom: 14px;
}
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--fg-muted); font-size: 14px; }

/* ---------- Pricing ---------- */
.price-grid {
  display: grid; gap: 22px;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 920px; margin: 0 auto;
}
.price {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}
.price.featured {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}
.price .badge {
  position: absolute; top: -12px; right: 18px;
  background: var(--accent); color: #061321;
  padding: 4px 10px; border-radius: 999px; font-size: 11px; font-weight: 800;
  letter-spacing: .08em; text-transform: uppercase;
}
.price h3 { margin: 0; font-size: 22px; }
.price .amt { font-size: 44px; font-weight: 800; margin: 12px 0 0; letter-spacing: -.02em; }
.price .amt small { font-size: 14px; color: var(--fg-muted); font-weight: 500; }
.price ul { list-style: none; padding: 0; margin: 18px 0 22px; }
.price li {
  padding: 7px 0; color: var(--fg-dim); font-size: 14px;
  display: flex; align-items: center; gap: 10px;
}
.price li::before {
  content: "✓"; color: var(--accent); font-weight: 800; font-size: 16px;
}
.price li.no::before { content: "—"; color: var(--fg-muted); }
.price .cta { width: 100%; }

/* ---------- Cards / forms ---------- */
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.alert-box {
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin: 12px 0;
}
.alert-error { background: rgba(255,59,107,.12); color: #FFADC0; border: 1px solid rgba(255,59,107,.4); }
.alert-success { background: rgba(43,212,107,.12); color: #B6F1CF; border: 1px solid rgba(43,212,107,.4); }
.alert-info { background: rgba(0,180,216,.12); color: #BBE9F8; border: 1px solid rgba(0,180,216,.4); }

/* ---------- Footer ---------- */
.footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 32px 0;
  color: var(--fg-muted);
  font-size: 13px;
  text-align: center;
}
.footer a { color: var(--fg-dim); margin: 0 10px; }

/* ---------- Utility ---------- */
.row { display: flex; gap: 12px; align-items: center; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--fg-muted); }
.mono { font-family: var(--mono); }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: var(--bg-elev-2); color: var(--fg-dim); font-size: 11px;
  font-family: var(--mono); letter-spacing: .04em;
}
.tag.hot { background: rgba(255,59,107,.18); color: #FFADC0; }
.tag.ok  { background: rgba(43,212,107,.18); color: #B6F1CF; }
.tag.cool{ background: rgba(0,180,216,.18); color: #BBE9F8; }

/* ---------- Dashboard ---------- */
.dash {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 18px;
  padding: 18px 24px;
  max-width: 1480px;
  margin: 0 auto;
}
@media (max-width: 960px) { .dash { grid-template-columns: 1fr; } }

.statbar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px;
}
@media (max-width: 720px) { .statbar { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--bg-elev); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
}
.stat .k { font-size: 11px; color: var(--fg-muted); text-transform: uppercase; letter-spacing: .12em; }
.stat .v { font-size: 26px; font-weight: 800; margin-top: 4px; font-family: var(--mono); }
.stat.alert .v { color: var(--alert); }
.stat.cool .v { color: var(--accent); }

.toolbar {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 12px;
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
}
.toolbar input, .toolbar select { width: auto; flex: 0 0 auto; min-width: 140px; padding: 8px 10px; }

.halt-table-wrap {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.halt-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.halt-table thead th {
  text-align: left; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--fg-muted); background: var(--bg-elev-2);
  padding: 10px 14px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0;
}
.halt-table tbody td {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.halt-table tbody tr:hover { background: rgba(0,180,216,.05); }
.halt-table .ticker { font-weight: 800; font-family: var(--mono); font-size: 14px; }
.halt-table .code  { font-family: var(--mono); font-size: 12px; }
.halt-table tr.flash { animation: flash 1.4s ease; }
@keyframes flash {
  0%   { background: rgba(0,180,216,.30); }
  100% { background: transparent; }
}
.halt-table tr.flash-alert { animation: flashAlert 1.4s ease; }
@keyframes flashAlert {
  0%   { background: rgba(255,59,107,.32); }
  100% { background: transparent; }
}

.dir-up   { color: var(--green); }
.dir-down { color: var(--alert); }

.sidebar {
  display: flex; flex-direction: column; gap: 14px;
}
.panel {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 16px;
}
.panel h4 {
  margin: 0 0 10px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--fg-muted);
}
.activity { list-style: none; padding: 0; margin: 0; max-height: 420px; overflow: auto; }
.activity li {
  padding: 8px 0; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 10px; font-size: 13px;
}
.activity li:last-child { border-bottom: 0; }
.activity .t { color: var(--fg-muted); font-family: var(--mono); font-size: 11px; }

.market-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--bg-elev-2);
}
.market-status .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
}
.market-status.closed   .dot { background: var(--fg-muted); }
.market-status.pre      .dot { background: var(--amber); }
.market-status.after    .dot { background: var(--amber); }
.market-status.open     .dot { background: var(--green); animation: pulse 1.6s ease-in-out infinite; }

/* Scrolling ticker tape */
.ticker-tape {
  background: var(--bg-elev);
  border-top: 1px solid var(--border);
  overflow: hidden;
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 36px;
  display: flex; align-items: center;
  z-index: 30;
}
.ticker-tape .label {
  background: var(--alert); color: #fff;
  padding: 0 12px; height: 100%; display: grid; place-items: center;
  font-size: 11px; font-weight: 800; letter-spacing: .12em;
}
.ticker-tape .stream {
  white-space: nowrap; padding-left: 12px;
  animation: marquee 60s linear infinite;
  font-family: var(--mono); font-size: 13px;
}
.ticker-tape .stream span { margin-right: 32px; color: var(--fg-dim); }
.ticker-tape .stream span b { color: var(--accent); margin-right: 6px; }
@keyframes marquee {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Free tier banner */
.upgrade-banner {
  background: linear-gradient(90deg, rgba(255,59,107,.12), rgba(0,180,216,.12));
  border: 1px solid var(--border-strong);
  padding: 10px 16px;
  border-radius: var(--radius);
  margin: 0 24px 14px;
  max-width: 1432px; margin-left: auto; margin-right: auto;
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  font-size: 14px;
}

.toggle {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.toggle:last-child { border-bottom: 0; }
.toggle .label-block { display: flex; flex-direction: column; }
.toggle .label-block strong { color: var(--fg); }
.toggle .label-block small { color: var(--fg-muted); font-size: 12px; }

.switch {
  position: relative; width: 44px; height: 24px; flex: 0 0 auto;
}
.switch input { display: none; }
.switch .slider {
  position: absolute; inset: 0; background: var(--bg-elev-2);
  border: 1px solid var(--border-strong); border-radius: 24px;
  transition: background .15s ease;
  cursor: pointer;
}
.switch .slider::before {
  content: ""; position: absolute; left: 2px; top: 1px;
  width: 18px; height: 18px; background: var(--fg-dim); border-radius: 50%;
  transition: transform .15s ease, background .15s ease;
}
.switch input:checked + .slider { background: rgba(0,180,216,.30); border-color: var(--accent); }
.switch input:checked + .slider::before { transform: translateX(20px); background: var(--accent); }

/* Mobile tweaks */
@media (max-width: 600px) {
  .nav-links { gap: 12px; }
  .nav-links a { font-size: 13px; }
  .halt-table thead th, .halt-table tbody td { padding: 10px 8px; font-size: 12px; }
}
