/*
 * CareerPlane — interactive-tool scaffold shared styles (Sprint-0.3).
 *
 * Each scaffold file consumes --cp-* variables so the themes-visualizer
 * and, later, the Sprint-1 portal can swap themes without touching
 * component internals. Every rule is non-animated by default; the
 * scaffold opts in to motion only inside a `@media (prefers-reduced-motion: no-preference)`
 * block, honoring the design.md §2.1 "reduced-motion respected" rule.
 */

:root {
  --cp-bg: #ffffff;
  --cp-bg-elev: #f8fafc;
  --cp-fg: #0f172a;
  --cp-fg-muted: #475569;
  --cp-border: #e2e8f0;
  --cp-primary: #2563eb;
  --cp-accent: #f59e0b;
  --cp-radius: 0.75rem;
  --cp-shadow: 0 1px 3px 0 rgba(0, 0, 0, .08), 0 1px 2px -1px rgba(0, 0, 0, .04);
  --cp-gap: 0.75rem;
  --cp-tap: 44px;
}

[data-cp-theme-mode="dark"] {
  --cp-bg: #0b1220;
  --cp-bg-elev: #111827;
  --cp-fg: #e5e7eb;
  --cp-fg-muted: #94a3b8;
  --cp-border: #1f2937;
  --cp-primary: #60a5fa;
  --cp-accent: #fbbf24;
  --cp-shadow: 0 1px 3px 0 rgba(0, 0, 0, .5), 0 1px 2px -1px rgba(0, 0, 0, .3);
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--cp-bg);
  color: var(--cp-fg);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

h1, h2, h3 {
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

/* Every interactive control must have a visible focus ring regardless of
 * theme (§2.1 rule #1 keyboard-first). */
button,
[role="button"],
select,
input,
a,
summary,
[tabindex] {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--cp-primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.cp-card {
  background: var(--cp-bg-elev);
  border: 1px solid var(--cp-border);
  border-radius: var(--cp-radius);
  box-shadow: var(--cp-shadow);
  padding: var(--cp-gap);
}

.cp-btn {
  background: var(--cp-primary);
  color: #ffffff;
  border: 0;
  border-radius: var(--cp-radius);
  padding: 0.5rem 1rem;
  font-size: 1rem;
  cursor: pointer;
  min-height: var(--cp-tap);
}

.cp-btn-ghost {
  background: transparent;
  color: var(--cp-primary);
  border: 1px solid var(--cp-primary);
}

.cp-chip {
  display: inline-block;
  padding: 0.125rem 0.5rem;
  font-size: 0.75rem;
  background: var(--cp-bg-elev);
  border: 1px solid var(--cp-border);
  border-radius: 9999px;
  color: var(--cp-fg-muted);
}

.cp-stack > * + * {
  margin-top: var(--cp-gap);
}

.cp-row {
  display: flex;
  align-items: center;
  gap: var(--cp-gap);
  flex-wrap: wrap;
}

.cp-muted {
  color: var(--cp-fg-muted);
}

[hidden] {
  display: none !important;
}

/* Scaffold-wide motion gate: any rule under this block only applies when
 * the user has NOT asked the OS to reduce motion. */
@media (prefers-reduced-motion: no-preference) {
  .cp-animate {
    transition: transform 150ms ease-out, opacity 150ms ease-out;
  }
}
