/* Nook Industry Pulse — placeholder brand tokens. Replace with Nook's values when supplied. */
:root {
  --brand-primary: #1f4b43;
  --brand-accent: #c97a2b;
  --text: #1a1f1e;
  --muted: #5b6b67;
  --border: #d7dfdc;
  --focus: #1457c7;
  --bg: #ffffff;
  --bg-subtle: #f4f7f6;
  --danger: #b3261e;
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-heading: var(--font-body);
  --radius: 10px;
  --max-width: 640px;
  --gutter: 16px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, legend {
  font-family: var(--font-heading);
  line-height: 1.25;
}

a {
  color: var(--brand-primary);
}

.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;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.app {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter) 48px;
}

.site-header {
  padding: 16px 0;
  display: flex;
  align-items: center;
}

.logo-slot {
  width: 140px;
  height: 36px;
  border-radius: 6px;
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 12px;
}

.screen[hidden] {
  display: none !important;
}

.screen {
  padding-top: 8px;
}

/* Intro */
.intro-heading {
  font-size: 1.6rem;
  margin: 8px 0 12px;
}

.intro-body {
  color: var(--text);
  margin: 0 0 16px;
}

.intro-privacy {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.95rem;
  margin-bottom: 20px;
}

.intro-privacy p {
  margin: 0 0 8px;
}

.intro-privacy p:last-child {
  margin-bottom: 0;
}

.intro-questions-download {
  margin-top: 14px;
  font-size: 0.9rem;
}

/* Progress bar */
.progress {
  margin-bottom: 20px;
}

.progress-label {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0 0 6px;
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--brand-primary);
  border-radius: 999px;
  transition: width 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .progress-bar-fill {
    transition: none;
  }
}

#section-heading {
  font-size: 1.4rem;
  margin: 0 0 20px;
}

/* Questions */
.question {
  border: none;
  padding: 0;
  margin: 0 0 28px;
}

.question legend {
  font-size: 1.05rem;
  font-weight: 600;
  padding: 0 0 10px;
  width: 100%;
}

.question-note {
  color: var(--muted);
  font-size: 0.9rem;
  margin: -4px 0 10px;
}

.option-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
}

.option-row:has(input:checked) {
  border-color: var(--brand-primary);
  background: var(--bg-subtle);
}

.option-row input {
  margin-top: 3px;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.option-row span {
  flex: 1;
  overflow-wrap: anywhere;
}

.option-row.is-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.multi-limit-note {
  font-size: 0.85rem;
  color: var(--muted);
  margin: -2px 0 10px;
}

textarea,
input[type="text"],
input[type="email"],
input[type="tel"] {
  width: 100%;
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  min-height: 44px;
  background: var(--bg);
  color: var(--text);
}

textarea {
  min-height: 120px;
  resize: vertical;
}

.char-counter {
  font-size: 0.85rem;
  color: var(--muted);
  text-align: right;
  margin-top: 4px;
}

.other-field,
.followup-field {
  margin-top: 10px;
}

.field-row {
  margin-bottom: 14px;
}

.field-row label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
}

/* cardScale */
.card-scale-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 12px;
}

.card-scale-item .card-scale-label {
  font-weight: 600;
  margin: 0 0 10px;
}

.card-scale-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scale-button-row {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  gap: 10px;
}

.scale-button-row:has(input:checked) {
  border-color: var(--brand-primary);
  background: var(--bg-subtle);
}

.error-message {
  color: var(--danger);
  font-size: 0.9rem;
  margin: 6px 0 0;
}

.error-message[hidden] {
  display: none;
}

.question.has-error .option-row,
.question.has-error textarea,
.question.has-error input {
  border-color: var(--danger);
}

/* Buttons */
.btn {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary {
  background: var(--brand-primary);
  color: #fff;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border-color: var(--border);
}

.btn-accent {
  background: var(--brand-accent);
  color: #fff;
}

.nav-buttons {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
}

/* Results */
.results-heading {
  font-size: 1.5rem;
  margin: 8px 0 12px;
}

.dashboard-placeholder {
  background: var(--bg-subtle);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  margin: 20px 0;
}

.share-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Resume modal */
.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  z-index: 10;
}

.modal-card {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 24px;
  max-width: 420px;
  width: 100%;
}

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

/* Export page */
.export-counts {
  display: flex;
  gap: 24px;
  margin: 20px 0;
  flex-wrap: wrap;
}

.export-count {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 20px;
  min-width: 140px;
}

.export-count strong {
  display: block;
  font-size: 1.6rem;
}

.export-note {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  color: var(--muted);
  font-size: 0.95rem;
}

.export-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

.danger-zone {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

@media (min-width: 540px) {
  .intro-heading {
    font-size: 2rem;
  }
}
