/* ============================================================
   AI & YOU — Questionnaire stylesheet
   Self-contained: does not import styles.css
   ============================================================ */

/* ------------------------------------------------------------
   Reset & base
   ------------------------------------------------------------ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

fieldset {
  border: none;
  padding: 0;
  min-width: 0;
}

:root {
  --bg:            #F9F7F4;
  --surface:       #FFFFFF;
  --text:          #1E2A3A;
  --text-muted:    #5A6A7E;
  --accent:        #C4693A;
  --accent-light:  #F5EDE7;
  --border:        #E2DDD8;
  --nav-height:    64px;

  /* Heat colours */
  --low-bg:        #DDEAF5;
  --low-border:    #5B8DB8;
  --low-text:      #2D5F8A;

  --med-bg:        #FDF3DC;
  --med-border:    #E8A838;
  --med-text:      #8A5E00;

  --high-bg:       #E0F2E9;
  --high-border:   #5A9E6F;
  --high-text:     #2E6B46;

  --na-bg:         #F0F1F3;
  --na-border:     #9BA3AD;
  --na-text:       #5A6A7E;

  /* Error */
  --error-bg:      #FEF2F2;
  --error-border:  #F87171;
  --error-text:    #B91C1C;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
}

/* ------------------------------------------------------------
   Skip link
   ------------------------------------------------------------ */
.skip-link {
  position: absolute;
  top: -100%;
  left: 24px;
  background: var(--accent);
  color: #fff;
  padding: 8px 16px;
  border-radius: 0 0 6px 6px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  z-index: 200;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

/* ------------------------------------------------------------
   Header
   ------------------------------------------------------------ */
.q-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 247, 244, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  height: var(--nav-height);
  display: flex;
  align-items: center;
}

.q-header-inner {
  max-width: 960px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.q-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.q-back-link {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.15s;
}

.q-back-link:hover {
  color: var(--text);
}

/* ------------------------------------------------------------
   Progress bar
   ------------------------------------------------------------ */
.q-progress-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 24px 0;
}

.q-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.q-progress-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.q-progress-count {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.q-progress-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.q-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ------------------------------------------------------------
   Screens
   ------------------------------------------------------------ */
.q-screen {
  display: none;
}

.q-screen.active {
  display: block;
}

.q-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

/* ------------------------------------------------------------
   Screen intro
   ------------------------------------------------------------ */
.q-intro-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 12px;
}

.q-intro h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 20px;
}

.q-intro-lead {
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 16px;
  line-height: 1.65;
}

.q-intro-body {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.7;
}

/* ------------------------------------------------------------
   Dimension heading
   ------------------------------------------------------------ */
.q-dim-label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 8px;
}

.q-dim-heading {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 8px;
  line-height: 1.2;
}

.q-dim-intro {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.65;
}

/* ------------------------------------------------------------
   Privacy note
   ------------------------------------------------------------ */
.q-privacy {
  font-size: 0.8125rem;
  color: var(--text-muted);
  padding: 12px 16px;
  background: var(--accent-light);
  border-radius: 6px;
  border-left: 3px solid var(--accent);
  margin-bottom: 28px;
  line-height: 1.5;
}

.q-intro-name-wrap {
  margin-bottom: 24px;
}

.q-intro-name-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.q-intro-name-input {
  width: 100%;
  max-width: 320px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 14px;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
}

.q-intro-name-input:focus {
  border-color: var(--accent);
}

.q-email-row--single {
  grid-template-columns: 1fr;
  max-width: 360px;
}

/* ------------------------------------------------------------
   Question cards
   ------------------------------------------------------------ */
.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 20px;
}

.q-card-question {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.45;
}

.q-card-note {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 14px;
  font-style: italic;
}

/* ------------------------------------------------------------
   Radio / Checkbox rows
   ------------------------------------------------------------ */
.q-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.q-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s;
  font-size: 0.9375rem;
  color: var(--text);
  user-select: none;
  line-height: 1.4;
}

.q-option:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

.q-option input[type="radio"],
.q-option input[type="checkbox"] {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  cursor: pointer;
}

.q-option input[type="radio"]:checked ~ span,
.q-option input[type="checkbox"]:checked ~ span {
  color: var(--text);
  font-weight: 600;
}

.q-option:has(input:checked) {
  background: var(--accent-light);
  border-color: var(--accent);
}

/* Disabled (family NA) */
.q-option.disabled,
.q-card.faded {
  opacity: 0.4;
  pointer-events: none;
}

