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

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

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

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

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

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

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

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

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

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

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

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

.costs-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;
}

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

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

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

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

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

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

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

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

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

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

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

/* ---------- Cost Breakdown Table ---------- */
.cost-table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  -webkit-overflow-scrolling: touch;
}

.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.cost-table caption {
  text-align: left;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--costs-text);
}

.cost-table th,
.cost-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--costs-border);
}

.cost-table thead th {
  background: var(--costs-green);
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cost-table thead th:first-child {
  border-radius: var(--costs-radius) 0 0 0;
}

.cost-table thead th:last-child {
  border-radius: 0 var(--costs-radius) 0 0;
}

.cost-table tbody tr:hover {
  background: rgba(80, 137, 22, 0.04);
}

.cost-table .cost-table__category {
  font-weight: 700;
  color: var(--costs-green-dark);
  background: var(--costs-green-light);
  border-bottom: 2px solid var(--costs-green);
}

.cost-table .cost-table__category td {
  padding-top: 1rem;
}

.cost-table .cost-table__total {
  font-weight: 700;
  background: var(--costs-green-light);
  border-top: 2px solid var(--costs-green);
}

.cost-table .cost-table__total td {
  font-size: 1.05rem;
  color: var(--costs-green-dark);
}

.cost-table td:last-child {
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
}

.cost-table .cost-source {
  font-size: 0.75rem;
  color: var(--costs-text-muted);
  font-weight: 400;
  display: block;
  margin-top: 0.15rem;
}

.cost-table-note {
  font-size: 0.85rem;
  color: var(--costs-text-muted);
  font-style: italic;
  margin-top: 0.75rem;
}

/* ---------- Calculator Widget ---------- */
.cost-calculator {
  background: #fff;
  border: 2px solid var(--costs-green);
  border-radius: var(--costs-radius);
  padding: 1.5rem;
  margin-top: 2rem;
}

.cost-calculator h3 {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--costs-text);
  margin: 0 0 0.5rem;
}

.cost-calculator h3 em {
  font-style: normal;
  color: var(--costs-green);
}

.cost-calculator__subtitle {
  color: var(--costs-text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.calc-field {
  margin-bottom: 1.25rem;
}

.calc-field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--costs-text);
  margin-bottom: 0.4rem;
}

.calc-field__value {
  font-weight: 700;
  color: var(--costs-green);
  font-size: 0.95rem;
}

.calc-field input[type="range"] {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: var(--costs-border);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
}

.calc-field input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--costs-green);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.calc-field input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--costs-green);
  cursor: pointer;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.calc-field input[type="range"]:focus {
  outline: 2px solid var(--costs-green);
  outline-offset: 2px;
}

/* Toggle switches */
.calc-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
}

.calc-toggle__label {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--costs-text);
}

.calc-toggle__switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--costs-border);
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  padding: 0;
}

.calc-toggle__switch[aria-checked="true"] {
  background: var(--costs-green);
}

.calc-toggle__switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.calc-toggle__switch[aria-checked="true"]::after {
  transform: translateX(20px);
}

/* Calculator results */
.calc-output {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--costs-green-light);
}

.calc-output__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  font-size: 0.95rem;
}

.calc-output__label {
  color: var(--costs-text-muted);
}

.calc-output__value {
  font-weight: 700;
  color: var(--costs-text);
  font-size: 1.05rem;
}

.calc-output__total {
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 2px solid var(--costs-green);
}

.calc-output__total .calc-output__label {
  font-weight: 700;
  color: var(--costs-text);
  font-size: 1.05rem;
}

.calc-output__total .calc-output__value {
  font-size: 1.4rem;
  color: var(--costs-green);
}

.calc-output__roi {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--costs-green-light);
  border-radius: var(--costs-radius);
  text-align: center;
  font-size: 0.95rem;
  color: var(--costs-text);
}

.calc-output__roi strong {
  color: var(--costs-green-dark);
}

/* ---------- ROI Section ---------- */
.roi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

@media (min-width: 600px) {
  .roi-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.roi-card {
  background: #fff;
  border: 1px solid var(--costs-border);
  border-radius: var(--costs-radius);
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.roi-card h3 {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--costs-green-dark);
  margin: 0 0 0.5rem;
}

.roi-card p {
  font-size: 0.9rem;
  color: var(--costs-text-muted);
  line-height: 1.6;
  margin: 0;
}

.roi-card .roi-figure {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--costs-green);
  display: block;
  margin-bottom: 0.25rem;
}

/* ---------- Ongoing Costs ---------- */
.ongoing-costs-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.ongoing-costs-list li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--costs-border);
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--costs-text);
  display: flex;
  gap: 0.75rem;
}

.ongoing-costs-list li:last-child {
  border-bottom: none;
}

.ongoing-costs-list .oc-icon {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  background: var(--costs-green-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--costs-green-dark);
  margin-top: 0.1rem;
}

.ongoing-costs-list strong {
  color: var(--costs-text);
}

.ongoing-costs-list .oc-note {
  font-size: 0.8rem;
  color: var(--costs-text-muted);
  display: block;
  margin-top: 0.15rem;
}

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

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

.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(--costs-text);
  text-align: left;
  line-height: 1.4;
  transition: background 0.15s;
}

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

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

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

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

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

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

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

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

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

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

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

/* REDESIGNED: lead-capture styles now in brand.css */

/* ---------- Internal links styling ---------- */
.costs-page .prose a {
  color: var(--costs-green-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.costs-page .prose a:hover {
  color: var(--costs-green);
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .faq-accordion__answer {
    transition: none;
  }
  .faq-accordion__icon::before,
  .faq-accordion__icon::after {
    transition: none;
  }
  .stat-counter__value {
    transition: none;
  }
  .calc-toggle__switch::after {
    transition: none;
  }
}

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

  .cost-table {
    font-size: 0.85rem;
  }

  .cost-table th,
  .cost-table td {
    padding: 0.5rem 0.65rem;
  }

  .cost-calculator {
    padding: 1rem;
  }

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

}
