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

:root {
  --bg: #0A0A0D;
  --surface: rgba(255,255,255,0.03);
  --surface-hover: rgba(255,255,255,0.06);
  --border: rgba(255,255,255,0.08);
  --border-hover: rgba(255,255,255,0.15);
  --text: #ffffff;
  --text-muted: rgba(255,255,255,0.55);
  --text-dim: rgba(255,255,255,0.35);
  --cyan: #00D2FF;
  --cyan-glow: rgba(0,210,255,0.4);
  --purple: #C084FC;
  --purple-raw: 147,51,234;
  --green: #4ADE80;
  --green-raw: 34,197,94;
  --orange: #FB923C;
  --pink: #F472B6;
  --red: #EF4444;
  --amber: #FBBF24;
  --radius: 16px;
  --radius-sm: 10px;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Background glows */
.glow {
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 50%;
}
.glow-cyan {
  width: 700px; height: 700px;
  top: -200px; right: -100px;
  background: radial-gradient(circle, rgba(0,210,255,0.08) 0%, transparent 70%);
}
.glow-purple {
  width: 600px; height: 600px;
  bottom: -150px; left: -100px;
  background: radial-gradient(circle, rgba(var(--purple-raw),0.06) 0%, transparent 70%);
}

/* Steps */
.step {
  display: none;
  min-height: 100vh;
  padding: 60px 24px 100px;
  position: relative;
  z-index: 1;
}
.step.active { display: flex; align-items: flex-start; justify-content: center; }
.step-inner {
  width: 100%;
  max-width: 720px;
  animation: fadeUp 0.4s ease;
}
.step-inner.centered {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 160px);
  text-align: center;
}

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

/* Logo */
.logo-mark {
  width: 72px; height: 72px;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; font-weight: 900; color: #fff;
  margin-bottom: 24px;
  box-shadow: 0 0 40px var(--cyan-glow);
}

.title-gradient {
  font-size: 48px; font-weight: 900;
  background: linear-gradient(135deg, var(--cyan) 0%, var(--purple) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--text-muted);
  font-size: 16px; font-weight: 500;
  margin-bottom: 40px;
}

/* Step header */
.step-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 100px;
  font-size: 12px; font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: rgba(0,210,255,0.12);
  color: var(--cyan);
  border: 1px solid rgba(0,210,255,0.25);
  margin-bottom: 16px;
}
.step-header h2 {
  font-size: 28px; font-weight: 800;
  margin-bottom: 10px;
}
.step-desc {
  color: var(--text-muted);
  font-size: 15px; line-height: 1.6;
  margin-bottom: 28px;
}

/* Inputs */
.input-group {
  display: flex; gap: 10px;
  width: 100%; max-width: 380px;
}
input, textarea {
  width: 100%;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
  resize: vertical;
}
input:focus, textarea:focus {
  border-color: var(--cyan);
  background: rgba(0,210,255,0.04);
}
input::placeholder, textarea::placeholder {
  color: var(--text-dim);
}
textarea { line-height: 1.65; }

/* Buttons */
.btn-primary {
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--cyan) 0%, #0099cc 100%);
  color: #000; font-weight: 700; font-size: 15px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
  font-family: inherit;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 20px var(--cyan-glow);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-secondary {
  padding: 13px 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-weight: 600; font-size: 15px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  font-family: inherit;
}
.btn-secondary:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
}
.btn-ghost {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 500; font-size: 14px;
  cursor: pointer;
  transition: color 0.2s;
  font-family: inherit;
}
.btn-ghost:hover { color: var(--text); }

.step-actions {
  display: flex; gap: 12px; margin-top: 20px;
  flex-wrap: wrap;
}

/* Error */
.error-text {
  color: var(--red);
  font-size: 13px; font-weight: 500;
  margin-top: 12px;
}

/* Loading */
.loading {
  display: flex; align-items: center; gap: 12px;
  margin-top: 20px;
  color: var(--text-muted); font-size: 14px;
}
.spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Objective reminder */
.objective-reminder {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  line-height: 1.5;
}
.reminder-label {
  color: var(--cyan);
  font-weight: 700;
  margin-right: 6px;
}

