/* =========================================================
   LEARNING REWIRED LAB — MISTAKE RECOVERY COACH
   Design Lab detail page
   URL: /resource-lab/mistake-recovery-coach/
   Depends on:
   - /global.css
   - /assets/css/lab-detail.css
   ========================================================= */

.mistake-recovery-page {
  --mrc-ink: #f8fbff;
  --mrc-muted: rgba(226, 232, 240, 0.76);
  --mrc-muted-strong: rgba(226, 232, 240, 0.92);
  --mrc-line: rgba(148, 163, 184, 0.22);
  --mrc-line-strong: rgba(148, 163, 184, 0.34);
  --mrc-panel: rgba(10, 24, 42, 0.78);
  --mrc-panel-soft: rgba(255, 255, 255, 0.06);
  --mrc-panel-strong: rgba(12, 28, 50, 0.94);
  --mrc-cyan: #66e3ff;
  --mrc-lime: #b9ff7a;
  --mrc-blue: #72a7ff;
  --mrc-gold: #ffd36e;
  --mrc-pink: #ff87c8;
  --mrc-shadow: 0 22px 62px rgba(0, 0, 0, 0.24);
  --mrc-shadow-soft: 0 16px 44px rgba(0, 0, 0, 0.18);

  position: relative;
  width: 100%;
  overflow: hidden;
  color: var(--mrc-ink);
}

.mistake-recovery-page *,
.mistake-recovery-page *::before,
.mistake-recovery-page *::after {
  box-sizing: border-box;
}

.mistake-recovery-page h1,
.mistake-recovery-page h2,
.mistake-recovery-page h3,
.mistake-recovery-page p,
.mistake-recovery-page blockquote {
  margin: 0;
}

.mistake-recovery-page a {
  color: inherit;
}

.mistake-recovery-page button {
  font: inherit;
}

/* =========================================================
   Shared shell corrections
   ========================================================= */

.mistake-recovery-page .resource-detail-inner,
.mistake-recovery-page .dld-shell {
  width: min(1120px, calc(100% - 40px));
  max-width: 1120px;
  margin-inline: auto;
}

.mistake-recovery-page .resource-detail-hero {
  max-width: 1120px;
  margin: 0 auto clamp(42px, 6vw, 72px);
}

.mistake-recovery-page .resource-detail-hero h1 {
  max-width: 980px;
  padding-right: 0.12em;
  padding-bottom: 0.12em;
  overflow: visible;
}

.mistake-recovery-page .resource-detail-gradient {
  display: inline-block;
  padding-right: 0.08em;
  padding-bottom: 0.1em;
}

/* =========================================================
   Page article rhythm
   ========================================================= */

.mrc-article {
  display: grid;
  gap: clamp(40px, 5vw, 64px);
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.mrc-section {
  width: 100%;
  margin: 0 auto;
}

.mrc-reading-section {
  max-width: 920px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--mrc-line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 8% 0%, rgba(102, 227, 255, 0.11), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(185, 255, 122, 0.07), transparent 32%),
    rgba(255, 255, 255, 0.045);
  box-shadow: var(--mrc-shadow-soft);
}

.mrc-card-section,
.mrc-panel-section,
.mrc-preview-section,
.mrc-code-section,
.mrc-closing-section {
  max-width: 1120px;
}

.mrc-panel-section,
.mrc-preview-section,
.mrc-code-section {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--mrc-line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 10% 0%, rgba(102, 227, 255, 0.12), transparent 34%),
    radial-gradient(circle at 92% 12%, rgba(185, 255, 122, 0.08), transparent 32%),
    rgba(255, 255, 255, 0.045);
  box-shadow: var(--mrc-shadow-soft);
}

.mrc-section-header {
  max-width: 820px;
  margin: 0 0 28px;
}

