/* ==========================================================================
   Stage 2 Page Styles
   Brand: DIT (NUI Driving Instructor Training)
   Primary: #508916 (green)
   Mobile-first responsive design
   ========================================================================== */

/* ---------- Shared ---------- */
.stage2-page {
  --s2-green: #508916;
  --s2-green-light: #e8f5d6;
  --s2-green-dark: #3a6610;
  --s2-text: #242427;
  --s2-text-muted: #6c6d74;
  --s2-border: #e5e5e7;
  --s2-bg-alt: #f7f7f7;
  --s2-radius: 8px;
}

.stage2-page .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.stage2-page section {
  padding: 3rem 0;
}

.stage2-page section:nth-child(even):not(.s2-hero):not(.lead-capture) {
  background: var(--s2-bg-alt);
}

/* ---------- Hero ---------- */
.stage2-page .s2-hero {
  background: linear-gradient(135deg, var(--s2-green-dark) 0%, var(--s2-green) 100%) !important;
  color: #fff;
  padding: 2rem 0 3rem;
}

.s2-hero .breadcrumb {
  margin-bottom: 1.5rem;
}

.s2-hero .breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
}

.s2-hero .breadcrumb li::after {
  content: '>';
  margin: 0 0.5rem;
  opacity: 0.7;
}

.s2-hero .breadcrumb li:last-child::after {
  content: '';
  margin: 0;
}

.s2-hero .breadcrumb a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.s2-hero .breadcrumb a:hover {
  color: #fff;
  text-decoration: underline;
}

.s2-hero h1 {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 800;
  margin: 0 0 1rem;
  line-height: 1.2;
}

.s2-hero .hero-subtitle {
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 750px;
  opacity: 0.95;
}

/* ---------- TLDR / Quick Answer ---------- */
.s2-tldr {
  background: var(--s2-green-light);
  border-left: 4px solid var(--s2-green);
  padding: 1.5rem;
  border-radius: var(--s2-radius);
  margin-bottom: 1rem;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--s2-text);
}

.s2-tldr strong {
  color: var(--s2-green-dark);
}

.s2-tldr a {
  color: var(--s2-green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.s2-tldr a:hover {
  color: var(--s2-green);
}

/* ---------- Section headings ---------- */
.stage2-page h2 {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--s2-text);
  margin: 0 0 1rem;
  line-height: 1.3;
}

.stage2-page h2 em {
  font-style: normal;
  color: var(--s2-green);
}

.stage2-page .section-intro {
  color: var(--s2-text-muted);
  font-size: 1rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
  max-width: 750px;
}

/* ---------- Source citations ---------- */
.s2-source {
  font-size: 0.75rem;
  color: var(--s2-text-muted);
  font-weight: 400;
}

/* ---------- Body text ---------- */
.stage2-page p {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--s2-text);
  margin: 0 0 1rem;
}

.stage2-page p a {
  color: var(--s2-green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.stage2-page p a:hover {
  color: var(--s2-green);
}

/* ---------- Stat Counters ---------- */
.stage2-page .stat-counters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 600px) {
  .stage2-page .stat-counters {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stage2-page .stat-counter {
  text-align: center;
  padding: 1.25rem 0.75rem;
  background: #fff;
  border: 1px solid var(--s2-border);
  border-radius: var(--s2-radius);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.stage2-page .stat-counter__value {
  display: block;
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--s2-green);
  line-height: 1.2;
}

.stage2-page .stat-counter__label {
  display: block;
  font-size: 0.8rem;
  color: var(--s2-text-muted);
  margin-top: 0.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

/* ---------- Interactive Checklist ---------- */
.s2-checklist {
  background: #fff;
  border: 2px solid var(--s2-green);
  border-radius: var(--s2-radius);
  padding: 1.5rem;
}

.s2-progress {
  margin-bottom: 1.5rem;
}

.s2-progress__bar {
  width: 100%;
  height: 10px;
  background: var(--s2-border);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

.s2-progress__fill {
  height: 100%;
  background: var(--s2-green);
  border-radius: 5px;
  transition: width 0.4s ease;
  width: 0%;
}

.s2-progress__text {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--s2-text-muted);
}

.s2-checklist__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.s2-checklist__item {
  border-bottom: 1px solid var(--s2-border);
}

.s2-checklist__item:last-child {
  border-bottom: none;
}

.s2-checklist__toggle {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  padding: 0.75rem 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: background 0.15s;
  border-radius: 4px;
}

.s2-checklist__toggle:hover {
  background: rgba(80, 137, 22, 0.04);
}

.s2-checklist__toggle:focus-visible {
  outline: 2px solid var(--s2-green);
  outline-offset: -2px;
}

.s2-checklist__box {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border: 2px solid var(--s2-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, border-color 0.2s;
  margin-top: 0.1rem;
  position: relative;
}

.s2-checklist__box::after {
  content: '';
  display: block;
  width: 8px;
  height: 14px;
  border: solid #fff;
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease;
  margin-top: -2px;
}

.s2-checklist__item[data-checked="true"] .s2-checklist__box {
  background: var(--s2-green);
  border-color: var(--s2-green);
}

.s2-checklist__item[data-checked="true"] .s2-checklist__box::after {
  transform: rotate(45deg) scale(1);
}

.s2-checklist__item[data-checked="true"] .s2-checklist__content strong {
  color: var(--s2-green-dark);
}

.s2-checklist__content {
  flex: 1;
}

.s2-checklist__content strong {
  display: block;
  font-size: 0.95rem;
  color: var(--s2-text);
  margin-bottom: 0.15rem;
  transition: color 0.2s;
}

.s2-checklist__detail {
  display: block;
  font-size: 0.85rem;
  color: var(--s2-text-muted);
  line-height: 1.5;
}

/* Checklist complete state */
.s2-progress[data-complete="true"] .s2-progress__text {
  color: var(--s2-green-dark);
  font-weight: 700;
}

.s2-progress[data-complete="true"] .s2-progress__fill {
  background: var(--s2-green-dark);
}

/* ---------- Pass Criteria Callout ---------- */
.s2-pass-criteria {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: #fff8e6;
  border-left: 4px solid #e6a800;
  border-radius: var(--s2-radius);
}

.s2-pass-criteria h3 {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--s2-text);
  margin: 0 0 0.5rem;
}

.s2-pass-criteria p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--s2-text);
  margin: 0;
}

/* ---------- Test Centres Grid ---------- */
.s2-centres-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}

@media (min-width: 500px) {
  .s2-centres-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 700px) {
  .s2-centres-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.s2-centre-card {
  background: #fff;
  border: 1px solid var(--s2-border);
  border-radius: var(--s2-radius);
  padding: 1rem;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--s2-text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  position: relative;
}

.s2-centre-card--nui {
  border-color: var(--s2-green);
  background: var(--s2-green-light);
}

.s2-centre-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--s2-green);
  color: #fff;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.s2-motorcycle-note {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  background: #fff8e6;
  border-left: 4px solid #e6a800;
  border-radius: var(--s2-radius);
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--s2-text);
}

