/* =====================================================================
   WIZARD STYLES — used by guides rendered from JSON payload
   Inherits color tokens from site.css :root
   ===================================================================== */

.wizard-page-wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 32px 24px;
}

.wizard-breadcrumbs {
  font-size: 13px;
  color: var(--ink-muted);
  margin-bottom: 18px;
}
.wizard-breadcrumbs a { color: var(--ink-soft); font-weight: 500; }
.wizard-breadcrumbs span { margin: 0 6px; }

.wizard {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.wizard-header {
  background: var(--ink);
  color: #fff;
  padding: 22px 28px;
  text-align: center;
}
.wizard-header .logo-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  margin-bottom: 10px;
  text-transform: uppercase;
  color: var(--highlight);
}
.wizard-header h1 {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.wizard-header p {
  font-size: 13px;
  opacity: 0.75;
  font-weight: 400;
}

.progress-bar {
  display: flex;
  padding: 16px 28px;
  background: var(--bg-cream);
  gap: 5px;
  border-bottom: 1px solid var(--border);
}
.progress-step {
  flex: 1; height: 4px;
  background: #D9D2C2;
  border-radius: 2px;
  transition: background 0.4s ease;
}
.progress-step.active { background: var(--accent); }
.progress-step.completed { background: var(--teal); }

.wizard-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 560px;
}
.visual-panel {
  background: var(--bg-cream);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-right: 1px solid var(--border);
}
.canvas-frame {
  width: 100%;
  max-width: 460px;
  background: #FAFAF6;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(3,49,75,0.15);
  overflow: hidden;
  border: 1px solid var(--border);
}
.canvas-bar {
  background: #ECE7DA;
  padding: 8px 14px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border);
}
.canvas-dot { width: 9px; height: 9px; border-radius: 50%; }
.dot-red { background: #FF5F57; }
.dot-yellow { background: #FEBC2E; }
.dot-green { background: #28C840; }
.canvas-label {
  flex: 1;
  font-size: 10px;
  color: var(--ink-muted);
  font-family: 'Monaco', 'Courier New', monospace;
  text-align: center;
  letter-spacing: 0.3px;
}
.canvas-screen {
  width: 100%;
  aspect-ratio: 460 / 420;
  background: #fff;
  overflow: hidden;
  position: relative;
}
.step-svg { width: 100%; height: 100%; display: block; }

.instruction-panel {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  overflow-y: auto;
}
.step-content-wrapper { flex: 1; }

.step-label {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 5px 12px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.step-title {
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  line-height: 1.25;
  letter-spacing: -0.4px;
}
.step-description {
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 18px;
}
.step-description p { margin-bottom: 14px; }
.step-description p:last-child { margin-bottom: 0; }
.step-description strong { color: var(--ink); font-weight: 600; }
.step-description code {
  background: #F4F1E8;
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 12.5px;
  color: var(--accent);
  border: 1px solid var(--border);
}

.step-tip {
  background: var(--tip-bg);
  border-left: 3px solid var(--tip-border);
  padding: 12px 16px;
  border-radius: 4px;
  font-size: 13px;
  color: #6B5410;
  line-height: 1.6;
  margin-bottom: 18px;
}
.step-tip strong { color: #4A3A0A; }

/* Video segment card (Mode A only) */
.video-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}
.video-section-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.video-section-label .yt-dot {
  width: 8px; height: 8px;
  background: #FF0000;
  border-radius: 50%;
  animation: pulseRed 1.6s ease-in-out infinite;
}
@keyframes pulseRed {
  0%,100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}
.video-wrapper {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 10px;
  background: #000;
  box-shadow: 0 4px 14px rgba(3,49,75,0.18);
  transition: transform 0.25s, box-shadow 0.25s;
}
.video-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(3,49,75,0.28);
}
.video-thumb-link { position: absolute; inset: 0; display: block; color: #fff; }
.video-thumb-link img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.78);
  transition: filter 0.25s;
}
.video-thumb-link:hover img { filter: brightness(0.62); }
.video-overlay {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.55) 100%);
  pointer-events: none;
}
.video-play-btn {
  width: 64px; height: 64px;
  background: rgba(255,0,0,0.92);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
  transition: transform 0.25s, background 0.25s;
}
.video-thumb-link:hover .video-play-btn {
  background: #FF0000;
  transform: scale(1.1);
}
.video-play-btn::before {
  content: '';
  border-style: solid;
  border-width: 12px 0 12px 20px;
  border-color: transparent transparent transparent #fff;
  margin-left: 4px;
}
.video-thumb-meta {
  position: absolute;
  bottom: 10px; left: 12px; right: 12px;
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 8px;
}
.video-thumb-title {
  font-size: 13px; font-weight: 600; color: #fff;
  text-shadow: 0 1px 4px rgba(0,0,0,0.7);
  flex: 1;
}
.video-thumb-time {
  background: rgba(0,0,0,0.85); color: #fff;
  padding: 3px 8px; border-radius: 4px;
  font-size: 11px; font-weight: 600;
  font-family: 'Monaco', monospace;
  white-space: nowrap;
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: var(--bg-cream);
  border-top: 1px solid var(--border);
  gap: 12px;
}
.nav-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 22px;
  border-radius: 6px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  white-space: nowrap;
}
.nav-btn:hover:not(:disabled) {
  background: #0252C9;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(3,101,242,0.3);
}
.nav-btn:disabled {
  background: #C9C2B0;
  cursor: not-allowed;
  box-shadow: none;
}
.nav-btn.secondary {
  background: transparent;
  color: var(--ink-soft);
  border: 1.5px solid var(--border);
}
.nav-btn.secondary:hover:not(:disabled) {
  background: #fff;
  color: var(--ink);
  border-color: var(--ink);
}
.step-counter {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  text-align: center;
}

