/* Signal Grove — terminal / dashboard + auth styles
   Uses brand tokens from brand.css. */

/* ============================ AUTH ============================ */
.auth-body {
  min-height: 100vh;
  margin: 0;
}
.auth-shell {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100vh;
}
.auth-aside {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.5rem;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(92, 122, 92, 0.18), transparent 55%),
    linear-gradient(160deg, var(--charcoal), var(--basalt));
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.auth-aside::after {
  content: "";
  position: absolute;
  inset: auto -20% -30% auto;
  width: 480px; height: 480px;
  background: radial-gradient(circle, rgba(184, 149, 106, 0.12), transparent 60%);
  pointer-events: none;
}
.auth-logo { font-family: var(--font-display); font-size: 1.25rem; color: var(--parchment); display: inline-flex; align-items: center; gap: 0.55rem; }
.auth-logo span { color: var(--sage); }
.auth-aside-copy { max-width: 30rem; position: relative; z-index: 1; }
.auth-aside-copy .eyebrow { color: var(--gold); }
.auth-aside-copy h1 { font-size: clamp(2rem, 3.5vw, 3rem); color: var(--parchment); }
.auth-feature-list { list-style: none; padding: 0; margin: 1.5rem 0 0; }
.auth-feature-list li { display: flex; align-items: center; gap: 0.6rem; color: var(--text-muted); margin-bottom: 0.55rem; }
.auth-aside-foot { color: var(--sand); opacity: 0.7; position: relative; z-index: 1; }

.auth-main { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--bg); }
.auth-card { width: 100%; max-width: 22rem; }
.auth-card h2 { font-size: 1.75rem; margin-bottom: 0.25rem; }
.auth-sub { margin-bottom: 1.75rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field-label { font-size: 0.8rem; color: var(--text-muted); letter-spacing: 0.03em; }
.field input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 0.7rem 0.85rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.field input:focus {
  outline: none;
  border-color: var(--moss);
  box-shadow: 0 0 0 3px rgba(92, 122, 92, 0.2);
}
.auth-submit { width: 100%; margin-top: 0.5rem; justify-content: center; }
.auth-error {
  background: rgba(196, 125, 90, 0.14);
  border: 1px solid rgba(196, 125, 90, 0.4);
  color: var(--ember);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  font-size: 0.85rem;
}
.auth-note { color: var(--sand); opacity: 0.6; margin-top: 1.25rem; font-size: 0.75rem; }
.auth-back { display: inline-block; margin-top: 0.5rem; font-size: 0.85rem; }

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { display: none; }
}

/* ============================ DASHBOARD ============================ */
.dash-body { background: var(--bg); min-height: 100vh; }

.dash-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.7rem 1.25rem;
  background: rgba(26, 25, 23, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.dash-logo { font-family: var(--font-display); font-size: 1.05rem; color: var(--parchment); display: inline-flex; align-items: center; gap: 0.5rem; }
.dash-logo span { color: var(--sage); }
.dash-badge {
  font-size: 0.6rem; letter-spacing: 0.15em; color: var(--gold);
  border: 1px solid rgba(184, 149, 106, 0.4); border-radius: 4px;
  padding: 0.1rem 0.4rem; margin-left: 0.5rem;
}
.dash-top-right { display: flex; align-items: center; gap: 1.25rem; font-size: 0.8rem; }
.feed-status { display: inline-flex; align-items: center; gap: 0.45rem; color: var(--text-muted); }
.dash-clock { color: var(--sand); opacity: 0.7; }
.dash-user { display: inline-flex; align-items: center; gap: 0.6rem; }
.dash-user-name { color: var(--sage); }
.dash-logout {
  background: transparent; border: 1px solid var(--border); color: var(--text-muted);
  border-radius: var(--radius-sm); padding: 0.3rem 0.7rem; font-size: 0.78rem; cursor: pointer;
  transition: all var(--transition); font-family: var(--font-body);
}
.dash-logout:hover { border-color: var(--moss); color: var(--parchment); }

/* status dots */
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sage); display: inline-block; }
.status-dot.ok { background: var(--success); box-shadow: 0 0 0 3px rgba(107, 155, 107, 0.18); }
.status-dot.warn { background: var(--gold); box-shadow: 0 0 0 3px rgba(184, 149, 106, 0.18); animation: sg-pulse 1.4s infinite; }
@keyframes sg-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* ticker rail */
.ticker-rail {
  display: flex; gap: 0; overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--charcoal);
}
.ticker-cell {
  flex: 1 0 auto; min-width: 140px;
  padding: 0.6rem 1.1rem;
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 0.15rem;
}
.ticker-sym { font-size: 0.72rem; color: var(--text-muted); letter-spacing: 0.04em; }
.ticker-price { font-size: 1.05rem; color: var(--parchment); }
.ticker-chg { font-size: 0.78rem; }

