/* v2-shared.css — common styles for redesigned pages
   Built on top of the existing ATC design system (tokens.css inline in each page) */

/* ───── Top reading-progress bar ───── */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  background: linear-gradient(90deg, #F5C85E 0%, #3478F6 100%);
  z-index: 60;
  width: 0%;
  transition: width .12s linear;
}

/* ───── Reveal on scroll ───── */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .55s cubic-bezier(.22,1,.36,1),
              transform .55s cubic-bezier(.22,1,.36,1);
}
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal[data-stagger="1"] { transition-delay: .06s; }
.reveal[data-stagger="2"] { transition-delay: .12s; }
.reveal[data-stagger="3"] { transition-delay: .18s; }
.reveal[data-stagger="4"] { transition-delay: .24s; }
.reveal[data-stagger="5"] { transition-delay: .30s; }

/* ───── Title underline gold accent ───── */
.title-underline {
  position: relative;
  display: inline-block;
}
.title-underline::after {
  content: "";
  position: absolute;
  left: 0; bottom: -.05em;
  height: .26em; width: 100%;
  background: linear-gradient(90deg, #F5C85E 0%, rgba(245,200,94,0) 100%);
  border-radius: 999px;
  z-index: -1;
  opacity: .55;
}

/* ───── Progress ring (SVG-based) ───── */
.ring-bg, .ring-fg {
  fill: none;
  stroke-width: 8;
}
.ring-bg { stroke: rgba(255,255,255,.18); }
.ring-fg {
  stroke: #F5C85E;
  stroke-linecap: round;
  transition: stroke-dashoffset .9s cubic-bezier(.22,1,.36,1);
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}
.ring-fg--royal { stroke: #3478F6; }

/* ───── Stat tile (translucent on hero) ───── */
.stat-tile {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(6px);
  border-radius: 1rem;
  padding: .85rem 1rem;
}
.stat-tile-light {
  background: #F8FBFF;
  border-radius: 1rem;
  padding: .85rem 1rem;
}

/* ───── Streak flame ───── */
@keyframes flicker {
  0%, 100% { transform: rotate(-2deg) scale(1); }
  50%      { transform: rotate(2deg) scale(1.05); }
}
.streak-flame {
  display: inline-block;
  transform-origin: center bottom;
  animation: flicker 1.4s ease-in-out infinite;
}

/* ───── Floating chip ───── */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}
.float-chip { animation: float 3.6s ease-in-out infinite; }

.card-hover {
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease, background .22s ease;
}
.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 42px rgba(20,58,134,.10);
}

