/* =========================================================
   LEARNING REWIRED LAB — TROUBLESHOOTING FLOW PROTOTYPE
   Design Lab detail page
   URL: /resource-lab/troubleshooting-flow-prototype/
   Depends on:
   - /global.css
   - /assets/css/lab-detail.css
   ========================================================= */

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

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

.troubleshooting-flow-page *,
.troubleshooting-flow-page *::before,
.troubleshooting-flow-page *::after {
  box-sizing: border-box;
}

.troubleshooting-flow-page h1,
.troubleshooting-flow-page h2,
.troubleshooting-flow-page h3,
.troubleshooting-flow-page h4,
.troubleshooting-flow-page p {
  margin: 0;
}

.troubleshooting-flow-page a {
  color: inherit;
}

.troubleshooting-flow-page button {
  font: inherit;
}

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

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

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

.troubleshooting-flow-page .resource-detail-hero h1 {
  max-width: 1020px;
  padding-right: 0.12em;
  padding-bottom: 0.12em;
  overflow: visible;
}

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

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

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

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

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

.tfp-overview-section,
.tfp-demo-section,
.tfp-panel-section,
.tfp-code-section,
.tfp-related,
.tfp-closing {
  max-width: 1120px;
}

.tfp-reading-section {
  max-width: 920px;
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--tfp-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(--tfp-shadow-soft);
}

.tfp-demo-section,
.tfp-panel-section,
.tfp-code-section,
.tfp-related {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--tfp-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(--tfp-shadow-soft);
}

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

.tfp-kicker,
.tfp-card-kicker,
.tfp-info-card span,
.tfp-card-grid article span,
.tfp-related-grid a span {
  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(--tfp-cyan);
  font-size: 0.7rem;
  font-weight: 920;
  letter-spacing: 0.11em;
  line-height: 1;
  text-transform: uppercase;
}

.tfp-card-kicker {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tfp-cyan);
}

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

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

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

/* =========================================================
   Overview
   ========================================================= */

.tfp-overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.tfp-info-card,
.tfp-demo-panel,
.tfp-result-panel,
.tfp-question-card,
.tfp-card-grid article,
.tfp-use-grid article,
.tfp-related-grid a {
  border: 1px solid var(--tfp-line);
  border-radius: 28px;
  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);
}

.tfp-info-card {
  padding: 24px;
}

