/* Enhanced theme with animations and print styles */
:root {
  --bg: #0b1020;
  --card: #0b1223;
  --text: #e8eef7;
  --muted: #a9b4c8;
  --accent: #8b5cf6;     /* purple */
  --accent-2: #22c55e;   /* green */
  --accent-3: #38bdf8;   /* cyan */
  --danger: #f87171;
  --shadow: 0 12px 36px rgba(0,0,0,.45);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji';
  background: radial-gradient(1200px 600px at 10% -10%, #1a2440 0%, var(--bg) 40%);
  color: var(--text);
  line-height: 1.55;
}

.site-header, .site-footer {
  text-align: center;
  padding: 24px 16px;
}
.site-header h1 { margin: 0 0 6px 0; font-weight: 800; letter-spacing: .3px; }
.subtitle { margin: 0; color: var(--muted); }

#app {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

.card {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.00));
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 22px;
  margin: 16px 0 28px;
}

h2 { margin-top: 0; }

.primary, .secondary, .ghost {
  appearance: none;
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 16px;
  cursor: pointer;
  transition: transform .06s ease;
}
.primary:hover, .secondary:hover, .ghost:hover { transform: translateY(-1px); }
.primary { background: var(--accent); color: #160b30; font-weight: 800; }
.primary:disabled { opacity: .6; cursor: not-allowed; }
.secondary { background: var(--accent-2); color: #062015; font-weight: 800; }
.ghost { background: transparent; color: var(--text); border: 1px solid rgba(255,255,255,.20); }

#progressRow { display: grid; gap: 8px; }
#progressText { color: var(--muted); font-size: 14px; }
#progressBar { height: 10px; background: rgba(255,255,255,.10); border-radius: 999px; overflow: hidden; }
#progressFill { display: block; height: 10px; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-3)); transition: width .4s ease; }

.scale { display: grid; gap: 10px; align-items: center; }
.scale-label { color: var(--muted); font-size: 14px; }
.scale-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(60px, 1fr));
  gap: 10px;
}
.scale-options button {
  background: rgba(255,255,255,.06);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.16);
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  transition: background .2s ease, outline-color .2s ease;
}
.scale-options button[aria-checked="true"] {
  outline: 2px solid var(--accent-3);
  background: rgba(56,189,248,.22);
}

.nav-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  align-items: start;
}

.bars { display: grid; gap: 22px; margin-top: 6px; }
.bar {
  height: 16px;
  background: rgba(255,255,255,.10);
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-3));
  transition: width 900ms cubic-bezier(.2,.8,.2,1);
}
.bar .label { position: absolute; left: 10px; top: -22px; font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.bar .value { position: absolute; right: 10px; top: -22px; font-size: 13px; color: var(--muted); }

.legend { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: 13px; }
.legend .dot { width: 10px; height: 10px; border-radius: 999px; display: inline-block; }
.legend .dot.purple { background: var(--accent); }
.legend .dot.green { background: var(--accent-2); }
.legend .dot.cyan { background: var(--accent-3); }

.grid-caption { color: var(--muted); }

/* SVG grid theme */
#grid .axis { stroke: rgba(255,255,255,.3); stroke-width: 1; }
#grid .tick { stroke: rgba(255,255,255,.12); stroke-width: .6; }
#grid .point { fill: var(--accent-2); stroke: #052019; stroke-width: 2; }
#grid .quadrant { fill: rgba(255,255,255,.03); }
#grid .label { fill: var(--muted); font-size: 10px; }

.explainer {
  border-left: 4px solid var(--accent-3);
  padding: 10px 14px;
  background: rgba(56,189,248,.08);
  border-radius: 8px;
  color: var(--text);
}

.icon {
  font-size: 18px;
  width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
}

/* Print layout for PDF export */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer { color: #000; }
  .card { box-shadow: none; border-color: #ddd; background: #fff; }
  .primary, .secondary, .ghost { display: none !important; }
  #intro { display: none !important; }
  #quiz { display: none !important; }
  #result { display: block !important; }
}