.mrc-kicker {
  display: inline-flex;
  width: fit-content;
  margin: 0 0 16px;
  padding: 8px 11px;
  border: 1px solid rgba(102, 227, 255, 0.2);
  border-radius: 999px;
  background: rgba(102, 227, 255, 0.1);
  color: var(--mrc-cyan);
  font-size: 0.7rem;
  font-weight: 920;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.mrc-reading-section h2,
.mrc-section-header h2,
.mrc-closing-card h2 {
  max-width: 780px;
  margin: 0 0 18px;
  color: var(--mrc-ink);
  font-size: clamp(2.15rem, 4vw, 3.15rem);
  font-weight: 820;
  line-height: 1;
  letter-spacing: -0.058em;
  text-wrap: balance;
}

.mrc-reading-section p:not(.mrc-kicker),
.mrc-section-header p:not(.mrc-kicker),
.mrc-closing-card p:not(.mrc-kicker) {
  max-width: 720px;
  color: var(--mrc-muted);
  font-size: clamp(1rem, 1.35vw, 1.08rem);
  line-height: 1.72;
}

.mrc-reading-section p + p {
  margin-top: 18px;
}

/* =========================================================
   Cards
   ========================================================= */

.mrc-card-grid,
.mistake-recovery-use-grid {
  display: grid;
  gap: 18px;
}

.mrc-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mistake-recovery-use-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mrc-info-card,
.mistake-recovery-use {
  padding: 24px;
  border: 1px solid var(--mrc-line);
  border-radius: 26px;
  background:
    radial-gradient(circle at 92% 12%, rgba(102, 227, 255, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.055);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.mrc-info-card span {
  display: inline-flex;
  width: fit-content;
  margin-bottom: 16px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(102, 227, 255, 0.1);
  color: var(--mrc-cyan);
  font-size: 0.68rem;
  font-weight: 920;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.mrc-info-card h3,
.mistake-recovery-use h3 {
  margin: 0 0 12px;
  color: var(--mrc-ink);
  font-size: 1.35rem;
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.mrc-info-card p,
.mistake-recovery-use p {
  margin: 0;
  color: var(--mrc-muted);
  font-size: 0.96rem;
  line-height: 1.62;
}

/* =========================================================
   Live preview demo
   ========================================================= */

.mistake-recovery-demo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
  gap: 18px;
  padding: clamp(18px, 3vw, 30px);
  border: 1px solid var(--mrc-line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 92% 10%, rgba(102, 227, 255, 0.1), transparent 30%),
    radial-gradient(circle at 8% 92%, rgba(185, 255, 122, 0.08), transparent 34%),
    rgba(255, 255, 255, 0.045);
  box-shadow: var(--mrc-shadow);
}

.mistake-recovery-scenario,
.mistake-recovery-output,
.mistake-recovery-choice {
  border: 1px solid var(--mrc-line);
  background:
    radial-gradient(circle at 92% 12%, rgba(102, 227, 255, 0.08), transparent 38%),
    rgba(255, 255, 255, 0.055);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.mistake-recovery-scenario,
.mistake-recovery-output {
  padding: clamp(22px, 3vw, 30px);
  border-radius: 26px;
}

.mistake-recovery-scenario-label,
.mistake-recovery-output-label {
  margin: 0 0 12px;
  color: var(--mrc-cyan);
  font-size: 0.72rem;
  font-weight: 920;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mistake-recovery-scenario h3,
.mistake-recovery-output h3 {
  margin: 0 0 12px;
  color: var(--mrc-ink);
  font-size: clamp(1.45rem, 2.8vw, 2.3rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-weight: 820;
}

.mistake-recovery-scenario p:not(.mistake-recovery-scenario-label),
.mistake-recovery-output p {
  margin: 0;
  color: var(--mrc-muted);
  font-size: 0.98rem;
  line-height: 1.65;
}

.mistake-recovery-status {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--mrc-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--mrc-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.mistake-recovery-status span {
  display: block;
  margin-bottom: 6px;
  color: var(--mrc-cyan);
  font-size: 0.68rem;
  font-weight: 920;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.mistake-recovery-choices {
  display: grid;
  align-content: start;
  gap: 12px;
}

.mistake-recovery-choice {
  width: 100%;
  padding: 17px 18px;
  border-radius: 20px;
  color: var(--mrc-muted-strong);
  font-size: 0.95rem;
  font-weight: 760;
  line-height: 1.4;
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    box-shadow 0.18s ease;
}

.mistake-recovery-choice:hover,
.mistake-recovery-choice.active,
.mistake-recovery-choice.is-active {
  transform: translateY(-1px);
  border-color: rgba(102, 227, 255, 0.42);
  background:
    radial-gradient(circle at top right, rgba(102, 227, 255, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.085);
  color: var(--mrc-ink);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
}

.mistake-recovery-output {
  grid-column: 1 / -1;
}

.mistake-recovery-meter {
  margin-top: 24px;
}

.mistake-recovery-meter-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--mrc-muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.mistake-recovery-meter-top strong {
  color: var(--mrc-ink);
}

.mistake-recovery-track {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
}

.mistake-recovery-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--mrc-cyan), var(--mrc-lime));
  transition: width 0.28s ease;
}

.mistake-recovery-coaching {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--mrc-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--mrc-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.mistake-recovery-coaching strong {
  color: var(--mrc-ink);
}

/* =========================================================
   Starter code
   ========================================================= */

.mrc-code-box {
  overflow: hidden;
  border: 1px solid var(--mrc-line);
  border-radius: 26px;
  background: rgba(3, 8, 18, 0.92);
  box-shadow: var(--mrc-shadow);
}

.mrc-code-box pre {
  margin: 0;
  max-height: 560px;
  overflow: auto;
  padding: clamp(18px, 3vw, 26px);
  color: rgba(226, 232, 240, 0.92);
  font-size: 0.84rem;
  line-height: 1.65;
}

.mrc-code-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

/* =========================================================
   Closing
   ========================================================= */

.mrc-closing-card {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid var(--mrc-line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 8%, rgba(102, 227, 255, 0.14), transparent 34%),
    radial-gradient(circle at 88% 20%, rgba(185, 255, 122, 0.09), transparent 36%),
    rgba(255, 255, 255, 0.055);
  box-shadow: var(--mrc-shadow);
  text-align: left;
}

.mrc-closing-card p {
  max-width: 760px;
}

.mrc-closing-card .resource-detail-actions {
  justify-content: flex-start;
  margin-top: 26px;
}

.mistake-recovery-page .resource-detail-btn.secondary {
  border-color: var(--mrc-line);
  background: rgba(255, 255, 255, 0.075);
  color: var(--mrc-ink) !important;
  box-shadow: none;
}

/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1100px) {
  .mrc-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mistake-recovery-use-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mistake-recovery-demo {
    grid-template-columns: 1fr;
  }

  .mistake-recovery-output {
    grid-column: auto;
  }
}

@media (max-width: 760px) {
  .mistake-recovery-page .resource-detail-inner,
  .mistake-recovery-page .dld-shell {
    width: min(100% - 32px, 1120px);
  }

  .mrc-article {
    gap: 42px;
  }

  .mrc-reading-section,
  .mrc-panel-section,
  .mrc-preview-section,
  .mrc-code-section,
  .mrc-closing-card {
    padding: 20px;
    border-radius: 26px;
  }

  .mrc-card-grid,
  .mistake-recovery-use-grid {
    grid-template-columns: 1fr;
  }

  .mrc-reading-section h2,
  .mrc-section-header h2,
  .mrc-closing-card h2 {
    font-size: clamp(2.1rem, 10vw, 3.1rem);
    line-height: 1;
  }

  .mistake-recovery-demo {
    padding: 16px;
    border-radius: 24px;
  }

  .mistake-recovery-scenario,
  .mistake-recovery-output {
    padding: 20px;
    border-radius: 22px;
  }

  .mistake-recovery-meter-top {
    flex-direction: column;
    gap: 4px;
  }

  .mrc-closing-card .resource-detail-actions,
  .mrc-closing-card .resource-detail-btn {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .mistake-recovery-page .resource-detail-inner,
  .mistake-recovery-page .dld-shell {
    width: min(100% - 28px, 1120px);
  }

  .mrc-info-card,
  .mistake-recovery-use {
    padding: 20px;
    border-radius: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mistake-recovery-choice,
  .mistake-recovery-fill {
    transition: none !important;
  }

  .mistake-recovery-choice:hover,
  .mistake-recovery-choice.active,
  .mistake-recovery-choice.is-active {
    transform: none !important;
  }
}

/* =========================================================
   v2 LIGHT EDITORIAL MIGRATION
   ---------------------------------------------------------
   Page was authored as a dark glass theme (--mrc-ink near-white,
   surfaces built from translucent white meant for a dark page).
   The shared shell is now light (body #fff), so cards went
   white-on-white and near-white text vanished. Remap the page's
   local text/line/accent/shadow tokens to the light system and
   give every translucent surface a solid light background.
   Intentionally-dark code boxes keep their own light code text.
   ========================================================= */
.mistake-recovery-page {
  --mrc-ink: #0f172a;
  --mrc-muted: #475569;
  --mrc-muted-strong: #334155;
  --mrc-line: rgba(15, 23, 42, 0.10);
  --mrc-line-strong: rgba(15, 23, 42, 0.16);
  --mrc-cyan: #0e7490;
  --mrc-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  --mrc-shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.mistake-recovery-page .mrc-reading-section,
.mistake-recovery-page .mrc-panel-section,
.mistake-recovery-page .mrc-preview-section,
.mistake-recovery-page .mrc-code-section,
.mistake-recovery-page .mistake-recovery-demo {
  background: #f8fafc;
}

.mistake-recovery-page .mrc-info-card,
.mistake-recovery-page .mistake-recovery-use,
.mistake-recovery-page .mistake-recovery-scenario,
.mistake-recovery-page .mistake-recovery-output,
.mistake-recovery-page .mistake-recovery-choice,
.mistake-recovery-page .mistake-recovery-status,
.mistake-recovery-page .mistake-recovery-coaching,
.mistake-recovery-page .mrc-closing-card,
.mistake-recovery-page .resource-detail-btn.secondary {
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.mistake-recovery-page .mistake-recovery-choice:hover,
.mistake-recovery-page .mistake-recovery-choice.active,
.mistake-recovery-page .mistake-recovery-choice.is-active {
  background: #eef6ff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}
