/* ==========================================================================
   Workplace Clarity Quiz — styles.css
   Warm, minimal, calm. Earth tones. Mobile-first. No framework.
   ========================================================================== */

:root {
  /* Warm earth palette — calm, not corporate, not legal */
  --bg: #faf7f2;
  --bg-card: #ffffff;
  --bg-soft: #f3ede2;
  --bg-highlight: #fdf6e8;

  --ink: #2a2520;
  --ink-soft: #5a5249;
  --ink-muted: #8a7e70;

  --accent: #6b5d4a;        /* deep warm taupe */
  --accent-strong: #4a3f30;
  --accent-soft: #ddd0b8;

  --signal-good: #4a6b4a;   /* muted forest */
  --signal-watch: #a0812d;  /* muted amber */
  --signal-concern: #8a4a3a; /* muted brick */

  --border: #e5dccc;
  --border-strong: #c9bca4;

  --radius: 10px;
  --radius-sm: 6px;

  --font-serif: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto, sans-serif;

  --shadow-sm: 0 1px 2px rgba(60, 50, 40, 0.06);
  --shadow-md: 0 4px 16px rgba(60, 50, 40, 0.08);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ---- Layout primitives ---- */
.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}
.container--narrow {
  max-width: 680px;
}

/* ---- Skip link (a11y) ---- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent-strong);
  color: white;
  padding: 0.5rem 1rem;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
}

/* ---- Header ---- */
.site-header {
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.brand {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--ink-soft);
  text-decoration: none;
  letter-spacing: 0.01em;
}
.brand:hover { color: var(--ink); }

/* ---- Footer ---- */
.site-footer {
  margin-top: 4rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--ink-soft);
  font-size: 0.9rem;
}
.site-footer p { margin: 0.4rem 0; }

/* ---- Screens ---- */
.screen { padding: 2.5rem 0 4rem; }
.screen[hidden] { display: none; }

/* ---- Hero (intro) ---- */
.hero-title {
  font-family: var(--font-serif);
  font-size: 2.1rem;
  line-height: 1.2;
  font-weight: normal;
  margin: 0 0 1rem;
  color: var(--ink);
}
.hero-title__accent {
  color: var(--accent);
  font-style: italic;
}
.hero-sub {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 1rem;
}
.hero-meta {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin: 0 0 2rem;
}

/* ---- Cards ---- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin: 0 0 2rem;
  box-shadow: var(--shadow-sm);
}
.card h2 {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: normal;
  margin: 0 0 0.6rem;
  color: var(--ink);
}
.card h2:not(:first-child) {
  margin-top: 1.5rem;
}

.checklist {
  list-style: none;
  padding: 0;
  margin: 0;
}
.checklist li {
  position: relative;
  padding: 0.3rem 0 0.3rem 1.6rem;
  color: var(--ink-soft);
  line-height: 1.5;
}
.checklist li::before {
  content: "✓";
  position: absolute;
  left: 0;
  top: 0.3rem;
  color: var(--signal-good);
  font-weight: bold;
}
.checklist--negative li::before {
  content: "—";
  color: var(--ink-muted);
  font-weight: normal;
}

/* ---- Buttons ---- */
.btn {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  line-height: 1.3;
  -webkit-tap-highlight-color: transparent;
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn--primary {
  background: var(--accent-strong);
  color: white;
}
.btn--primary:hover { background: var(--ink); }
.btn--ghost {
  background: transparent;
  color: var(--ink-soft);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.btn--large {
  font-size: 1.05rem;
  padding: 1rem 2rem;
  width: 100%;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
}
.link-btn:hover { color: var(--accent-strong); }
.link-btn--quiet { color: var(--ink-muted); }

.resume-line {
  margin-top: 1rem;
  font-size: 0.95rem;
  text-align: center;
}

/* ---- Disclosure ---- */
.disclosure {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--ink-soft);
}
.disclosure summary {
  cursor: pointer;
  font-weight: 500;
  color: var(--ink);
}
.disclosure p { margin: 0.6rem 0 0; }
.disclosure code {
  background: var(--bg-card);
  padding: 0.1em 0.3em;
  border-radius: 3px;
  font-size: 0.9em;
}

/* ---- Quiz ---- */
.progress-bar {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.35s ease;
}
.progress-text {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin: 0 0 1.5rem;
  text-align: right;
}

.quiz-section { animation: fadeIn 0.3s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.quiz-section__header {
  margin-bottom: 1.5rem;
}
.quiz-section__title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: normal;
  margin: 0 0 0.4rem;
}
.quiz-section__blurb {
  color: var(--ink-soft);
  margin: 0;
  font-size: 0.98rem;
}

.question {
  margin-bottom: 1.75rem;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.question__prompt {
  font-size: 1rem;
  margin: 0 0 1rem;
  color: var(--ink);
  line-height: 1.5;
}

.likert {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.likert label {
  display: flex;
  align-items: flex-start;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s ease;
  background: var(--bg);
  font-size: 0.95rem;
  line-height: 1.4;
}
.likert label:hover {
  border-color: var(--border-strong);
  background: var(--bg-soft);
}
.likert input[type="radio"] {
  margin: 0.2rem 0.7rem 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
}
.likert input[type="radio"]:checked + span {
  font-weight: 500;
  color: var(--ink);
}
.likert label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
}

textarea.text-input {
  width: 100%;
  min-height: 90px;
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.95rem;
  resize: vertical;
  background: var(--bg);
  color: var(--ink);
}
textarea.text-input:focus,
input.text-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
input.text-input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  background: var(--bg);
  color: var(--ink);
}

.quiz-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1rem;
}
.quiz-nav .btn { flex: 1; max-width: 220px; }
.quiz-nav .btn--primary { margin-left: auto; }