/* ---------- Training Points ---------- */
.s2-training-points ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.s2-training-points li {
  position: relative;
  padding: 0.75rem 0 0.75rem 1.75rem;
  border-bottom: 1px solid var(--s2-border);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--s2-text);
}

.s2-training-points li:last-child {
  border-bottom: none;
}

.s2-training-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1rem;
  width: 10px;
  height: 10px;
  background: var(--s2-green);
  border-radius: 50%;
}

.s2-training-points li a {
  color: var(--s2-green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.s2-training-points li a:hover {
  color: var(--s2-green);
}

/* ---------- Walkthrough ---------- */
.s2-walkthrough {
  background: #fff;
  border: 1px solid var(--s2-border);
  border-radius: var(--s2-radius);
  padding: 1.5rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.s2-walkthrough p:last-child {
  margin-bottom: 0;
}

/* ---------- FAQ Accordion ---------- */
.stage2-page .faq-accordion {
  margin-top: 1.5rem;
}

.stage2-page .faq-accordion__item {
  border: 1px solid var(--s2-border);
  border-radius: var(--s2-radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
  background: #fff;
}

.stage2-page .faq-accordion__question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 1rem 1.25rem;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--s2-text);
  text-align: left;
  line-height: 1.4;
  transition: background 0.15s;
}

.stage2-page .faq-accordion__question:hover {
  background: rgba(80, 137, 22, 0.04);
}

.stage2-page .faq-accordion__question:focus-visible {
  outline: 2px solid var(--s2-green);
  outline-offset: -2px;
}

.stage2-page .faq-accordion__icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  position: relative;
  margin-left: 1rem;
}

.stage2-page .faq-accordion__icon::before,
.stage2-page .faq-accordion__icon::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 14px;
  height: 2px;
  background: var(--s2-green);
  border-radius: 1px;
  transition: transform 0.25s ease;
}

.stage2-page .faq-accordion__icon::before {
  transform: translate(-50%, -50%);
}

.stage2-page .faq-accordion__icon::after {
  transform: translate(-50%, -50%) rotate(90deg);
}

.stage2-page .faq-accordion__item[data-open="true"] .faq-accordion__icon::after {
  transform: translate(-50%, -50%) rotate(0deg);
}

.stage2-page .faq-accordion__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
}

.stage2-page .faq-accordion__answer-inner {
  padding: 0 1.25rem 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--s2-text-muted);
}

.stage2-page .faq-accordion__answer-inner a {
  color: var(--s2-green-dark);
  text-decoration: underline;
}

.stage2-page .faq-accordion__answer-inner a:hover {
  color: var(--s2-green);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .stage2-page .faq-accordion__answer {
    transition: none;
  }
  .stage2-page .faq-accordion__icon::before,
  .stage2-page .faq-accordion__icon::after {
    transition: none;
  }
  .stage2-page .stat-counter__value {
    transition: none;
  }
  .s2-progress__fill {
    transition: none;
  }
  .s2-checklist__box,
  .s2-checklist__box::after {
    transition: none;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
  .stage2-page section {
    padding: 2rem 0;
  }

  .s2-checklist {
    padding: 1rem;
  }

  .s2-checklist__toggle {
    padding: 0.6rem 0.25rem;
  }

  .s2-checklist__box {
    width: 24px;
    height: 24px;
  }

  .s2-checklist__box::after {
    width: 6px;
    height: 12px;
  }

  .stage2-page .stat-counter__value {
    font-size: 1.4rem;
  }

  .s2-centres-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .s2-centre-card {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
  }

  .s2-pass-criteria {
    padding: 1rem;
  }

  .s2-walkthrough {
    padding: 1rem;
  }
}