/* ------------------------------------------------------------
   Scale (1–5)
   ------------------------------------------------------------ */
.q-scale-wrap {
  margin-top: 14px;
}

.q-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.q-scale-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  max-width: 40%;
  line-height: 1.3;
}

.q-scale-label:last-child {
  text-align: right;
}

.q-scale-buttons {
  display: flex;
  gap: 8px;
}

.q-scale-btn {
  flex: 1;
  position: relative;
}

.q-scale-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.q-scale-btn label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  background: var(--surface);
  user-select: none;
}

.q-scale-btn label:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--text);
}

.q-scale-btn input:checked + label {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ------------------------------------------------------------
   Textarea
   ------------------------------------------------------------ */
.q-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--bg);
  resize: vertical;
  line-height: 1.6;
  transition: border-color 0.15s;
  margin-top: 12px;
}

.q-textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}

.q-textarea::placeholder {
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   Error messages
   ------------------------------------------------------------ */
.q-error-banner {
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 0.875rem;
  color: var(--error-text);
  display: none;
}

.q-error-banner.visible {
  display: block;
}

.q-error-banner ul {
  margin: 4px 0 0 18px;
}

.q-card.has-error {
  border-color: var(--error-border);
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */
.q-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
  margin-top: 8px;
}

.q-btn:hover {
  opacity: 0.88;
}

.q-btn:active {
  transform: translateY(1px);
}

.q-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.q-btn-secondary {
  background: transparent;
  color: var(--accent);
  border: 2px solid var(--accent);
  margin-top: 16px;
}

.q-btn-secondary:hover {
  background: var(--accent-light);
  opacity: 1;
}

/* ------------------------------------------------------------
   Results screen
   ------------------------------------------------------------ */
.q-results-lead {
  font-size: 1.0625rem;
  color: var(--text-muted);
  margin-bottom: 32px;
  line-height: 1.65;
}

/* Heatmap grid */
.q-heatmap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 36px;
}

.q-heat-cell {
  border-radius: 10px;
  padding: 20px;
  border: 1.5px solid transparent;
}

.q-heat-cell.low {
  background: var(--low-bg);
  border-color: var(--low-border);
}

.q-heat-cell.medium {
  background: var(--med-bg);
  border-color: var(--med-border);
}

.q-heat-cell.high {
  background: var(--high-bg);
  border-color: var(--high-border);
}

.q-heat-cell.na {
  background: var(--na-bg);
  border-color: var(--na-border);
}

.q-heat-dim-name {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-bottom: 6px;
}

.q-heat-cell.low    .q-heat-dim-name { color: var(--low-text); }
.q-heat-cell.medium .q-heat-dim-name { color: var(--med-text); }
.q-heat-cell.high   .q-heat-dim-name { color: var(--high-text); }
.q-heat-cell.na     .q-heat-dim-name { color: var(--na-text); }

.q-heat-level-label {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}

.q-heat-cell.low    .q-heat-level-label { color: var(--low-text); }
.q-heat-cell.medium .q-heat-level-label { color: var(--med-text); }
.q-heat-cell.high   .q-heat-level-label { color: var(--high-text); }
.q-heat-cell.na     .q-heat-level-label { color: var(--na-text); }

.q-heat-interp {
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text);
}

/* ------------------------------------------------------------
   Email capture form
   ------------------------------------------------------------ */
.q-email-section {
  margin-top: 36px;
}

.q-email-section h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
}

.q-email-hint {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.q-email-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.q-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.q-field input[type="text"],
.q-field input[type="email"] {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
}

.q-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.q-form-success {
  display: none;
  background: var(--high-bg);
  border: 1.5px solid var(--high-border);
  border-radius: 10px;
  padding: 20px 24px;
  color: var(--high-text);
  font-weight: 600;
  margin-top: 16px;
}

.q-form-success p {
  font-size: 0.9375rem;
}

.q-form-success.visible {
  display: block;
}

.q-cta-wrap {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}

.q-cta-wrap p {
  font-size: 0.9375rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ------------------------------------------------------------
   Mobile (≤600px)
   ------------------------------------------------------------ */
@media (max-width: 600px) {
  .q-inner {
    padding: 32px 16px 64px;
  }

  .q-progress-wrap {
    padding: 16px 16px 0;
  }

  .q-heatmap {
    grid-template-columns: 1fr;
  }

  .q-email-row {
    grid-template-columns: 1fr;
  }

  .q-scale-buttons {
    gap: 6px;
  }

  .q-scale-btn label {
    font-size: 0.875rem;
    height: 40px;
  }
}
