/* ============================================================
   CPC-4 ZEV Myths — Course Stylesheet (v3)
   Edit freely. No external dependencies.
   ============================================================ */

:root {
  --primary:        #1a7bbf;
  --primary-dark:   #1569a8;
  --primary-light:  #e6f1fb;
  --success:        #1e8449;
  --success-light:  #d5f5e3;
  --error:          #922b21;
  --error-light:    #fadbd8;
  --concern-bg:     #fef9e7;
  --concern-border: #e67e22;
  --bg:             #f4f6f8;
  --card-bg:        #ffffff;
  --border:         #dde1e6;
  --text:           #1a1a1a;
  --muted:          #666;
  --radius:         8px;
}

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

/* ---- Base ---- */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 17px;
}

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

/* ---- Page wrapper ---- */
#app {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}

/* ---- Site header (shown on every page) ---- */
.site-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 28px;
  border-bottom: 3px solid var(--primary);
}
.site-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.site-subtitle {
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.breadcrumb .crumb {
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  background: none;
  border: none;
  font: inherit;
  font-size: 0.88rem;
  padding: 0;
}
.breadcrumb .crumb:hover { color: var(--primary-dark); }
/* anchor crumbs */
a.crumb { text-decoration: underline; }
a.crumb:visited { color: var(--primary); }
.breadcrumb .sep { color: var(--muted); }

/* ---- Page headings ---- */
h1 {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 8px;
  line-height: 1.25;
}
h2 {
  font-size: 1.35rem;
  color: var(--text);
  margin-bottom: 12px;
}
h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

/* ---- Cards (generic) ---- */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  margin-bottom: 20px;
}

/* ---- Intro view ---- */
.intro-body p { margin-bottom: 16px; }
.intro-body p:last-child { margin-bottom: 0; }

/* ---- Outcome list ---- */
.outcome-list { display: grid; gap: 14px; }

.outcome-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
  padding: 20px 24px;
  cursor: pointer;
  transition: box-shadow 0.15s ease, transform 0.12s ease;
  display: flex;
  align-items: center;
  gap: 16px;
  text-align: left;
  width: 100%;
  font: inherit;
  /* anchor reset */
  text-decoration: none;
  color: inherit;
}
.outcome-card:hover {
  box-shadow: 0 4px 18px rgba(0,0,0,0.09);
  transform: translateY(-2px);
}
.outcome-number {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.35;
  min-width: 36px;
  line-height: 1;
}
.outcome-card-body { flex: 1; }
.outcome-card h3 {
  font-size: 1.1rem;
  color: var(--primary);
  margin-bottom: 4px;
}
.outcome-tasks {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.4;
}
.outcome-arrow {
  font-size: 1.4rem;
  color: var(--primary);
  opacity: 0.5;
}

/* ---- Progress bar ---- */
.progress-wrap { margin-bottom: 24px; }
.progress-label {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.progress-bar {
  background: var(--border);
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  background: var(--primary);
  height: 100%;
  border-radius: 3px;
  transition: width 0.35s ease;
}

/* ---- Learning task content ---- */
.task-meta {
  font-size: 0.85rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.concern-box {
  background: var(--concern-bg);
  border-left: 4px solid var(--concern-border);
  border-radius: 4px;
  padding: 18px 22px;
  margin: 20px 0 24px;
}
.concern-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #935116;
  margin-bottom: 6px;
}
.concern-box p {
  margin: 0;
  font-style: italic;
  color: #5d3a1a;
  line-height: 1.65;
}

.task-body p { margin-bottom: 16px; }
.task-body p:last-child { margin-bottom: 0; }

.sources-section {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.sources-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 8px;
}
.sources-section ul { list-style: none; }
.sources-section li { font-size: 0.88rem; margin-bottom: 4px; }

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.14s, box-shadow 0.14s, transform 0.1s;
  line-height: 1.2;
  text-decoration: none;
  font-family: inherit;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 3px 10px rgba(0,0,0,0.15); }

.btn-secondary { background: #e0e4e9; color: var(--text); }
.btn-secondary:hover { background: #cdd2d9; }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #166a38; box-shadow: 0 3px 10px rgba(0,0,0,0.15); }

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

.btn-muted {
  background: transparent;
  color: var(--muted);
  border: 2px solid var(--border);
}
.btn-muted:hover { background: var(--border); color: var(--text); }

/* anchor buttons — reset visited/hover colours */
a.btn-primary:visited,
a.btn-primary:hover  { color: #fff; }
a.btn-success:visited,
a.btn-success:hover  { color: #fff; }
a.btn-muted:visited  { color: var(--muted); }

.nav-row {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  flex-wrap: wrap;
  align-items: center;
}
.nav-row .spacer { flex: 1; }

/* ---- Quiz ---- */
.quiz-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 4px;
}
.quiz-task-title {
  font-size: 0.9rem;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 18px;
}

.question-text {
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.5;
  margin-bottom: 22px;
}

.answer-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}

.answer-btn {
  text-align: left;
  padding: 14px 20px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: 6px;
  font-size: 0.97rem;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.14s, background 0.14s;
  line-height: 1.45;
}
.answer-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--primary-light);
}
.answer-btn:disabled { cursor: default; }