.step-content { display: none; animation: fadeIn 0.4s ease; }
.step-content.active { display: block; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.pulse { animation: pulse 1.8s ease-in-out infinite; transform-origin: center; }
@keyframes pulse {
  0%,100% { opacity: 1; }
  50% { opacity: 0.55; }
}
.glow { animation: glow 2s ease-in-out infinite; }
@keyframes glow {
  0%,100% { filter: drop-shadow(0 0 4px rgba(3,101,242,0.6)); }
  50% { filter: drop-shadow(0 0 12px rgba(3,101,242,1)); }
}
.float-y { animation: floatY 3s ease-in-out infinite; transform-origin: center; }
@keyframes floatY {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}
.spin-slow { animation: spinSlow 18s linear infinite; transform-origin: center; transform-box: fill-box; }
@keyframes spinSlow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
.dash-flow { stroke-dasharray: 4 4; animation: dashFlow 1.4s linear infinite; }
@keyframes dashFlow { to { stroke-dashoffset: -16; } }

/* QUIZ + RESULTS + CERTIFICATE — full set from the AI Basics tutorial */
.quiz-container {
  padding: 36px 32px;
  background: var(--bg-card);
  min-height: 560px;
}
.quiz-intro { text-align: center; max-width: 580px; margin: 0 auto; }
.quiz-intro .quiz-icon { font-size: 48px; margin-bottom: 12px; }
.quiz-intro h2 {
  font-family: Georgia, serif;
  font-size: 30px; color: var(--ink);
  margin-bottom: 12px;
}
.quiz-intro p { color: var(--ink-soft); font-size: 15px; margin-bottom: 22px; }
.quiz-stats {
  display: flex; justify-content: center;
  gap: 32px; margin-bottom: 26px; flex-wrap: wrap;
}
.quiz-stat { text-align: center; }
.quiz-stat .num {
  font-family: Georgia, serif;
  font-size: 32px; font-weight: 700;
  color: var(--accent);
  display: block; line-height: 1;
}
.quiz-stat .lbl {
  font-size: 11px; color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}

.quiz-question { max-width: 680px; margin: 0 auto; }
.quiz-progress {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 18px;
  font-size: 13px; color: var(--ink-muted);
}
.quiz-progress-bar {
  flex: 1; height: 6px;
  background: var(--bg-cream);
  border-radius: 3px;
  margin: 0 14px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--teal));
  transition: width 0.4s ease;
  border-radius: 3px;
}
.quiz-q-text {
  font-family: Georgia, serif;
  font-size: 22px; color: var(--ink);
  margin-bottom: 22px; line-height: 1.4;
}
.quiz-options { display: flex; flex-direction: column; gap: 10px; }
.quiz-option {
  background: var(--bg-card);
  border: 2px solid var(--border);
  padding: 14px 18px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 14.5px;
  color: var(--ink);
  text-align: left;
  transition: all 0.2s;
  font-family: inherit;
  line-height: 1.5;
  display: flex; align-items: flex-start; gap: 12px;
}
.quiz-option:hover:not(.disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateX(2px);
}
.quiz-option .opt-letter {
  width: 24px; height: 24px;
  background: var(--bg-cream);
  color: var(--ink-soft);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
  transition: all 0.2s;
}
.quiz-option:hover:not(.disabled) .opt-letter {
  background: var(--accent); color: #fff;
}
.quiz-option.correct {
  border-color: var(--success); background: var(--success-soft);
}
.quiz-option.correct .opt-letter { background: var(--success); color: #fff; }
.quiz-option.incorrect {
  border-color: var(--error); background: var(--error-soft);
}
.quiz-option.incorrect .opt-letter { background: var(--error); color: #fff; }
.quiz-option.disabled { cursor: not-allowed; opacity: 0.7; }

.quiz-feedback {
  margin-top: 18px;
  padding: 14px 18px;
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.6;
  display: none;
}
.quiz-feedback.show { display: block; animation: fadeIn 0.3s; }
.quiz-feedback.correct {
  background: var(--success-soft);
  border-left: 4px solid var(--success);
  color: #0A6B3D;
}
.quiz-feedback.incorrect {
  background: var(--error-soft);
  border-left: 4px solid var(--error);
  color: #8B1525;
}
.quiz-feedback strong { display: block; margin-bottom: 4px; }

.results-screen { text-align: center; padding: 24px 0; }
.score-circle { width: 160px; height: 160px; margin: 0 auto 18px; position: relative; }
.score-circle svg { transform: rotate(-90deg); }
.score-circle .score-text {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.score-circle .score-num {
  font-family: Georgia, serif;
  font-size: 44px; font-weight: 700;
  color: var(--ink);
}
.score-circle .score-lbl {
  font-size: 11px; color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
}
.results-msg {
  font-family: Georgia, serif;
  font-size: 26px; color: var(--ink);
  margin-bottom: 8px;
}
.results-sub {
  color: var(--ink-soft); font-size: 15px;
  margin-bottom: 22px; max-width: 480px;
  margin-left: auto; margin-right: auto;
}

.name-input-wrap { max-width: 440px; margin: 0 auto 24px; text-align: left; }
.name-input-wrap label {
  display: block;
  font-size: 12px; font-weight: 600;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 8px;
}
.name-input {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
}
.name-input:focus { outline: none; border-color: var(--accent); }

.results-actions {
  display: flex; gap: 12px;
  justify-content: center; flex-wrap: wrap;
}

.certificate-area { margin-top: 28px; display: none; }
.certificate-area.show { display: block; animation: fadeIn 0.5s; }
.certificate {
  background: linear-gradient(135deg, #FFFCF2 0%, #FFF8E1 100%);
  border: 12px double var(--ink);
  padding: 48px 56px;
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 12px 40px rgba(3,49,75,0.18);
  text-align: center;
}
.certificate::before, .certificate::after {
  content: '';
  position: absolute;
  width: 60px; height: 60px;
  border: 3px solid var(--highlight);
}
.certificate::before { top: 12px; left: 12px; border-right: none; border-bottom: none; }
.certificate::after { bottom: 12px; right: 12px; border-left: none; border-top: none; }
.cert-seal {
  position: absolute;
  top: 28px; right: 36px;
  width: 70px; height: 70px;
  background: radial-gradient(circle, var(--highlight) 0%, var(--tip-border) 100%);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 3px solid var(--ink);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  font-size: 28px;
}
.cert-eyebrow {
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 4px;
  text-transform: uppercase;
  margin-bottom: 6px;
  font-weight: 600;
}
.cert-title {
  font-family: Georgia, serif;
  font-size: 38px;
  color: var(--ink);
  font-weight: 700;
  margin-bottom: 4px;
}
.cert-divider {
  width: 80px; height: 2px;
  background: var(--tip-border);
  margin: 18px auto;
}
.cert-presented {
  font-size: 14px; color: var(--ink-soft);
  margin-bottom: 18px; font-style: italic;
}
.cert-name {
  font-family: 'Brush Script MT', 'Lucida Handwriting', cursive;
  font-size: 48px;
  color: var(--ink);
  margin-bottom: 8px;
  border-bottom: 1px solid #C9C2B0;
  padding-bottom: 10px;
  display: inline-block;
  min-width: 320px;
}
.cert-body {
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.7;
  margin: 18px auto;
  max-width: 540px;
}
.cert-body strong { color: var(--ink); }
.cert-footer {
  display: flex; justify-content: space-between; align-items: flex-end;
  margin-top: 32px;
  font-size: 12px; color: var(--ink-soft);
}
.cert-sig { text-align: center; }
.cert-sig-line {
  border-top: 1px solid var(--ink);
  padding-top: 6px;
  min-width: 160px;
  font-weight: 600;
  color: var(--ink);
}
.cert-sig-name {
  font-family: 'Brush Script MT', cursive;
  font-size: 22px;
  color: var(--ink);
  margin-bottom: -4px;
}
.cert-score { text-align: center; }
.cert-score-num {
  font-family: Georgia, serif;
  font-size: 32px; font-weight: 700;
  color: var(--success);
}

@media (max-width: 900px) {
  .wizard-body { grid-template-columns: 1fr; min-height: 0; }
  .visual-panel {
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 24px;
  }
  .canvas-frame { max-width: 420px; }
  .instruction-panel { padding: 28px; }
  .step-title { font-size: 24px; }
  .certificate { padding: 36px 32px; }
  .cert-title { font-size: 30px; }
  .cert-name { font-size: 38px; min-width: 240px; }
}

@media (max-width: 600px) {
  .wizard-page-wrap { padding: 16px 0; }
  .wizard { border-radius: 0; }
  .wizard-header { padding: 18px 20px; }
  .wizard-header h1 { font-size: 19px; }
  .wizard-header p { font-size: 12px; }
  .progress-bar { padding: 12px 16px; gap: 3px; }
  .progress-step { height: 3px; }
  .visual-panel { padding: 16px; }
  .canvas-frame { max-width: 100%; }
  .instruction-panel { padding: 24px 20px 28px; }
  .step-label { font-size: 10px; padding: 4px 10px; margin-bottom: 12px; }
  .step-title { font-size: 21px; line-height: 1.3; }
  .step-description { font-size: 14.5px; }
  .step-tip { font-size: 12.5px; padding: 10px 14px; }

  .quiz-container { padding: 24px 20px 28px; min-height: 0; }
  .quiz-intro h2 { font-size: 24px; }
  .quiz-q-text { font-size: 18px; }
  .quiz-stats { gap: 18px; }
  .results-msg { font-size: 22px; }
  .score-circle { width: 130px; height: 130px; }
  .score-circle .score-num { font-size: 36px; }

  .certificate { padding: 28px 18px; border-width: 8px; }
  .cert-seal { width: 50px; height: 50px; font-size: 20px; top: 14px; right: 14px; }
  .cert-title { font-size: 22px; }
  .cert-eyebrow { font-size: 10px; letter-spacing: 2px; }
  .cert-name { font-size: 30px; min-width: 200px; }
  .cert-body { font-size: 12.5px; }
  .cert-footer { flex-direction: column; gap: 18px; }

  .nav-btn { padding: 10px 16px; font-size: 13px; }
  .step-counter { font-size: 11px; }

  .video-play-btn { width: 50px; height: 50px; }
  .video-play-btn::before { border-width: 9px 0 9px 15px; }
  .video-thumb-title { font-size: 12px; }
}

@media print {
  body > *:not(.wizard-page-wrap) { display: none !important; }
  .wizard, .wizard-header, .progress-bar, .wizard-footer,
  .quiz-container > *:not(.certificate-area),
  .results-screen,
  .wizard-breadcrumbs,
  .reading-progress { display: none !important; }
  .wizard { box-shadow: none; }
  .certificate-area, .certificate-area.show {
    display: block !important;
    padding: 0; margin: 0;
  }
  .certificate { box-shadow: none; max-width: 100%; margin: 0; }
  @page { size: landscape; margin: 0.4in; }
}

/* =====================================================================
   DARK MODE OVERRIDES FOR WIZARD
   ===================================================================== */
:root[data-theme="dark"] .wizard { background: var(--bg-card); }
:root[data-theme="dark"] .visual-panel { background: var(--bg-page); }
:root[data-theme="dark"] .canvas-frame { background: #2A3744; border-color: var(--border); }
:root[data-theme="dark"] .canvas-bar { background: #1A2530; border-color: var(--border); }
:root[data-theme="dark"] .canvas-screen { background: #FAFAF6; }  /* keep SVGs on light bg for legibility */
:root[data-theme="dark"] .progress-bar { background: var(--bg-page); border-color: var(--border); }
:root[data-theme="dark"] .progress-step { background: #3A4754; }
:root[data-theme="dark"] .instruction-panel { background: var(--bg-card); }
:root[data-theme="dark"] .wizard-footer { background: var(--bg-page); border-color: var(--border); }
:root[data-theme="dark"] .quiz-container { background: var(--bg-card); }
:root[data-theme="dark"] .quiz-option { background: var(--bg-card); color: var(--ink); }
:root[data-theme="dark"] .quiz-option:hover:not(.disabled) { background: var(--accent-soft); }
:root[data-theme="dark"] .step-description code {
  background: #2A3744;
  border-color: var(--border);
  color: var(--accent);
}
:root[data-theme="dark"] .step-tip {
  background: rgba(245,200,66,0.12);
  color: var(--highlight);
}
:root[data-theme="dark"] .step-tip strong { color: #FFE08A; }

/* Certificate stays light-themed even in dark mode (it's meant to be printed) */
:root[data-theme="dark"] .certificate { background: linear-gradient(135deg, #FFFCF2 0%, #FFF8E1 100%); color: #03314B; }
:root[data-theme="dark"] .certificate h2,
:root[data-theme="dark"] .cert-title,
:root[data-theme="dark"] .cert-name { color: #03314B; }
:root[data-theme="dark"] .cert-body,
:root[data-theme="dark"] .cert-presented { color: #4A6378; }