@keyframes pulseRing {
  0%   { box-shadow: 0 0 0 0 rgba(245,200,94,.45); }
  70%  { box-shadow: 0 0 0 10px rgba(245,200,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(245,200,94,0); }
}
.pulse-gold { animation: pulseRing 2.2s ease-out infinite; }

/* ───── Confetti / celebration burst ───── */
.confetti {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  width: 100vw; height: 100vh;
  top: 0; left: 0;
  overflow: hidden;
}
.confetti span {
  position: absolute;
  width: 8px; height: 14px;
  border-radius: 2px;
  animation: fall 1.6s cubic-bezier(.4,.5,.5,1) forwards;
}
@keyframes fall {
  to { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

/* ───── Lesson nav item — module page ───── */
.lesson-nav-v2 {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .75rem .85rem;
  min-height: 44px; /* a11y-fix: touch target */
  border-radius: 1rem;
  cursor: pointer;
  transition: background .18s ease;
  font-size: .85rem;
  font-weight: 700;
  color: #475569;
  position: relative;
}
.lesson-nav-v2:hover { background: #EEF6FF; }
.lesson-nav-v2.active {
  background: linear-gradient(135deg, #EEF6FF, #FFF8EA);
  color: #143A86;
  box-shadow: 0 4px 14px rgba(20,58,134,.06);
}
.lesson-nav-v2.locked { opacity: .58; cursor: not-allowed; }
.lesson-nav-v2.done .lesson-nav-icon {
  background: #059669; color: white; border-color: #059669;
}
.lesson-nav-icon {
  width: 26px; height: 26px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px;
  border: 2px solid #94A3B8; /* a11y-fix: was #CBD5E1 ~1.6:1 → ~3.3:1 */
  background: white;
  color: #94A3B8;
  font-size: .7rem;
  font-weight: 900;
  flex-shrink: 0;
  transition: all .2s;
}
.lesson-nav-v2.active .lesson-nav-icon {
  background: #3478F6; color: white; border-color: #3478F6;
}
.lesson-nav-v2 .lesson-nav-meta {
  font-size: .65rem;
  font-weight: 700;
  color: #64748B; /* a11y-fix: was #94A3B8 ~2.8:1 → ~4.5:1 */
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 2px;
}

/* ───── TOC link ───── */
.toc-link {
  display: block;
  padding: .5rem .7rem;
  border-left: 2px solid transparent;
  font-size: .82rem;
  font-weight: 600;
  color: #64748B;
  transition: all .15s ease;
  line-height: 1.5;
}
.toc-link:hover { color: #143A86; border-left-color: #94A3B8; }
.toc-link.active {
  color: #143A86;
  border-left-color: #F5C85E;
  background: rgba(245,200,94,.08);
  font-weight: 800;
}

/* ───── Reaction button ───── */
.reaction-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .55rem .9rem;
  border-radius: 999px;
  background: white;
  border: 1.5px solid #E2E8F0;
  font-size: .82rem;
  font-weight: 800;
  color: #475569;
  transition: all .18s ease;
  cursor: pointer;
}
.reaction-btn:hover {
  border-color: #3478F6;
  color: #3478F6;
  background: #EEF6FF;
  transform: translateY(-1px);
}
.reaction-btn.active {
  background: linear-gradient(135deg, #FFF8EA, #F5C85E22);
  border-color: #F5C85E;
  color: #A96F0C;
}

/* ───── Article in-body CTA ───── */
.article-readiness-cta {
  background: linear-gradient(135deg, #EEF6FF 0%, #EAF3FF 100%);
  border: 1px solid rgba(52,120,246,.08);
}
.prose-article a.article-cta-button {
  color: #fff !important;
  text-decoration: none !important;
}
.prose-article a.article-cta-button:hover,
.prose-article a.article-cta-button:focus {
  color: #fff !important;
  text-decoration: none !important;
}

/* ───── Highlight save button on blockquote (module) ───── */
.quote-actions {
  display: flex;
  gap: .5rem;
  margin-top: .8rem;
  font-size: .72rem;
  font-weight: 700;
}
.quote-action {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .65rem;
  border-radius: 999px;
  background: rgba(255,255,255,.7);
  color: #143A86;
  border: 1px solid rgba(52,120,246,.18);
  cursor: pointer;
  transition: all .15s ease;
}
.quote-action:hover { background: white; border-color: #3478F6; }

/* ───── Compare grid (module) ───── */
.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}
.compare-cell {
  border-radius: 1.25rem;
  padding: 1.25rem;
  font-size: .9rem;
  line-height: 1.65;
}
.compare-cell-agency {
  background: linear-gradient(160deg, #FFF8EA, #FFFAEF);
  border: 2px solid #F5C85E;
  position: relative;
}
.compare-cell-client {
  background: linear-gradient(160deg, #EEF6FF, #F7FBFF);
  border: 2px solid #3478F6;
  position: relative;
}
.compare-cell-tag {
  display: inline-block;
  font-size: .68rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: .07em;
  padding: .3rem .65rem;
  border-radius: 999px;
  margin-bottom: .8rem;
}
.compare-cell-agency .compare-cell-tag {
  background: #F5C85E;
  color: #5B3A05;
}
.compare-cell-client .compare-cell-tag {
  background: #3478F6;
  color: white;
}
.compare-cell ul { padding: 0; list-style: none; margin: 0; }
.compare-cell ul li {
  position: relative;
  padding-left: 1.25rem;
  margin-top: .45rem;
  font-size: .88rem;
  color: #374151;
  line-height: 1.55;
}
.compare-cell-agency ul li::before {
  content: "·"; position: absolute; left: .35rem;
  color: #A96F0C; font-weight: 900; font-size: 1.3rem; line-height: 1;
}
.compare-cell-client ul li::before {
  content: "✓"; position: absolute; left: 0;
  color: #3478F6; font-weight: 900; font-size: .85rem; top: 1px;
}
@media (max-width: 640px) {
  .compare-grid { grid-template-columns: 1fr; }
}

/* ───── Reframe exercise (module) ───── */
.reframe-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: .6rem;
  margin-top: .8rem;
}
.reframe-old, .reframe-new {
  padding: .85rem 1rem;
  border-radius: 1rem;
  font-size: .87rem;
  font-weight: 700;
  line-height: 1.55;
  display: flex;
  align-items: center;
}
.reframe-old {
  background: #FFF1F2;
  border: 1.5px solid #FDA29B;
  color: #92400E;
}
.reframe-new {
  background: #ECFDF5;
  border: 1.5px solid #6EE7B7;
  color: #065F46;
}
.reframe-arrow {
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; color: #94A3B8;
  font-weight: 900;
}
@media (max-width: 640px) {
  .reframe-row { grid-template-columns: 1fr; }
  .reframe-arrow { transform: rotate(90deg); height: 1.5rem; }
}

/* ───── Mini quiz card (inline, module) ───── */
.quiz-option {
  display: block;
  width: 100%;
  text-align: left;
  padding: 1rem 1.15rem;
  border-radius: 1rem;
  background: white;
  border: 2px solid #94A3B8; /* a11y-fix: non-text contrast ~3.3:1 was #E2E8F0 ~1.3:1 */
  font-size: .92rem;
  font-weight: 700;
  color: #334155;
  margin-top: .55rem;
  cursor: pointer;
  transition: all .2s ease;
}
.quiz-option:hover {
  border-color: #3478F6;
  background: #F7FBFF;
  transform: translateX(2px);
}
.quiz-option.correct {
  background: #ECFDF5;
  border-color: #10B981;
  color: #065F46;
}
.quiz-option.wrong {
  background: #FEF2F2;
  border-color: #F87171;
  color: #991B1B;
}
.quiz-option .opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem; height: 1.6rem;
  border-radius: .5rem;
  background: #F1F5F9;
  color: #64748B;
  font-weight: 900;
  font-size: .75rem;
  margin-right: .65rem;
  vertical-align: middle;
}
.quiz-option.correct .opt-letter { background: #10B981; color: white; }
.quiz-option.wrong .opt-letter   { background: #F87171; color: white; }

/* ───── Path card hover (learn) ───── */
.path-card-v2 {
  position: relative;
  cursor: pointer;
  transition: transform .3s cubic-bezier(.22,1,.36,1), box-shadow .3s ease;
  overflow: hidden;
}
.path-card-v2:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 50px rgba(20,58,134,.14);
}
.path-card-v2.active {
  outline: 3px solid #F5C85E;
  outline-offset: -3px;
}
.path-card-v2 .path-card-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 10%, rgba(245,200,94,.18), transparent 50%);
  opacity: 0;
  transition: opacity .35s;
  pointer-events: none;
}
.path-card-v2:hover .path-card-glow,
.path-card-v2.active .path-card-glow { opacity: 1; }

/* ───── Module card (learn) ───── */
.module-card-v2 {
  background: white;
  border-radius: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 14px 42px rgba(20,58,134,.06);
  border: 1px solid #F1F5F9;
  transition: all .25s ease;
}
.module-card-v2:hover {
  border-color: rgba(52,120,246,.18);
  box-shadow: 0 18px 50px rgba(20,58,134,.10);
}
.module-card-v2.locked { opacity: .85; }
.module-card-v2.completed {
  background: linear-gradient(135deg, #FFFFFF, #ECFDF5);
  border-color: rgba(16,185,129,.25);
}

/* Module index circle */
.module-index {
  width: 2.5rem; height: 2.5rem;
  border-radius: .85rem;
  background: linear-gradient(135deg, #143A86, #3478F6);
  color: white;
  font-weight: 900;
  font-size: .9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -.02em;
}
.module-card-v2.completed .module-index {
  background: linear-gradient(135deg, #059669, #10B981);
}
.module-card-v2.locked .module-index {
  background: linear-gradient(135deg, #94A3B8, #CBD5E1);
}

/* ───── Lesson-list bullet inside module card ───── */
.lesson-bullet {
  display: flex;
  gap: .65rem;
  padding: .55rem .65rem;
  border-radius: .65rem;
  font-size: .82rem;
  font-weight: 600;
  color: #475569;
  line-height: 1.55;
}
.lesson-bullet.open { background: rgba(16,185,129,.06); }
.lesson-bullet.locked { color: #94A3B8; }
.lesson-bullet .bullet-icon {
  width: 1.1rem; height: 1.1rem;
  border-radius: 999px;
  flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 900;
  margin-top: 1px;
}
.lesson-bullet.open .bullet-icon { background: #D1FAE5; color: #059669; }
.lesson-bullet.locked .bullet-icon { background: #F1F5F9; color: #94A3B8; }

/* ───── Newsletter inline form (article) ───── */
.newsletter-inline {
  background:
    radial-gradient(circle at 90% 0%, rgba(245,200,94,.22), transparent 50%),
    linear-gradient(140deg, #143A86 0%, #2257C7 100%);
  border-radius: 1.75rem;
  padding: 2rem;
  color: white;
  position: relative;
  overflow: hidden;
}
.newsletter-inline::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 5% 100%, rgba(132,190,255,.28), transparent 45%);
  pointer-events: none;
}
.prose-article .newsletter-inline h3 {
  color: #fff !important;
}
.prose-article .newsletter-inline h3::before {
  content: none !important;
  display: none !important;
}
.prose-article .newsletter-inline p {
  color: #DBEAFE !important;
}
.prose-article .newsletter-inline input {
  color: #0B1736 !important;
}
.prose-article .newsletter-inline input::placeholder {
  color: #94A3B8 !important;
}
.prose-article .newsletter-inline button {
  color: #0B1736 !important;
}
.prose-article .newsletter-inline #newsletterResult {
  color: #fff !important;
}

/* ───── Pretty wrap for headlines ───── */
.balance-text { text-wrap: balance; }
.pretty-text { text-wrap: pretty; }

/* ───── No-scrollbar utility (reused) ───── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ───── Journey Timeline (learn hub modules) ───── */
.timeline-track { }
.timeline-item { display: flex; gap: 1.25rem; align-items: stretch; }
.timeline-left { display: flex; flex-direction: column; align-items: center; flex-shrink: 0; width: 4rem; }

/* ── Module node: large rounded square ── */
.timeline-dot {
  width: 3.75rem; height: 3.75rem;
  border-radius: 1.1rem;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; font-weight: 900; letter-spacing: .03em;
  flex-shrink: 0; z-index: 1;
  transition: all .3s ease;
}
/* Done: navy fill + gold glow border */
.timeline-dot.done {
  background: #0F2559;
  color: #F5C842;
  border: 2.5px solid #F5C842;
  box-shadow: 0 0 0 4px rgba(245,200,66,.18), 0 6px 20px rgba(15,37,89,.35);
}
/* Active/next: white + dashed blue border */
.timeline-dot.active {
  background: white;
  color: #143A86;
  border: 2px dashed #3478F6;
  box-shadow: 0 2px 12px rgba(52,120,246,.12);
}
/* Locked: white + thin gray border */
.timeline-dot.locked {
  background: white;
  color: #CBD5E1;
  border: 1.5px solid #E2E8F0;
}

/* Vertical connector line */
.timeline-connector {
  flex: 1;
  width: 2px;
  margin: .35rem 0;
  min-height: 1.5rem;
  border-radius: 1px;
}
.timeline-connector.done-line   { background: linear-gradient(to bottom, #F5C842, #DBEAFE 80%, #E2E8F0); }
.timeline-connector.active-line { background: linear-gradient(to bottom, #3478F6, #DBEAFE 70%, #E2E8F0); }
.timeline-connector.default-line{ background: linear-gradient(to bottom, #E2E8F0, #F1F5F9); }

.timeline-content { flex: 1; min-width: 0; padding-bottom: 1.5rem; }
.timeline-item:last-child .timeline-content { padding-bottom: 0; }
.timeline-item:last-child .timeline-connector { display: none; }

/* ── TIẾN ĐỘ progress bar (below roadmap list) ── */
.roadmap-progress-bar-wrap {
  margin-top: 2rem;
  padding: 1rem 1.25rem;
  background: white;
  border-radius: 1rem;
  border: 1.5px solid #E2E8F0;
}
.roadmap-progress-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .6rem;
}
.roadmap-progress-label {
  font-size: .68rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #143A86;
}
.roadmap-progress-stat {
  font-size: .72rem;
  font-weight: 900;
  color: #143A86;
}
.roadmap-progress-track {
  height: 8px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}
.roadmap-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #F5C842 0%, #3478F6 100%);
  transition: width .5s cubic-bezier(.22,1,.36,1);
}

@keyframes glowPulse {
  0%, 100% { box-shadow: 0 4px 18px rgba(52,120,246,.4); }
  50%       { box-shadow: 0 4px 28px rgba(52,120,246,.65), 0 0 0 5px rgba(52,120,246,.1); }
}

/* ───── Path accent stripe ───── */
.path-accent-stripe {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  border-radius: 1.75rem 1.75rem 0 0;
}
.path-accent-royal { background: linear-gradient(90deg, #3478F6, #84BEFF 80%); }
.path-accent-gold  { background: linear-gradient(90deg, #F5C85E, #F9DD8C 80%); }
.path-accent-navy  { background: linear-gradient(90deg, #143A86, #3478F6 80%); }
.path-accent-cream { background: linear-gradient(90deg, rgba(245,200,94,.7), rgba(245,200,94,.2) 80%); }

/* Path output tagline */
.path-output-line {
  font-size: .7rem;
  color: #64748B;
  font-weight: 600;
  line-height: 1.55;
  margin-top: .55rem;
  padding-top: .55rem;
  border-top: 1px solid rgba(0,0,0,.07);
}

/* ───── Module card active ring ───── */
.module-card-active {
  outline: 2.5px solid rgba(52,120,246,.3);
  outline-offset: -2px;
}

/* ───── Module card entrance animation ───── */
@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.module-card-v2 { animation: cardFadeIn .45s cubic-bezier(.22,1,.36,1) both; }

/* ───── Checklist progress bar ───── */
.checklist-progress-bar {
  height: 6px;
  background: #F1F5F9;
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1rem;
}
.checklist-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #059669, #10B981);
  transition: width .5s cubic-bezier(.22,1,.36,1);
}

/* ───── Accordion (details/summary) ───── */
.accord-group { margin: 1.5rem 0; }
.accord-item {
  border: 1.5px solid #94A3B8; /* a11y-fix: non-text contrast ~3.3:1 was #E2E8F0 ~1.3:1 */
  border-radius: 1rem;
  margin-top: .5rem;
  overflow: hidden;
  transition: border-color .2s;
}
.accord-item[open] { border-color: #3478F6; }
.accord-item summary {
  padding: 1rem 1.25rem;
  font-weight: 800;
  font-size: .92rem;
  color: #143A86;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .65rem;
  list-style: none;
  transition: background .15s;
}
.accord-item summary::-webkit-details-marker { display: none; }
.accord-item summary::before {
  content: "▸";
  font-size: .85rem;
  color: #94A3B8;
  transition: transform .2s;
  flex-shrink: 0;
}
.accord-item[open] summary::before { transform: rotate(90deg); color: #3478F6; }
.accord-item summary:hover { background: #F8FBFF; }
.accord-item .accord-body {
  padding: 0 1.25rem 1.25rem;
  font-size: .9rem;
  line-height: 1.7;
  color: #374151;
}
.accord-item .accord-body ul { margin: .25rem 0 0; padding: 0; list-style: none; }
.accord-item .accord-body ul li {
  position: relative;
  padding-left: 1.25rem;
  margin-top: .4rem;
  font-size: .88rem;
  line-height: 1.6;
}
.accord-item .accord-body ul li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #3478F6;
  font-weight: 900;
}

/* ───── Tag / chip grid ───── */
.tag-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-top: 1rem;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .45rem .85rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  border: 1.5px solid;
}
.tag-chip.blue  { background: #EEF6FF; border-color: #BFDBFE; color: #1E40AF; }
.tag-chip.gold  { background: #FFF8EA; border-color: #FDE68A; color: #92400E; }
.tag-chip.green { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.tag-chip.slate { background: #F8FAFC; border-color: #E2E8F0; color: #475569; }

/* ───── Numbered step cards ───── */
.step-grid { display: grid; gap: .65rem; margin-top: 1.25rem; }
.step-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .85rem;
  align-items: start;
  padding: 1rem 1.25rem;
  border-radius: 1rem;
  background: #F8FBFF;
  border: 1px solid #94A3B8; /* a11y-fix: non-text contrast ~3.3:1 */
}
.step-num {
  width: 2rem; height: 2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #143A86, #3478F6);
  color: white;
  font-weight: 900;
  font-size: .8rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.step-card p { margin: 0; font-size: .9rem; line-height: 1.6; color: #374151; font-weight: 600; }
.step-card h5 { font-size: .88rem; font-weight: 800; color: #0B1736; margin-bottom: .2rem; }

/* ───── Visual checklist ───── */
.visual-checklist { margin: 1.5rem 0; display: grid; gap: .5rem; }
.visual-checklist-item {
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  padding: .85rem 1rem;
  border-radius: .85rem;
  background: #F8FAFC;
  border: 1px solid #94A3B8; /* a11y-fix: non-text contrast ~3.3:1 was #E2E8F0 ~1.2:1 */
  font-size: .88rem;
  font-weight: 600;
  color: #374151;
  line-height: 1.6;
}
.visual-checklist-item .check-icon {
  width: 1.4rem; height: 1.4rem;
  border-radius: .4rem;
  background: #EEF6FF;
  border: 1.5px solid #3478F6;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: .65rem;
  color: #3478F6;
  margin-top: 1px;
}
.visual-checklist-item.warn {
  background: #FFF3F3;
  border-color: #FDA29B;
}
.visual-checklist-item.warn .check-icon {
  background: #FEF2F2;
  border-color: #EF4444;
  color: #EF4444;
}

/* ───── Mistake Row ───── */
.mistake-row { display:grid; grid-template-columns:auto 1fr; gap:.75rem; align-items:start; padding:.85rem; border-radius:1rem; background:#FFF3F3; border:1px solid #FDA29B; margin-top:.65rem; }
.mistake-num { width:1.8rem; height:1.8rem; border-radius:999px; background:#FEF2F2; color:#EF4444; font-weight:900; font-size:.8rem; display:flex; align-items:center; justify-content:center; flex-shrink:0; border:1px solid #FECACA; }
.mistake-content p { margin:0; font-size:.9rem; line-height:1.6; color:#374151; }
.mistake-content h5 { font-size:.88rem; font-weight:800; color:#991B1B; margin-bottom:.2rem; }

/* ═══════════════════════════════════════════════════════════════════
   View pill toggle (VIEW | Roadmap | Grid)
═══════════════════════════════════════════════════════════════════ */
.view-pill-toggle {
  display: inline-flex;
  align-items: center;
  background: #F1F5F9;
  border-radius: 999px;
  padding: 4px 4px 4px 12px;
  gap: 4px;
}
.view-pill-label {
  font-size: .65rem;
  font-weight: 900;
  letter-spacing: .08em;
  color: #64748B; /* a11y-fix: was #94A3B8 ~2.5:1 → ~4.5:1 */
  text-transform: uppercase;
  padding-right: 4px;
  border-right: 1.5px solid #CBD5E1;
  margin-right: 4px;
  line-height: 1;
}
.view-pill-btn {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: .75rem;
  font-weight: 800;
  color: #64748B;
  padding: 5px 14px;
  border-radius: 999px;
  transition: background .15s, color .15s;
  line-height: 1;
  white-space: nowrap;
}
.view-pill-btn:hover { color: #1E293B; }
.view-pill-btn.view-btn-active {
  background: #143A86;
  color: #F5C842;
  box-shadow: 0 1px 6px rgba(20,58,134,.22);
}

/* ═══════════════════════════════════════════════════════════════════
   Module Grid Rich Cards — 2-column layout
═══════════════════════════════════════════════════════════════════ */
.module-grid-rich {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) { .module-grid-rich { grid-template-columns: repeat(2, 1fr); } }

/* Individual grid tile */
.gtile {
  background: white;
  border-radius: 1.25rem;
  border: 1.5px solid #E2E8F0;
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
  transition: border-color .2s, box-shadow .2s, transform .18s;
  animation: cardFadeIn .4s cubic-bezier(.22,1,.36,1) both;
}
.gtile:hover {
  border-color: rgba(52,120,246,.25);
  box-shadow: 0 8px 28px rgba(20,58,134,.10);
  transform: translateY(-2px);
}
/* Active/current module — gold border */
.gtile.gtile-active {
  border-color: #F5C842;
  border-width: 2px;
  box-shadow: 0 0 0 3px rgba(245,200,66,.15);
  background: linear-gradient(160deg, #fff, #FFFBEB);
}
/* Done module */
.gtile.gtile-done {
  background: linear-gradient(135deg, #ffffff, #F0FDF4);
  border-color: rgba(16,185,129,.25);
}

/* Header row: icon box + tier badge */
.gtile-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .5rem;
}
.gtile-icon-wrap {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: .75rem;
  background: white;
  border: 1.5px solid #E2E8F0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.gtile-icon { line-height: 1; }

/* Tier badges */
.gtile-badge {
  font-size: .6rem;
  font-weight: 900;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  flex-shrink: 0;
  margin-top: 2px;
}
.gtile-badge-free     { background: #D1FAE5; color: #065F46; }
.gtile-badge-essential{ background: #DBEAFE; color: #1E40AF; }
.gtile-badge-pro      { background: #EDE9FE; color: #5B21B6; }

/* Step meta line */
.gtile-step {
  font-size: .62rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #64748B; /* a11y-fix: was #94A3B8 ~2.8:1 → ~4.5:1 */
  margin: 0;
}

/* Module title */
.gtile-title {
  font-size: .95rem;
  font-weight: 900;
  color: #1E293B;
  line-height: 1.3;
  margin: 0;
}

/* Description */
.gtile-desc {
  font-size: .75rem;
  color: #64748B;
  line-height: 1.5;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Meta: lesson count + duration */
.gtile-meta {
  font-size: .72rem;
  font-weight: 700;
  color: #64748B;
  margin: 0;
}

/* Progress row */
.gtile-progress-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  margin-top: auto;
}
.gtile-progress-bar {
  flex: 1;
  height: 5px;
  background: #E2E8F0;
  border-radius: 999px;
  overflow: hidden;
}
.gtile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #143A86, #3478F6);
  border-radius: 999px;
  transition: width .4s ease;
}
.gtile-done .gtile-progress-fill { background: linear-gradient(90deg, #059669, #10B981); }
.gtile-pct {
  font-size: .68rem;
  font-weight: 800;
  color: #64748B;
  white-space: nowrap;
  min-width: 2.2rem;
  text-align: right;
}

/* Action row */
.gtile-actions {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding-top: .6rem;
  border-top: 1px solid #F1F5F9;
}
.gtile-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #143A86;
  color: white;
  font-size: .75rem;
  font-weight: 900;
  padding: 6px 16px;
  border-radius: 999px;
  text-decoration: none;
  transition: background .15s, transform .12s;
  white-space: nowrap;
}
.gtile-cta:hover { background: #1a4aaa; transform: translateY(-1px); }
.gtile-cta-locked { background: #CBD5E1; color: #94A3B8; cursor: not-allowed; }
.gtile-cta-locked:hover { background: #CBD5E1; transform: none; }
.gtile-done-btn {
  background: none;
  border: none;
  font-size: .75rem;
  font-weight: 800;
  color: #64748B;
  cursor: pointer;
  padding: 0;
  transition: color .15s;
}
.gtile-done-btn:hover { color: #059669; }

/* ═══════════════════════════════════════════════════════════════════
   PREMIUM "THANH LICH" CASE STUDY BOX STYLES (GLOBAL OVERRIDES)
   Ensures deep visual separation from theory and elegant typography
═══════════════════════════════════════════════════════════════════ */
/* ═══ Lesson prose & pedagogical components (shared across all module pages) ═══ */
.lesson-body { font-size: 1.02rem; line-height: 1.85; color: #1f2937; }
.lesson-body h3 { font-size: 1.18rem; font-weight: 900; color: #0B1736; margin: 2.2rem 0 .55rem; line-height: 1.2; letter-spacing: -.02em; }
.lesson-body h3::before { content: ""; display: inline-block; width: 6px; height: 6px; background: #F5C85E; border-radius: 999px; margin-right: .55rem; vertical-align: 5px; }
.lesson-body h3.no-bullet::before { display: none !important; }
.lesson-body p { margin-top: 1rem; }
.lesson-body ul { margin-top: 1rem; padding-left: 0; list-style: none; }
.lesson-body ul li { position: relative; padding-left: 1.5rem; margin-top: .55rem; line-height: 1.7; }
.lesson-body ul li::before { content: "→"; position: absolute; left: 0; color: #3478F6; font-weight: 900; }
.lesson-body strong { color: #0B1736; font-weight: 800; }
.lesson-body blockquote {
  position: relative;
  border-left: 4px solid #F5C85E;
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, #FFF8EA, #FFFCEF);
  border-radius: 0 1.25rem 1.25rem 0;
  margin: 1.6rem 0;
  font-size: 1.05rem;
  color: #143A86;
  font-weight: 700;
  line-height: 1.65;
}
.lesson-body em { color: #143A86; font-style: italic; font-weight: 600; }
.lesson-body p.lead { font-size: 1.12rem; line-height: 1.7; color: #1f2937; font-weight: 500; }
.lesson-body p.lead::first-letter { float: left; font-size: 3.4rem; line-height: .85; padding: .35rem .65rem 0 0; font-weight: 900; color: #143A86; }

.lesson-body table { width: 100%; border-collapse: collapse; margin-top: 1.2rem; font-size: .92rem; }
.lesson-body th, .lesson-body td { padding: .65rem .85rem; border: 1px solid #E5E7EB; text-align: left; }
.lesson-body th { background: #F8FAFC; font-weight: 800; color: #0B1736; }

/* Pedagogical Components */
.pedagogy-box { margin: 2rem 0; border-radius: 1rem; padding: 1.5rem; border: 1px solid #E5E7EB; }
.pedagogy-box h4 { font-size: .85rem; font-weight: 900; text-transform: uppercase; letter-spacing: .05em; margin-bottom: .75rem; display: flex; align-items: center; gap: .5rem; }
.box-example { background: #F8FAFC; border-left: 4px solid #3478F6; }
.box-example h4 { color: #1D4ED8; }
.box-saythis { background: #FFF8EA; border-left: 4px solid #F5C85E; }
.box-saythis h4 { color: #B45309; }
.box-action { background: #ECFDF5; border-left: 4px solid #10B981; }
.box-action h4 { color: #047857; }
.box-tldr { background: #EEF6FF; border-radius: 1rem; padding: 1.25rem 1.5rem; font-weight: 700; color: #143A86; text-align: center; box-shadow: 0 4px 14px rgba(20,58,134,.05); margin: 2rem 0; }

/* Key-grid cards (module lesson layout) */
.key-grid { display:grid; grid-template-columns:repeat(3,1fr); gap:.75rem; margin-top:1.25rem; }
.key-card { border-radius:1.25rem; padding:1.25rem; background:#EEF6FF; border:1.5px solid #3478F6; }
.key-card.gold { background:#FFF8EA; border-color:#F5C85E; }
.key-card.green { background:#ECFDF5; border-color:#6EE7B7; }
.key-card h4 { font-size:.85rem; font-weight:900; text-transform:uppercase; letter-spacing:.04em; margin-bottom:.45rem; color:#143A86; }
.key-card.gold h4 { color:#A96F0C; }
.key-card.green h4 { color:#065F46; }
.key-card p { font-size:.88rem; line-height:1.6; color:#374151; font-weight:600; margin:0; }
@media(max-width:768px){ .key-grid { grid-template-columns:1fr; } }

.pedagogy-box.box-example {
  background: #F8FAFC !important; /* bg-slate-50/90 */
  border-left: 4px solid #3478F6 !important; /* border-l-4 border-royal */
  border-radius: 1rem !important; /* rounded-2xl */
  padding: 1.25rem 1.5rem !important; /* p-5 */
  box-shadow: 0 4px 20px rgba(11, 23, 54, 0.03), 0 1px 3px rgba(11, 23, 54, 0.02) !important; /* shadow-soft */
  margin: 2rem 0 !important; /* my-6 */
  border-top: none !important;
  border-right: none !important;
  border-bottom: none !important;
}

/* Force tiny, distinct, clean typography for all nested elements */
.pedagogy-box.box-example,
.pedagogy-box.box-example p,
.pedagogy-box.box-example div,
.pedagogy-box.box-example span,
.pedagogy-box.box-example ul,
.pedagogy-box.box-example li,
.pedagogy-box.box-example ol {
  font-size: 11.5px !important; /* guaranteed tiny text distinct from theory */
  line-height: 1.65 !important;
  color: #4B5563 !important; /* Slate-600 */
}

/* Ensure strong and bold elements contrast beautifully in Navy */
.pedagogy-box.box-example strong,
.pedagogy-box.box-example p strong,
.pedagogy-box.box-example li strong,
.pedagogy-box.box-example h4 strong {
  color: #0B1736 !important; /* text-navy */
  font-weight: 800 !important;
}

/* Case study Title styling */
.pedagogy-box.box-example h4 {
  font-size: 12.5px !important; /* text-[12.5px] */
  font-weight: 900 !important;
  color: #0B1736 !important; /* text-navy */
  margin-top: 0 !important;
  margin-bottom: 0.85rem !important;
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  line-height: 1.3 !important;
  border: none !important;
}

/* Make the emoji/badge look modern and sophisticated */
.pedagogy-box.box-example h4 span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 9px !important;
  font-weight: 900 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.05em !important;
  padding: 0.15rem 0.4rem !important;
  background: rgba(52, 120, 246, 0.1) !important; /* bg-royal/10 */
  color: #3478F6 !important; /* text-royal */
  border-radius: 0.25rem !important;
  line-height: 1 !important;
  font-family: inherit !important;
}

/* Style the internal list spacing to look exceptionally clean */
.pedagogy-box.box-example ul {
  margin-top: 0.35rem !important;
  margin-bottom: 0.5rem !important;
  padding-left: 1.25rem !important;
}
.pedagogy-box.box-example ul li {
  margin-top: 0.25rem !important;
  color: #4B5563 !important;
}
.pedagogy-box.box-example ul li::before {
  color: #3478F6 !important; /* Change arrows to royal blue */
  font-size: 11px !important;
}


/* ═══════════════════════════════════════════════════════════════════
   A11Y FIXES — Added 2026-05-23
   Covers WCAG 2.1 AA: focus-visible, skip link, touch targets
═══════════════════════════════════════════════════════════════════ */

/* Focus visible — visible keyboard focus indicator on all interactive elements */
:focus-visible {
  outline: 2.5px solid #3478F6;
  outline-offset: 3px;
  border-radius: 4px;
}

/* Override Tailwind's outline-none on buttons/links that use it */
button:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible,
details > summary:focus-visible {
  outline: 2.5px solid #3478F6 !important;
  outline-offset: 3px !important;
  border-radius: 4px !important;
}

/* Skip to main content link — visually hidden until focused */
.skip-to-main {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 9999;
  background: white;
  color: #143A86;
  font-weight: 900;
  font-size: .9rem;
  padding: .75rem 1.25rem;
  border-radius: .85rem;
  text-decoration: none;
  border: 2px solid #3478F6;
  box-shadow: 0 4px 18px rgba(0,0,0,.18);
  transition: top .1s ease;
  white-space: nowrap;
}
.skip-to-main:focus {
  top: .75rem;
  outline: none;
}

/* Touch target safety net for small header action links/buttons */
/* :not(.hidden) ensures this rule doesn't force-show elements hidden by JS */
header a.rounded-full:not(.hidden),
header button.rounded-full:not(.hidden) {
  min-height: 44px;
  display: inline-flex !important;
  align-items: center !important;
}

/* bannerDismiss and similar small icon buttons */
button[aria-label="Đóng"] {
  min-width: 44px;
  min-height: 44px;
}

/* ═══════════════════════════════════════════════════════
   MOBILE: Module timeline responsive (≤640px)
   ═══════════════════════════════════════════════════════ */
@media (max-width: 640px) {
  /* 1. Thu nhỏ timeline left gutter để content có nhiều chỗ hơn */
  .timeline-item { gap: 0.65rem; }
  .timeline-left { width: 2.5rem; }
  .timeline-dot {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 0.75rem;
    border-radius: 0.75rem;
  }

  /* 2. Module card: giảm padding trên mobile */
  .module-card-v2 {
    padding: 1rem;
    border-radius: 1.25rem;
  }

  /* 3. Lesson bullet: badge xuống hàng 2 thay vì ép hàng ngang */
  .lesson-bullet {
    flex-wrap: wrap;
    padding: .45rem .5rem;
    gap: .2rem .4rem;
    align-items: flex-start;
  }
  .lesson-bullet .bullet-icon { margin-top: 2px; }
  /* Badge (span cuối) wrap xuống hàng 2, thụt vào ngang text */
  .lesson-bullet > span:last-child {
    margin-left: 1.5rem;
    font-size: 9px;
  }

  /* 4. Details summary: tap target đủ 44px */
  .module-card-v2 details > summary {
    padding: 0.85rem 1rem;
    min-height: 44px;
  }

  /* 5. Resource row: wrap khi tên dài */
  .atc-resource-row {
    flex-wrap: wrap;
    gap: 0.4rem 0.5rem;
    align-items: flex-start;
  }
}

/* ─── Module page: ẩn inline prev/next lesson buttons trên mobile ───
   Sticky bottom nav bar (#mobileNavBar) đã xử lý navigation rồi      */
@media (max-width: 767px) {
  .lesson-panel .flex.gap-2 { display: none; }
}