/* main */
.dash-main { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }

.kpi-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.kpi-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
}
.kpi-label { font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.kpi-value { font-size: 1.65rem; color: var(--parchment); }

.dash-section { margin-bottom: 2.25rem; }
.dash-section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.dash-section-head h2 { font-size: 1.4rem; margin: 0; }
.dash-section-sub { color: var(--sand); opacity: 0.65; font-size: 0.78rem; }

/* strategy tiles */
.strategy-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.strat-tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 1.1rem; display: flex; flex-direction: column; gap: 0.7rem;
  transition: border-color var(--transition), transform var(--transition);
}
.strat-tile:hover { border-color: var(--moss); transform: translateY(-2px); }
.strat-tile-head { display: flex; align-items: flex-start; justify-content: space-between; }
.strat-asset { font-family: var(--font-display); font-size: 1.15rem; color: var(--parchment); }
.strat-name { font-size: 0.78rem; color: var(--text-muted); }
.strat-engine {
  font-size: 0.66rem; color: var(--gold); letter-spacing: 0.05em;
  border: 1px solid rgba(184, 149, 106, 0.35); border-radius: 4px; padding: 0.12rem 0.4rem;
}
.strat-price-row { display: flex; align-items: baseline; gap: 0.6rem; }
.strat-price { font-size: 1.5rem; color: var(--parchment); }
.strat-chg { font-size: 0.85rem; }
.strat-blurb { font-size: 0.8rem; color: var(--text-muted); margin: 0; line-height: 1.45; }
.strat-meta { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-size: 0.74rem; color: var(--text-muted); border-top: 1px solid var(--border); padding-top: 0.65rem; }
.strat-meta .k { color: var(--sand); opacity: 0.6; }
.strat-live { display: inline-flex; align-items: center; gap: 0.35rem; color: var(--success); margin-left: auto; }

/* up/down coloring + tick flash */
.up { color: var(--success); }
.down { color: var(--ember); }
.tick-up { animation: tickUp 0.6s ease; }
.tick-down { animation: tickDown 0.6s ease; }
@keyframes tickUp { 0% { color: var(--success); text-shadow: 0 0 12px rgba(107,155,107,0.6); } 100% {} }
@keyframes tickDown { 0% { color: var(--ember); text-shadow: 0 0 12px rgba(196,125,90,0.6); } 100% {} }

/* positions table */
.positions-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.positions-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.positions-table th {
  text-align: left; font-weight: 500; color: var(--text-muted); font-size: 0.74rem;
  letter-spacing: 0.04em; padding: 0.75rem 1rem; border-bottom: 1px solid var(--border); background: var(--charcoal);
}
.positions-table td { padding: 0.7rem 1rem; border-bottom: 1px solid rgba(61,56,50,0.5); color: var(--text); }
.positions-table tr:last-child td { border-bottom: none; }
.positions-table .num { text-align: right; }
.pos-empty td { text-align: center; color: var(--text-muted); padding: 2rem 1rem; font-size: 0.85rem; }

.dash-disclaimer { color: var(--sand); opacity: 0.55; font-size: 0.72rem; text-align: center; margin-top: 2rem; }

@media (max-width: 1000px) {
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .strategy-tiles { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .strategy-tiles { grid-template-columns: 1fr; }
  .dash-top-right { gap: 0.75rem; }
  .dash-clock { display: none; }
}