/* Hidden utility */
.hidden { display: none !important; }

/* ===== RESULTS ===== */
.results-view { max-width: 800px; }

/* Score hero */
.score-hero {
  display: flex;
  align-items: center;
  gap: 32px;
  margin-bottom: 32px;
  padding: 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.score-ring {
  position: relative;
  width: 120px; height: 120px;
  flex-shrink: 0;
}
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring-bg {
  fill: none;
  stroke: rgba(255,255,255,0.06);
  stroke-width: 8;
}
.score-ring-fill {
  fill: none;
  stroke: var(--cyan);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1s ease, stroke 0.4s;
}
.score-value {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; font-weight: 900;
}
.score-meta { display: flex; flex-direction: column; gap: 4px; }
.score-label {
  font-size: 22px; font-weight: 800;
}
.score-points {
  color: var(--text-muted);
  font-size: 15px; font-weight: 500;
}
.score-comparison {
  font-size: 13px; font-weight: 600;
  margin-top: 4px;
}
.score-comparison.improved { color: var(--green); }
.score-comparison.declined { color: var(--red); }
.score-comparison.same { color: var(--text-muted); }

/* Color coding */
.score-red { --score-color: var(--red); }
.score-amber { --score-color: var(--amber); }
.score-green { --score-color: var(--green); }

/* Overall feedback */
.overall-feedback {
  background: rgba(0,210,255,0.04);
  border-left: 3px solid var(--cyan);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 20px 24px;
  margin-bottom: 32px;
  font-size: 15px; line-height: 1.7;
  color: rgba(255,255,255,0.8);
}

/* Criteria list */
.criteria-heading {
  font-size: 18px; font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-muted);
}
.criteria-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 32px;
}
.criterion-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.criterion-card:hover { border-color: var(--border-hover); }

.criterion-header {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  cursor: pointer;
  user-select: none;
}
.criterion-status {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
  flex-shrink: 0;
}
.criterion-status.passed {
  background: rgba(var(--green-raw), 0.15);
  color: var(--green);
}
.criterion-status.failed {
  background: rgba(239,68,68,0.15);
  color: var(--red);
}
.criterion-info { flex: 1; min-width: 0; }
.criterion-name {
  font-size: 15px; font-weight: 700;
  margin-bottom: 6px;
}
.criterion-bar-track {
  height: 6px;
  background: rgba(255,255,255,0.06);
  border-radius: 3px;
  overflow: hidden;
}
.criterion-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease;
}
.criterion-score-text {
  font-size: 14px; font-weight: 700;
  white-space: nowrap;
  color: var(--text-muted);
}
.criterion-chevron {
  font-size: 12px;
  color: var(--text-dim);
  transition: transform 0.2s;
}
.criterion-card.expanded .criterion-chevron { transform: rotate(180deg); }

.criterion-body {
  display: none;
  padding: 0 20px 18px 62px;
  font-size: 14px; line-height: 1.7;
  color: rgba(255,255,255,0.7);
}
.criterion-card.expanded .criterion-body { display: block; }

/* Results actions */
.results-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* Run output panel */
.run-output-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-top: 24px;
  animation: fadeUp 0.3s ease;
}
.run-output-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.run-output-header h3 {
  font-size: 16px; font-weight: 700;
}
.run-output-content {
  background: rgba(0,0,0,0.3);
  border-radius: var(--radius-sm);
  padding: 20px;
  font-size: 14px; line-height: 1.7;
  color: rgba(255,255,255,0.8);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 500px;
  overflow-y: auto;
}

/* Footer */
.site-footer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  padding: 12px 24px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  background: linear-gradient(to top, var(--bg) 60%, transparent);
  z-index: 10;
}
.footer-sep { margin: 0 8px; }

/* Responsive */
@media (max-width: 640px) {
  .score-hero { flex-direction: column; text-align: center; gap: 20px; }
  .title-gradient { font-size: 36px; }
  .step-header h2 { font-size: 22px; }
  .step { padding: 40px 16px 80px; }
}