.footer-note {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-align: center;
}

/* ---- Results ---- */
.results-title {
  font-family: var(--font-serif);
  font-size: 1.9rem;
  font-weight: normal;
  margin: 0 0 0.5rem;
}
.results-disclaimer {
  background: var(--bg-highlight);
  border-left: 3px solid var(--signal-watch);
  padding: 0.85rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1rem 0 2rem;
  font-size: 0.95rem;
  color: var(--ink-soft);
}

.results-section {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border);
}
.results-section:last-of-type { border-bottom: none; }
.results-section h2 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: normal;
  margin: 0 0 0.75rem;
}
.results-section--highlight {
  background: var(--bg-highlight);
  padding: 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--accent-soft);
  border-bottom: 1px solid var(--accent-soft);
}
.results-section--quiet { color: var(--ink-soft); }

#summary-text p { margin: 0 0 0.8rem; }

.scores {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}
.score {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.score__top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.4rem;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.score__name {
  font-weight: 500;
  font-size: 0.95rem;
}
.score__value {
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.score__band {
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 500;
}
.score__band--good { background: #e0ebe0; color: var(--signal-good); }
.score__band--watch { background: #f5ecd0; color: var(--signal-watch); }
.score__band--concern { background: #f0dcd6; color: var(--signal-concern); }
.score__bar {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 3px;
  overflow: hidden;
}
.score__bar-fill {
  height: 100%;
  background: var(--accent);
  transition: width 0.6s ease;
}
.score__bar-fill--good { background: var(--signal-good); }
.score__bar-fill--watch { background: var(--signal-watch); }
.score__bar-fill--concern { background: var(--signal-concern); }

.signal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--signal-watch);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 0.75rem 0;
}
.signal--high { border-left-color: var(--signal-concern); }
.signal h3 {
  margin: 0 0 0.4rem;
  font-size: 1rem;
  font-family: var(--font-sans);
}
.signal p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

.doc-checklist {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}
.doc-checklist li {
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  position: relative;
  font-size: 0.95rem;
}
.doc-checklist li::before {
  content: "☐";
  position: absolute;
  left: 0.75rem;
  color: var(--accent);
  font-size: 1.1rem;
  line-height: 1;
  top: 0.55rem;
}

.next-steps {
  padding-left: 1.25rem;
  margin: 0;
}
.next-steps li {
  margin-bottom: 0.7rem;
  line-height: 1.55;
  color: var(--ink-soft);
}

.prompt-actions {
  display: flex;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}
.prompt-actions .btn { flex: 1; min-width: 160px; }

.prompt-box {
  width: 100%;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.5;
  padding: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  resize: vertical;
  color: var(--ink);
}

.resource-list {
  padding-left: 1.25rem;
  margin: 0;
}
.resource-list li {
  margin-bottom: 0.6rem;
  line-height: 1.5;
}

.results-footer {
  text-align: center;
  margin-top: 2rem;
}

/* ---- Helpers ---- */
.muted { color: var(--ink-muted); }
.small { font-size: 0.85rem; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ---- Responsive ---- */
@media (min-width: 720px) {
  .hero-title { font-size: 2.6rem; }
  .scores { grid-template-columns: repeat(2, 1fr); }
  .btn--large { width: auto; min-width: 320px; }
  .screen { padding: 3.5rem 0 4rem; }
}

/* ---- Print (Save as PDF) ---- */
@media print {
  .site-header,
  .site-footer,
  .results-footer,
  .prompt-actions,
  .skip-link,
  .results-section--quiet {
    display: none !important;
  }
  body { background: white; color: black; font-size: 11pt; }
  .results-section { page-break-inside: avoid; }
  .results-section--highlight { background: white; border: 1px solid #999; }
  .prompt-box { display: block; white-space: pre-wrap; border: 1px solid #999; }
  .container--narrow { max-width: 100%; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
