/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:        #0b0f1a;
  --surface:   #111827;
  --surface2:  #1a2236;
  --border:    #1f2d45;
  --orange:    #f97316;
  --orange-dim:#7c3d17;
  --blue:      #3b82f6;
  --text:      #e2e8f0;
  --muted:     #64748b;
  --muted2:    #94a3b8;
  --radius:    14px;
  --shadow:    0 4px 24px rgba(0,0,0,.45);
}

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

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11,15,26,.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 60px;
  display: flex;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: .65rem;
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--text);
}

.ball-icon { width: 28px; height: 28px; flex-shrink: 0; }

/* ── Main layout ───────────────────────────────────────────── */
main {
  flex: 1;
  max-width: 900px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

/* ── Hero ──────────────────────────────────────────────────── */
.hero { text-align: center; }

.hero-tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--orange);
  background: rgba(249,115,22,.1);
  border: 1px solid rgba(249,115,22,.25);
  padding: .35rem .9rem;
  border-radius: 99px;
  margin-bottom: 1.25rem;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin-bottom: 1rem;
}

.accent { color: var(--orange); }

.hero-sub {
  color: var(--muted2);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 560px;
  margin: 0 auto;
}

/* ── Card ──────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.card-header { margin-bottom: 1.75rem; }
.card-header h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: .3rem; }
.card-header p  { font-size: .85rem; color: var(--muted); }

/* ── Form ──────────────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
}

.form-group { display: flex; flex-direction: column; gap: .45rem; }

label {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted2);
}

input, select {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: .95rem;
  padding: .65rem .9rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  appearance: none;
}

input:focus, select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(249,115,22,.15);
}

input::placeholder { color: var(--muted); }

/* select wrapper */
.select-wrapper { position: relative; }
.select-wrapper select { padding-right: 2.2rem; cursor: pointer; }
.chevron {
  position: absolute;
  right: .75rem; top: 50%;
  transform: translateY(-50%);
  width: 16px; height: 16px;
  color: var(--muted);
  pointer-events: none;
}

/* height row */
.height-row { display: flex; gap: .6rem; }
.unit-input { position: relative; flex: 1; }
.unit-input input { padding-right: 2.5rem; }
.unit-label {
  position: absolute;
  right: .75rem; top: 50%;
  transform: translateY(-50%);
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  pointer-events: none;
}

/* ── Predict button ────────────────────────────────────────── */
.predict-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  width: 100%;
  padding: .85rem 1.5rem;
  background: var(--orange);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .2s, transform .1s, box-shadow .2s;
  box-shadow: 0 4px 16px rgba(249,115,22,.35);
}

.predict-btn:hover {
  background: #ea6b0e;
  box-shadow: 0 6px 22px rgba(249,115,22,.45);
}

.predict-btn:active { transform: scale(.98); }

.predict-btn:disabled {
  background: var(--orange-dim);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-arrow { width: 18px; height: 18px; flex-shrink: 0; }

.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error ─────────────────────────────────────────────────── */
.error-msg {
  margin-bottom: 1rem;
  padding: .75rem 1rem;
  background: rgba(239,68,68,.1);
  border: 1px solid rgba(239,68,68,.3);
  border-radius: 8px;
  color: #f87171;
  font-size: .9rem;
}

/* ── Results header ────────────────────────────────────────── */
.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.results-header h2 { font-size: 1.4rem; font-weight: 800; }

.prospect-pill {
  background: rgba(249,115,22,.12);
  border: 1px solid rgba(249,115,22,.3);
  color: var(--orange);
  font-size: .85rem;
  font-weight: 600;
  padding: .4rem 1rem;
  border-radius: 99px;
}

/* ── Stat cards ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 640px) {
  .stats-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  box-shadow: var(--shadow);
  transition: border-color .2s;
}

.stat-card:hover { border-color: rgba(249,115,22,.35); }

.stat-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
}

.fg-icon  { background: rgba(249,115,22,.15); color: var(--orange); }
.trb-icon { background: rgba(59,130,246,.15);  color: var(--blue); }
.ast-icon { background: rgba(34,197,94,.15);   color: #22c55e; }

.stat-body { flex: 1; }
.stat-label { font-size: .75rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin-bottom: .3rem; }
.stat-value { font-size: 2.4rem; font-weight: 800; line-height: 1; letter-spacing: -.03em; margin-bottom: .3rem; }
.stat-desc  { font-size: .8rem; color: var(--muted); }

/* confidence bar */
.confidence-bar { display: flex; flex-direction: column; gap: .4rem; }
.conf-label { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); }
.conf-track { height: 4px; background: var(--border); border-radius: 99px; overflow: hidden; }
.conf-fill  { height: 100%; background: var(--orange); border-radius: 99px; transition: width .8s ease; }

/* ── Charts card ───────────────────────────────────────────── */
.charts-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.chart-tabs {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.tab {
  padding: .5rem 1.1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted2);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
}

.tab:hover { color: var(--text); background: var(--surface2); }

.tab.active {
  background: rgba(249,115,22,.12);
  border-color: rgba(249,115,22,.3);
  color: var(--orange);
}

.chart-plot { width: 100%; height: 480px; }

/* ── Footer ────────────────────────────────────────────────── */
footer {
  text-align: center;
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .82rem;
}
