/* Non-critical CSS — deferred load. Inline <style> holds critical-path only. */

/* ── Checkbox: disabled + hint ──────────────────────────── */
.checkbox-group label.disabled-check {
  opacity: 0.45;
  cursor: not-allowed;
}
.checkbox-hint {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 0.4rem;
}

/* ── Buttons: secondary, outline, accent ─────────────────── */
.btn-secondary {
  background: var(--charcoal);
  color: var(--white);
}
.btn-secondary:hover { background: var(--charcoal-light); }

.btn-outline {
  background: transparent;
  color: var(--olive);
  border: 2px solid var(--olive);
}
.btn-outline:hover { background: var(--olive-light); }

.btn-accent {
  background: var(--accent);
  color: var(--white);
}
.btn-accent:hover { background: #7A6548; }

/* ── Loading ─────────────────────────────────────────────── */
.loading {
  display: none;
  text-align: center;
  padding: 3rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-top: 2rem;
  box-shadow: var(--shadow);
}
.loading.active { display: block; }
.loading-dots {
  display: inline-flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
}
.loading-dots span {
  width: 12px;
  height: 12px;
  background: var(--olive);
  border-radius: 50%;
  animation: dotPulse 1.4s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%, 80%, 100% { opacity: 0.25; transform: scale(0.8); }
  40% { opacity: 1; transform: scale(1); }
}
.loading p { color: var(--text-light); font-size: 0.92rem; }
.loading p strong { color: var(--charcoal); }

/* ── Error ───────────────────────────────────────────────── */
.error-box {
  display: none;
  padding: 1.5rem;
  background: #FDE8E8;
  border: 1px solid var(--error);
  border-radius: var(--radius);
  margin-top: 2rem;
  text-align: center;
}
.error-box.active { display: block; }
.error-box strong { display: block; margin-bottom: 0.35rem; color: var(--error); font-size: 1rem; }
.error-box p { color: var(--error); font-size: 0.92rem; margin-bottom: 1rem; }
.error-box .btn { margin: 0 auto; }

/* ── Results ─────────────────────────────────────────────── */
.results {
  display: none;
  margin-top: 2rem;
}
.results.active { display: block; }

.results-header {
  background: var(--olive);
  color: var(--white);
  padding: 1.25rem 1.5rem;
  border-radius: var(--radius) var(--radius) 0 0;
}
.results-header-text h2 { font-size: 1.15rem; margin-bottom: 0.25rem; }
.results-header-text p { font-size: 0.85rem; opacity: 0.85; }
.readiness-line {
  font-size: 0.82rem;
  opacity: 0.9;
  margin-top: 0.2rem;
}
.demo-banner {
  background: #FFF9C4;
  border: 1.5px solid #F9A825;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  color: #5D4037;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.results-body {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

/* ── SWOT Grid ───────────────────────────────────────────── */
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.75rem;
}
.swot-card {
  padding: 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
  line-height: 1.55;
}
.swot-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.swot-s { background: var(--olive-light); border: 1px solid #A8BA9E; }
.swot-s h3 { color: var(--olive-dark); }
.swot-w { background: var(--cream); border: 1px solid var(--accent-light); }
.swot-w h3 { color: var(--accent); }
.swot-o { background: #EEF1ED; border: 1px solid #B5C4AF; }
.swot-o h3 { color: #3D5232; }
.swot-t { background: #F2EDEA; border: 1px solid #D4B99A; }
.swot-t h3 { color: #7A5C3A; }
.swot-card ul { padding-left: 1.1rem; margin: 0; }
.swot-card li { margin-bottom: 0.3rem; }

/* ── Recommendations ─────────────────────────────────────── */
.recommendations {
  margin-bottom: 1.75rem;
  counter-reset: rec-counter;
}
.recommendations h3 {
  font-size: 1rem;
  color: var(--olive-dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--olive-light);
}
.rec-item {
  padding: 1rem 1rem 0.85rem;
  background: var(--cream);
  border-radius: 8px;
  margin-bottom: 0.75rem;
  border: 1px solid var(--border);
  counter-increment: rec-counter;
  position: relative;
}
.rec-item::before {
  content: counter(rec-counter);
  position: absolute;
  top: 0.85rem;
  right: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--olive);
  opacity: 0.55;
}
.rec-item h4 {
  font-size: 0.92rem;
  color: var(--charcoal);
  margin-bottom: 0.35rem;
}
.rec-item p { font-size: 0.88rem; color: var(--text-light); margin-bottom: 0.5rem; }
.rec-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.badge {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-effort { background: #E8EDE4; color: var(--olive-dark); }
.badge-impact-high   { background: var(--olive-light); color: var(--olive-dark); }
.badge-impact-medium { background: #F0EBE1; color: #6B4F2A; }
.badge-impact-low    { background: var(--cream); color: #6E5A41; }

/* ── Quick Wins ──────────────────────────────────────────── */
.quick-wins {
  margin-bottom: 1.75rem;
}
.quick-wins h3 {
  font-size: 1rem;
  color: var(--olive-dark);
  margin-bottom: 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--olive-light);
}
.qw-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  background: #F0F7ED;
  border: 1px solid #C5D9BC;
  border-radius: 8px;
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  line-height: 1.5;
}
.qw-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  background: var(--olive);
  color: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
}

/* ── Next Step ───────────────────────────────────────────── */
.next-step {
  padding: 1.25rem;
  background: var(--olive-light);
  border-radius: 8px;
  border: 1px solid #B8C4AD;
  margin-bottom: 1.75rem;
}
.pipeda-note {
  padding: 1rem 1.25rem;
  background: #f0f4ff;
  border-radius: 8px;
  border: 1px solid #c5d5f0;
  margin-bottom: 1.75rem;
  font-size: 0.9rem;
}
.pipeda-note h3 {
  font-size: 0.9rem;
  color: #1a2744;
  margin-bottom: 0.4rem;
}
.pipeda-note p { margin: 0; color: #333; line-height: 1.6; }
.benchmark-note {
  padding: 0.75rem 1rem;
  background: var(--olive-light);
  border: 1px solid #BEC9B9;
  border-radius: 8px;
  margin-bottom: 1.75rem;
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1.55;
}
.benchmark-note strong { color: var(--olive-dark); }
.next-step h3 {
  font-size: 1rem;
  color: var(--olive-dark);
  margin-bottom: 0.5rem;
}
.next-step p { font-size: 0.92rem; }

/* ── Consultation CTA ────────────────────────────────────── */
.cta-card {
  padding: 1.5rem;
  background: #EDE8DF;
  border: 1px solid var(--accent-light);
  border-radius: var(--radius);
  text-align: center;
  margin-bottom: 1.75rem;
}
.cta-card h3 {
  font-size: 1.05rem;
  color: var(--charcoal);
  margin-bottom: 0.3rem;
}
.cta-card p {
  font-size: 0.88rem;
  color: var(--text-light);
  margin-bottom: 1rem;
}

/* ── Results Actions ─────────────────────────────────────── */
.results-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.results-actions .btn { flex: 1; min-width: 160px; justify-content: center; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  background: var(--charcoal);
  color: #B0B0A8;
  text-align: center;
  padding: 1.25rem;
  font-size: 0.82rem;
}
.site-footer a { color: var(--accent-light); }
.footer-links {
  margin-top: 0.5rem;
}
.footer-links a,
.footer-links .footer-link-btn {
  font-size: 0.8rem;
  cursor: pointer;
}
.footer-link-btn {
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent-light);
  text-decoration: underline;
  font-family: inherit;
}
.footer-link-btn:focus-visible {
  outline: 2px solid var(--accent-light);
  outline-offset: 3px;
}

/* ── Fieldset reset for checkbox group ───────────────────── */
fieldset.form-group {
  border: 0;
  padding: 0;
}
fieldset.form-group legend {
  display: block;
  font-weight: 600;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
  color: var(--charcoal);
  padding: 0;
}

/* ── Print ───────────────────────────────────────────────── */
@media print {
  .site-header, .site-footer, .diagnostic-form, .intro,
  .loading, .error-box, .results-actions, .cta-card, .setup-screen { display: none !important; }
  .results { display: block !important; margin-top: 0; }
  .results-header { background: #333 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .swot-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .qw-card { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .badge { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { background: #fff; }
  main { max-width: 100%; padding: 0; }
}

/* ── Reduced motion: loading dots ────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .loading-dots span { animation: none; opacity: 1; transform: scale(1); }
  html { scroll-behavior: auto; }
}

/* ── Why I built this ────────────────────────────────────── */

.why-built h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--olive-dark);
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--olive-light);
}
.why-built-content p {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.75;
  margin-bottom: 1rem;
}
.why-built-sig {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--text-light);
  line-height: 1.6;
}
.why-built-sig strong {
  color: var(--olive-dark);
  font-weight: 600;
}

/* ── Canadian Economic Context card ──────────────────────── */
.econ-context {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 0.85rem 1.1rem;
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
}
.econ-context-header {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.65rem;
}
.econ-metrics { display: flex; gap: 1.75rem; flex-wrap: wrap; }
.econ-metric { display: flex; flex-direction: column; gap: 2px; min-width: 80px; }
.econ-metric-value { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.econ-metric-label { font-size: 0.75rem; color: var(--text-light); }
.econ-source { font-size: 0.73rem; color: var(--text-light); margin-top: 0.55rem; font-style: italic; }

/* ── Prominent book-call CTA ─────────────────────────────── */
.cta-primary-action {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.9rem 1.25rem;
  background: var(--olive);
  color: var(--white);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  border-radius: var(--radius);
  text-decoration: none;
  margin-bottom: 0.75rem;
  transition: background 0.15s;
}
.cta-primary-action:hover { background: var(--olive-dark); }

/* ── S-CLARITY: report byline in results header ──────────── */
.report-byline {
  font-size: 0.74rem;
  color: rgba(255,255,255,0.65);
  letter-spacing: 0.07em;
  text-transform: uppercase;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(255,255,255,0.2);
}

/* ── S-CLARITY: CTA card typography upgrade ──────────────── */
.cta-card h3 {
  font-size: 1.25rem;
}
.cta-card .cta-primary-action {
  font-size: 1rem;
  padding: 1rem 1.5rem;
  letter-spacing: 0.01em;
}

/* ── Step transition animations (deferred — only needed after first user interaction) ── */
.question-card.active { animation: stepIn 0.25s ease forwards; }
.question-card.slide-in-right { animation: stepInRight 0.25s ease forwards; }
.question-card.slide-in-left  { animation: stepInLeft  0.25s ease forwards; }
.question-card.slide-out-left { animation: stepOutLeft 0.2s ease forwards; }
.question-card.slide-out-right { animation: stepOutRight 0.2s ease forwards; }
@keyframes stepIn        { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes stepInRight   { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes stepInLeft    { from { opacity: 0; transform: translateX(-20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes stepOutLeft   { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(-20px); } }
@keyframes stepOutRight  { from { opacity: 1; transform: translateX(0); } to { opacity: 0; transform: translateX(20px); } }
@media (prefers-reduced-motion: reduce) {
  .question-card.active, .question-card.slide-in-right, .question-card.slide-in-left,
  .question-card.slide-out-left, .question-card.slide-out-right {
    animation: none !important;
    transform: none !important;
  }
}
