/* =========================================================
   PASQ Business Performance Assessment™ — Styling
   Extends the existing design system (assets/css/main.css).
   Do not redefine colours/typography here — only assessment-
   specific layout, transitions and components.
   ========================================================= */

.assess-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 24px 0 96px;
}

/* ---------- Progress ---------- */
.assess-progress { margin-bottom: 40px; }
.assess-progress-track {
  height: 4px;
  background: var(--light-grey);
  border-radius: 999px;
  overflow: hidden;
}
.assess-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  transition: width 0.4s ease;
}
.assess-progress-label {
  margin-top: 10px;
  font-family: var(--font-heading);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ---------- Screens & transitions ---------- */
.assess-screen {
  display: none;
  animation: assessFadeIn 0.4s ease;
}
.assess-screen.active { display: block; }
.assess-screen.is-leaving { animation: assessFadeOut 0.2s ease; }

@keyframes assessFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes assessFadeOut {
  from { opacity: 1; } to { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .assess-screen, .assess-screen.is-leaving { animation: none; }
}

/* ---------- Intro ---------- */
.assess-intro {
  text-align: center;
  padding: 48px 8px 8px;
}
.assess-intro h1 { margin-bottom: 20px; }
.assess-microcopy {
  margin-top: 24px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Card wrapper for question / profile screens ---------- */
.assess-card {
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-card);
  padding: 44px 40px;
  box-shadow: var(--shadow-card);
}
.assess-card h2 { margin-bottom: 32px; }

/* ---------- Likert questions ---------- */
.assess-question { margin-bottom: 36px; }
.assess-question:last-child { margin-bottom: 0; }
.assess-question-text {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  color: var(--navy);
  margin-bottom: 16px;
}
.assess-likert {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.assess-likert-option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px 6px;
  border: 1px solid var(--light-grey);
  border-radius: 10px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.assess-likert-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.assess-likert-option:hover { border-color: var(--gold); }
.assess-likert-option:has(input:checked) {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  font-weight: 600;
}
/* Visible keyboard focus indicator — the radio input itself is
   visually hidden (opacity:0) so the browser's native focus ring
   would otherwise be invisible; show it on the label wrapper instead. */
.assess-likert-option:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}
.assess-question.has-error .assess-question-text { color: var(--danger); }
.assess-question.has-error .assess-likert-option { border-color: var(--danger); }

/* ---------- Not Applicable toggle ---------- */
.assess-na-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
}
.assess-na-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.assess-na-toggle::before {
  content: '';
  width: 14px;
  height: 14px;
  border: 1px solid var(--light-grey);
  border-radius: 4px;
  flex-shrink: 0;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.assess-na-toggle:has(input:checked) {
  color: var(--navy);
  font-weight: 600;
}
.assess-na-toggle:has(input:checked)::before {
  background: var(--gold);
  border-color: var(--gold);
}
.assess-na-toggle:has(input:focus-visible) {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Field errors (profile / email) ---------- */
.field.has-error input,
.field.has-error select {
  border-color: var(--danger);
}

/* Visible focus for standard form fields and buttons */
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}
.btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- Nav ---------- */
.assess-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 32px;
}

/* ---------- Loading ---------- */
.assess-loading {
  text-align: center;
  padding: 96px 8px;
}
.assess-spinner {
  width: 44px;
  height: 44px;
  margin: 0 auto 24px;
  border: 3px solid var(--light-grey);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: assessSpin 0.8s linear infinite;
}
.assess-loading p {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}
@keyframes assessSpin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .assess-spinner { animation: none; }
}

/* ---------- Results ---------- */
.assess-results { padding-top: 8px; }

.score-dial-wrap {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 40px auto;
}
.score-dial { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-dial-track,
.score-dial-fill {
  fill: none;
  stroke-width: 12;
}
.score-dial-track { stroke: var(--light-grey); }
.score-dial-fill {
  stroke: var(--gold);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.score-dial-label {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.score-dial-label strong {
  font-family: var(--font-heading);
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
}
.score-dial-label span {
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  max-width: 120px;
  text-align: center;
}

.assess-reference {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-muted);
}
.assess-reference span {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: 0.02em;
}

.assess-exec-summary {
  margin: 32px 0;
}
.assess-exec-summary p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text);
  margin: 0;
}

.assess-chart-card {
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-card);
  padding: 32px;
  margin: 32px 0;
}

.dimension-chart { margin-top: 20px; }
.dimension-bar { margin-bottom: 20px; }
.dimension-bar:last-child { margin-bottom: 0; }
.dimension-bar-label {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}
.dimension-bar-label strong { color: var(--gold); }
.dimension-bar-track {
  height: 10px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.dimension-bar-fill {
  height: 100%;
  width: 0%;
  background: var(--gold);
  border-radius: 999px;
  transition: width 1s ease;
}

.dimension-rating-dots {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.rating-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--light-grey);
}
.rating-dot.is-filled { background: var(--navy); }
.rating-label {
  margin-left: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.assess-why-recommendation {
  margin-top: 24px;
}
.assess-why-recommendation p {
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 12px;
}
.assess-why-recommendation p:last-child { margin-bottom: 0; }
.assess-why-recommendation strong { color: var(--navy); }

.assess-methodology-statement {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--light-grey);
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}

.assess-rag-list {
  max-width: 480px;
  margin: 40px auto;
  background: var(--white);
  border: 1px solid var(--light-grey);
  border-radius: var(--radius-card);
  padding: 8px 32px;
}
.rag-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--light-grey);
}
.rag-row:last-child { border-bottom: none; }
.rag-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
}
.rag-dot.rag-red { background: var(--danger); }
.rag-dot.rag-amber { background: var(--warning); }
.rag-dot.rag-green { background: var(--success); }
.rag-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--navy);
}
.assess-confidence {
  margin-top: 12px;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.assess-version-stamp {
  margin-top: 8px;
  font-size: 0.68rem;
  color: var(--light-grey);
  text-align: center;
}

.assess-list { margin: 0; padding-left: 18px; }
.assess-list li { margin-bottom: 10px; color: var(--text); font-size: 0.92rem; }
.assess-list li:last-child { margin-bottom: 0; }

.assess-opportunity {
  margin-top: 28px;
  text-align: center;
}
.assess-opportunity p {
  max-width: 560px;
  margin: 0 auto 24px;
  color: var(--text);
}

/* ---------- Email screen ---------- */
.assess-email-field { max-width: 420px; margin: 24px auto 0; }
.assess-email-status {
  min-height: 20px;
  margin: 16px 0 0;
  font-size: 0.85rem;
  font-weight: 600;
}
.assess-email-status.is-error { color: var(--danger); }
.assess-email-status.is-sending { color: var(--text-muted); }
.assess-email-actions {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}
.btn[disabled] { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .assess-card { padding: 32px 22px; }
  .assess-likert { grid-template-columns: 1fr; }
  .assess-likert-option { justify-content: flex-start; text-align: left; padding: 14px 16px; font-size: 0.85rem; }
  .assess-chart-card { padding: 24px 20px; }
  .assess-email-actions { flex-direction: column; }
}