.tfp-info-card h2 {
  margin: 0 0 12px;
  color: var(--tfp-ink);
  font-size: clamp(1.75rem, 3vw, 2.45rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.tfp-info-card p {
  margin: 0;
  color: var(--tfp-muted);
  font-size: 0.96rem;
  line-height: 1.62;
}

/* =========================================================
   Live prototype
   ========================================================= */

.tfp-demo {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  gap: 20px;
  align-items: stretch;
}

.tfp-demo-panel,
.tfp-result-panel {
  padding: clamp(22px, 3vw, 28px);
}

.tfp-progress {
  display: grid;
  grid-template-columns: auto 1fr auto 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 24px;
}

.tfp-progress > i {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: var(--tfp-line);
}

.tfp-step {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.tfp-step span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--tfp-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--tfp-muted);
  font-size: 14px;
  font-weight: 920;
}

.tfp-step b {
  color: var(--tfp-muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tfp-step.is-active span {
  border-color: rgba(102, 227, 255, 0.44);
  background: rgba(102, 227, 255, 0.12);
  color: var(--tfp-cyan);
}

.tfp-step.is-complete span {
  border-color: rgba(185, 255, 122, 0.48);
  background: linear-gradient(135deg, var(--tfp-cyan), var(--tfp-lime));
  color: #071321;
}

.tfp-question-card {
  padding: clamp(22px, 3vw, 28px);
}

.tfp-question-card.is-hidden {
  display: none;
}

.tfp-question-card h3,
.tfp-feedback-box h3,
.tfp-card-grid h3,
.tfp-use-grid h3,
.tfp-related-grid h3 {
  margin: 0 0 12px;
  color: var(--tfp-ink);
  font-size: clamp(1.45rem, 2.8vw, 2.35rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.tfp-question-card p,
.tfp-feedback-box p,
.tfp-card-grid p,
.tfp-use-grid p,
.tfp-related-grid p {
  margin: 0;
  color: var(--tfp-muted);
  font-size: 0.96rem;
  line-height: 1.62;
}

.tfp-choice-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}

.tfp-choice-list button {
  width: 100%;
  padding: 18px;
  border: 1px solid var(--tfp-line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--tfp-muted-strong);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease,
    color 0.18s ease;
}

.tfp-choice-list button:hover,
.tfp-choice-list button.is-active,
.tfp-choice-list button.active {
  transform: translateY(-2px);
  border-color: rgba(102, 227, 255, 0.48);
  background:
    radial-gradient(circle at top right, rgba(102, 227, 255, 0.12), transparent 42%),
    rgba(255, 255, 255, 0.085);
  color: var(--tfp-ink);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
}

.tfp-choice-list strong,
.tfp-choice-list span {
  display: block;
}

.tfp-choice-list strong {
  font-size: 0.96rem;
  line-height: 1.35;
}

.tfp-choice-list span {
  margin-top: 7px;
  color: var(--tfp-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

/* =========================================================
   Result panel
   ========================================================= */

.tfp-result-top {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.tfp-result-top span {
  display: inline-flex;
  padding: 8px 12px;
  border: 1px solid rgba(102, 227, 255, 0.2);
  border-radius: 999px;
  background: rgba(102, 227, 255, 0.1);
  color: var(--tfp-cyan);
  font-size: 0.78rem;
  font-weight: 850;
}

.tfp-score-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.tfp-score-grid div {
  min-height: 108px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 16px;
  border: 1px solid var(--tfp-line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.055);
}

.tfp-score-grid span {
  color: var(--tfp-muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tfp-score-grid strong {
  color: var(--tfp-cyan);
  font-size: 2.1rem;
  line-height: 0.9;
  letter-spacing: -0.06em;
}

.tfp-feedback-box,
.tfp-path-summary {
  padding: 24px;
  border: 1px solid var(--tfp-line);
  border-radius: 24px;
}

.tfp-feedback-box {
  background:
    radial-gradient(circle at top right, rgba(185, 255, 122, 0.1), transparent 42%),
    rgba(255, 255, 255, 0.055);
}

.tfp-path-summary {
  margin-top: 14px;
  background: rgba(3, 8, 18, 0.72);
}

.tfp-path-summary span {
  display: block;
  margin-bottom: 10px;
  color: var(--tfp-lime);
  font-size: 0.72rem;
  font-weight: 920;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tfp-path-summary ol {
  margin: 0;
  padding-left: 20px;
  color: var(--tfp-muted-strong);
  line-height: 1.65;
}

.tfp-reset {
  width: 100%;
  min-height: 46px;
  margin-top: 14px;
  padding: 0 18px;
  border: 1px solid var(--tfp-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  color: var(--tfp-ink);
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    background 0.22s ease,
    color 0.22s ease;
}

.tfp-reset:hover {
  transform: translateY(-2px);
  border-color: rgba(102, 227, 255, 0.38);
  background: rgba(102, 227, 255, 0.1);
}

/* =========================================================
   Cards / related / code
   ========================================================= */

.tfp-card-grid,
.tfp-use-grid,
.tfp-related-grid {
  display: grid;
  gap: 18px;
  margin-top: 30px;
}

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

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

.tfp-card-grid article,
.tfp-use-grid article,
.tfp-related-grid a {
  padding: 24px;
}

.tfp-related-grid a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.tfp-related-grid a:hover {
  transform: translateY(-4px);
  border-color: rgba(102, 227, 255, 0.38);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.tfp-related-grid strong {
  margin-top: 24px;
  color: var(--tfp-cyan);
  font-size: 15px;
  font-weight: 900;
}

.tfp-related-grid strong::after {
  content: " →";
}

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

.tfp-code-box pre {
  margin: 0;
  max-height: 560px;
  overflow: auto;
  padding: clamp(20px, 3vw, 28px);
  white-space: pre-wrap;
}

.tfp-code-box code {
  color: rgba(226, 232, 240, 0.92);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 0.84rem;
  line-height: 1.65;
}

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

.tfp-closing-card {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid var(--tfp-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(--tfp-shadow);
  text-align: left;
}

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

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

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

@media (max-width: 1050px) {
  .tfp-overview-grid,
  .tfp-demo,
  .tfp-card-grid,
  .tfp-related-grid {
    grid-template-columns: 1fr;
  }

  .tfp-use-grid {
    grid-template-columns: 1fr;
  }
}

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

  .tfp-article {
    gap: 42px;
  }

  .tfp-reading-section,
  .tfp-demo-section,
  .tfp-panel-section,
  .tfp-code-section,
  .tfp-related,
  .tfp-closing-card {
    padding: 20px;
    border-radius: 26px;
  }

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

  .tfp-demo-panel,
  .tfp-result-panel,
  .tfp-question-card,
  .tfp-info-card,
  .tfp-card-grid article,
  .tfp-use-grid article,
  .tfp-related-grid a {
    padding: 20px;
    border-radius: 22px;
  }

  .tfp-progress {
    grid-template-columns: 1fr;
    justify-items: start;
  }

  .tfp-progress > i {
    width: 2px;
    height: 16px;
    margin-left: 19px;
  }

  .tfp-step {
    grid-template-columns: auto 1fr;
    align-items: center;
    justify-items: start;
  }

  .tfp-score-grid {
    grid-template-columns: 1fr;
  }

  .tfp-result-top {
    display: grid;
  }

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

  .tfp-code-box code {
    font-size: 12px;
  }
}

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

@media (prefers-reduced-motion: reduce) {
  .tfp-choice-list button,
  .tfp-reset,
  .tfp-related-grid a {
    transition: none !important;
  }

  .tfp-choice-list button:hover,
  .tfp-choice-list button.is-active,
  .tfp-choice-list button.active,
  .tfp-reset:hover,
  .tfp-related-grid a:hover {
    transform: none !important;
  }
}

/* =========================================================
   v2 LIGHT EDITORIAL MIGRATION
   ---------------------------------------------------------
   Page was authored as a dark glass theme (--tfp-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.
   ========================================================= */
.troubleshooting-flow-page {
  --tfp-ink: #0f172a;
  --tfp-muted: #475569;
  --tfp-muted-strong: #334155;
  --tfp-line: rgba(15, 23, 42, 0.10);
  --tfp-line-strong: rgba(15, 23, 42, 0.16);
  --tfp-cyan: #0e7490;
  --tfp-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
  --tfp-shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.troubleshooting-flow-page .tfp-reading-section,
.troubleshooting-flow-page .tfp-demo-section,
.troubleshooting-flow-page .tfp-panel-section,
.troubleshooting-flow-page .tfp-code-section,
.troubleshooting-flow-page .tfp-related {
  background: #f8fafc;
}

.troubleshooting-flow-page .tfp-info-card,
.troubleshooting-flow-page .tfp-demo-panel,
.troubleshooting-flow-page .tfp-result-panel,
.troubleshooting-flow-page .tfp-question-card,
.troubleshooting-flow-page .tfp-card-grid article,
.troubleshooting-flow-page .tfp-use-grid article,
.troubleshooting-flow-page .tfp-related-grid a,
.troubleshooting-flow-page .tfp-step span,
.troubleshooting-flow-page .tfp-choice-list button,
.troubleshooting-flow-page .tfp-score-grid div,
.troubleshooting-flow-page .tfp-feedback-box,
.troubleshooting-flow-page .tfp-reset,
.troubleshooting-flow-page .tfp-closing-card,
.troubleshooting-flow-page .resource-detail-btn.secondary {
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

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

.troubleshooting-flow-page .tfp-path-summary {
  background: #f1f5f9;
}