.answer-btn.state-correct {
  border-color: var(--success);
  background: var(--success-light);
  color: #145a32;
  font-weight: 700;
}
.answer-btn.state-wrong {
  border-color: var(--error);
  background: var(--error-light);
  color: #7b241c;
}

.feedback {
  padding: 14px 18px;
  border-radius: 6px;
  margin-bottom: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.feedback-correct {
  background: var(--success-light);
  border-left: 4px solid var(--success);
  color: #145a32;
}
.feedback-wrong {
  background: var(--error-light);
  border-left: 4px solid var(--error);
  color: #7b241c;
}
/* Pre-quiz only: no-blame colouring when the user's answer was incorrect */
.feedback-neutral {
  background: rgba(255, 220, 50, 0.13);
  border-left: 4px solid rgba(210, 160, 0, 0.38);
  color: var(--text);
}

.skip-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.88rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.skip-btn:hover { color: var(--text); }

/* ---- All-on-one-page quiz layout ---- */
/* Vertical space between successive questions */
.quiz-question + .quiz-question {
  margin-top: 28px;
}
/* Question number prefix added by quiz.js */
.q-num {
  font-weight: 700;
}
/* Score summary inserted above the nav row after Check Answers */
.quiz-score-box {
  padding: 14px 20px;
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  color: var(--primary-dark);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* ---- Quiz complete / score ---- */
.score-card {
  text-align: center;
  padding: 36px 32px;
}
.score-number {
  font-size: 3.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  margin-bottom: 6px;
}
.score-caption {
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.score-note {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 24px;
}
.complete-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* ---- Outcome intro page ---- */
.outcome-intro-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 4px;
  padding: 4px 10px;
  margin-bottom: 14px;
}
.outcome-intro-text {
  font-size: 1.08rem;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 28px;
}
.task-list-preview {
  list-style: none;
  padding: 0;
  margin: 0;
}
.task-list-preview li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.97rem;
}
.task-list-preview li:first-child { border-top: 1px solid var(--border); }
.task-list-num {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  opacity: 0.6;
  min-width: 28px;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  #app { padding: 16px 14px 40px; }
  h1 { font-size: 1.5rem; }
  .card { padding: 20px 18px; }
  .outcome-card { padding: 16px 18px; }
  .btn { padding: 13px 22px; font-size: 0.95rem; }
  .score-number { font-size: 2.8rem; }
}

/* ============================================================
   Accessible EV Charging — additional styles
   ============================================================ */

/* Multi-select pending selection state */
.answer-btn.selected {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

/* Answer explanation — revealed after question is submitted */
.question-explanation {
  display: none;
  margin-top: 14px;
  padding: 12px 16px;
  background: var(--success-light);
  border-left: 3px solid var(--success);
  border-radius: 4px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #145a32;
}

/* Technical Reference collapsible section */
details.tech-ref {
  margin-top: 28px;
  border: 1px solid #1a5276;
  border-radius: var(--radius);
  overflow: hidden;
}
details.tech-ref summary {
  background: #0d3b5e;
  color: white;
  padding: 12px 18px;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  list-style: none;
  user-select: none;
}
details.tech-ref summary::-webkit-details-marker { display: none; }
details.tech-ref summary::after { content: ' ›  (click to expand)'; font-weight: 400; font-size: 0.82rem; opacity: 0.8; }
details.tech-ref[open] summary::after { content: ' ↑  (click to collapse)'; font-weight: 400; font-size: 0.82rem; opacity: 0.8; }
details.tech-ref .tech-ref-body {
  padding: 18px 24px;
  font-size: 0.85rem;
  line-height: 1.7;
  background: #f7f9fc;
}
details.tech-ref .tech-ref-body > p:first-child { margin-bottom: 14px; font-style: italic; color: var(--muted); }
details.tech-ref .tech-ref-body ul { padding-left: 20px; margin-bottom: 14px; }
details.tech-ref .tech-ref-body li { margin-bottom: 5px; }
.tech-ref-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #0d3b5e;
  margin: 16px 0 6px;
  border-top: 1px solid #d0dce8;
  padding-top: 12px;
}
.tech-ref-section-title:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }

/* Image placeholder boxes */
.img-placeholder {
  background: #f0f4f8;
  border: 2px dashed #9ab4cc;
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.img-placeholder-icon { font-size: 26px; flex-shrink: 0; margin-top: 2px; }
.img-placeholder-tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  background: var(--primary-light);
  border-radius: 3px;
  padding: 2px 7px;
  margin-bottom: 6px;
}
.img-placeholder-caption { font-size: 0.95rem; font-weight: 600; color: #2c4a6e; margin-bottom: 4px; }
.img-placeholder-brief { font-size: 0.85rem; color: var(--muted); line-height: 1.6; font-style: italic; }

/* "Picture this" scenario card */
.scenario-card {
  background: #f4f6f8;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 28px 0;
  font-size: 0.95rem;
  line-height: 1.75;
  border-left: 4px solid var(--border);
}
.scenario-label {
  font-weight: 700;
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}
.scenario-card p + p { margin-top: 10px; }

/* Tier blocks — good / better / best */
.tier-block {
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 12px;
  font-size: 0.95rem;
  line-height: 1.7;
}
.tier-good   { background: #f0f7ff; border-left: 4px solid #7ab8e0; }
.tier-better { background: #e3f0fa; border-left: 4px solid #3a9fd6; }
.tier-best   { background: #d4e8f5; border-left: 4px solid var(--primary); }
.tier-label  { font-weight: 700; font-size: 0.9rem; margin-bottom: 10px; color: var(--primary-dark); }
.tier-block ul { margin: 0; padding-left: 18px; }
.tier-block li { margin-bottom: 5px; }

/* Congrats / course-complete box */
.congrats-box {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: 12px;
  padding: 32px 28px;
  color: white;
  margin-top: 32px;
}
.congrats-box h2 { color: white; font-size: 1.4rem; margin-bottom: 12px; }
.congrats-box p  { opacity: 0.92; margin-bottom: 12px; font-size: 0.97rem; line-height: 1.7; }
.congrats-box ul { padding-left: 22px; opacity: 0.92; margin-bottom: 16px; }
.congrats-box li { margin-bottom: 5px; font-size: 0.95rem; line-height: 1.7; }
.congrats-note {
  font-size: 0.88rem;
  opacity: 0.82;
  font-style: italic;
  border-top: 1px solid rgba(255,255,255,0.2);
  padding-top: 14px;
  margin-top: 4px;
}
a.btn-congrats {
  display: inline-block;
  margin-top: 14px;
  background: white;
  color: var(--primary);
  padding: 12px 28px;
  border-radius: 6px;
  font-size: 0.97rem;
  font-weight: 700;
  text-decoration: none;
}
a.btn-congrats:hover { background: #f0f7ff; color: var(--primary-dark); }

/* Interactive checklist (Module 8) */
.checklist-section { margin-bottom: 20px; }
.checklist-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--primary);
  margin-bottom: 10px;
}
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.95rem;
  cursor: pointer;
  line-height: 1.5;
  padding: 2px 0;
}
.check-item input[type="checkbox"] {
  margin-top: 3px;
  flex-shrink: 0;
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}
.check-item.checked { color: var(--muted); text-decoration: line-through; }
.cl-progress-text { font-size: 0.82rem; color: var(--muted); margin-top: 14px; }
.cl-progress-bar  { height: 5px; background: var(--border); border-radius: 3px; margin-top: 6px; }
.cl-progress-fill { height: 5px; background: var(--primary); border-radius: 3px; transition: width 0.3s; width: 0%; }

/* Printable checklist box */
.printable-box {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 20px 22px;
  font-size: 0.88rem;
  line-height: 1.8;
  border: 1px solid var(--border);
}
.printable-row { display: flex; gap: 24px; flex-wrap: wrap; }
.printable-col { flex: 1; min-width: 180px; }
.printable-col-title {
  font-weight: 700;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-bottom: 4px;
  margin-top: 14px;
}
.printable-col ul { margin: 0; padding-left: 14px; }
.printable-col li { margin-bottom: 2px; font-size: 0.85rem; }
.printable-note { font-size: 0.8rem; color: var(--muted); margin-top: 14px; font-style: italic; }

/* Note / info box */
.note-box {
  background: #eaf7ef;
  border-left: 4px solid var(--success);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 14px 18px;
  margin: 16px 0 20px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #145a32;
}

/* Sub-section heading used inside cards */
.sub-heading {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary);
  margin: 16px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

