/* ============================================================
   Gravel Cost Calculator — Page-specific styles
   gravel-cost-calculator.css
   Extends the site design system (purple #7657e8 primary)
   ============================================================ */

/* ── Hero Section ─────────────────────────────────────────── */
.cost-hero {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 24px 36px;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 48px;
  align-items: center;
}

.cost-hero-copy {
  max-width: 600px;
}

.cost-hero .hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  padding: 7px 14px;
  border: 1px solid #e0d4f5;
  border-radius: 99px;
  background: #f5f2ff;
  color: #7657e8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.cost-hero .hero-badge::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #7657e8;
}

.cost-hero h1 {
  margin: 0 0 16px;
  color: #0d1321;
  font: 800 clamp(34px, 4.2vw, 56px)/1.05 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: -2.2px;
}

.cost-hero h1 span {
  color: #EA580C;
}

.cost-hero .hero-subtitle {
  margin: 0 0 24px;
  color: #596477;
  font-size: 16px;
  line-height: 1.7;
}

.cost-hero .hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border: 0;
  border-radius: 10px;
  background: #EA580C;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, transform .15s;
  box-shadow: 0 6px 20px #EA580C30;
}

.cost-hero .hero-cta:hover {
  background: #c2410c;
  transform: translateY(-2px);
}

/* Hero visual — truck + gravel illustration */
.cost-hero-visual {
  position: relative;
  min-height: 320px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f5f2ff 0%, #fff4ed 100%);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 30px;
}

.cost-hero-visual svg {
  width: 100%;
  max-width: 420px;
  height: auto;
}

/* ── Main Calculator Card ────────────────────────────────── */
.cost-calc-wrap {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.cost-calc-card {
  border: 1px solid #e3e6ed;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 30px #2837550b;
  overflow: hidden;
}

.cost-calc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 28px;
  border-bottom: 1px solid #eef0f6;
  background: #faf9ff;
}

.cost-calc-header .calc-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #EA580C;
  color: #fff;
  font-size: 20px;
  flex: none;
}

.cost-calc-header h2 {
  margin: 0;
  color: #172033;
  font: 800 22px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: -.6px;
}

.cost-calc-header p {
  margin: 2px 0 0;
  color: #7c8496;
  font-size: 12px;
}

.cost-calc-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

/* ── Input sections ───────────────────────────────────────── */
.cost-input-panel {
  padding: 28px;
  border-right: 1px solid #eef0f6;
}

.cost-results-panel {
  padding: 28px;
  background: #f8f9fc;
}

.cost-step {
  margin-bottom: 28px;
}

.cost-step:last-child {
  margin-bottom: 0;
}

.cost-step-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.cost-step-num {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: #7657e8;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  flex: none;
}

.cost-step-title {
  color: #172033;
  font: 800 15px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* ── Toggle switch ───────────────────────────────────────── */
.cost-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  cursor: pointer;
  user-select: none;
}

.cost-toggle input {
  display: none;
}

.cost-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 12px;
  background: #d4d8e2;
  transition: background .2s;
  flex: none;
}

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

.cost-toggle input:checked + .cost-toggle-track {
  background: #EA580C;
}

.cost-toggle input:checked + .cost-toggle-track::after {
  transform: translateX(18px);
}

.cost-toggle-label {
  color: #313a4c;
  font-size: 13px;
  font-weight: 700;
}

/* ── Input fields ────────────────────────────────────────── */
.cost-field {
  margin-bottom: 12px;
}

.cost-field label {
  display: block;
  margin-bottom: 5px;
  color: #596477;
  font-size: 12px;
  font-weight: 700;
}

.cost-field input[type="number"],
.cost-field select {
  width: 100%;
  height: 42px;
  border: 1px solid #d8dce7;
  border-radius: 8px;
  padding: 0 14px;
  background: #fff;
  color: #172033;
  font: 700 14px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.cost-field input[type="number"]:focus,
.cost-field select:focus {
  border-color: #EA580C;
  box-shadow: 0 0 0 3px #EA580C15;
}

.cost-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.cost-field-row.three {
  grid-template-columns: 1fr 1fr 1fr;
}

/* Input with unit suffix */
.cost-input-group {
  display: flex;
  align-items: stretch;
  border: 1px solid #d8dce7;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}

.cost-input-group:focus-within {
  border-color: #EA580C;
  box-shadow: 0 0 0 3px #EA580C15;
}

.cost-input-group input {
  flex: 1;
  min-width: 0;
  height: 42px;
  border: 0;
  padding: 0 14px;
  background: transparent;
  color: #172033;
  font: 700 14px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  outline: none;
}

.cost-input-group .unit-suffix {
  display: flex;
  align-items: center;
  padding: 0 14px;
  background: #f0eef5;
  color: #6c6494;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Radio group */
.cost-radio-group {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.cost-radio {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8dce7;
  border-radius: 8px;
  padding: 10px 14px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}

.cost-radio:hover {
  border-color: #c0b8d8;
}

.cost-radio input {
  margin: 0;
  accent-color: #EA580C;
}

.cost-radio.active {
  border-color: #EA580C;
  background: #fff4ed;
}

.cost-radio-label {
  color: #313a4c;
  font-size: 13px;
  font-weight: 700;
}

/* ── Results Dashboard ───────────────────────────────────── */
.cost-results-panel h3 {
  margin: 0 0 18px;
  color: #172033;
  font: 800 18px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.result-cards-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.result-card {
  padding: 18px;
  border: 1px solid #e3e6ed;
  border-radius: 12px;
  background: #fff;
  transition: transform .15s, box-shadow .15s;
}

.result-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px #2837550a;
}

.result-card.highlight {
  grid-column: 1 / -1;
  border-color: #EA580C;
  border-width: 2px;
  background: linear-gradient(135deg, #fff4ed 0%, #fff 100%);
}

.result-card-label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: #7c8496;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.result-card-label .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: none;
}

.result-card-value {
  color: #172033;
  font: 800 28px/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: -1px;
}

.result-card.highlight .result-card-value {
  font-size: 38px;
  color: #EA580C;
}

.result-card-sub {
  margin-top: 4px;
  color: #858d9d;
  font-size: 11px;
}

/* ── Cost Breakdown Chart ─────────────────────────────────── */
.cost-breakdown-chart {
  margin-bottom: 20px;
  padding: 20px;
  border: 1px solid #e3e6ed;
  border-radius: 12px;
  background: #fff;
}

.cost-breakdown-chart h4 {
  margin: 0 0 16px;
  color: #172033;
  font: 800 14px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.donut-chart-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}

.donut-chart {
  position: relative;
  width: 130px;
  height: 130px;
  flex: none;
}

.donut-chart svg {
  transform: rotate(-90deg);
}

.donut-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.donut-center .total-label {
  font-size: 9px;
  font-weight: 800;
  color: #858d9d;
  letter-spacing: .5px;
}

.donut-center .total-value {
  font: 800 18px/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #172033;
}

.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.donut-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.donut-legend-item .legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex: none;
}

.donut-legend-item .legend-label {
  flex: 1;
  color: #596477;
  font-size: 12px;
  font-weight: 700;
}

.donut-legend-item .legend-value {
  color: #172033;
  font-size: 13px;
  font-weight: 800;
}

.donut-legend-item .legend-pct {
  color: #858d9d;
  font-size: 11px;
  margin-left: 4px;
}

/* ── Cost Per Square Foot ────────────────────────────────── */
.cost-per-sqft {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #715be0 0%, #5c72db 100%);
  color: #fff;
}

.cost-per-sqft .sqft-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  font-size: 22px;
  flex: none;
}

.cost-per-sqft .sqft-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .5px;
  opacity: .85;
}

.cost-per-sqft .sqft-value {
  font: 800 28px/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: -1px;
}

.cost-per-sqft .sqft-note {
  margin-top: 2px;
  font-size: 11px;
  opacity: .8;
}

/* ── Copy button ─────────────────────────────────────────── */
.cost-copy-btn {
  width: 100%;
  height: 42px;
  margin-top: 16px;
  border: 0;
  border-radius: 8px;
  background: #7657e8;
  color: #fff;
  font: 800 13px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  cursor: pointer;
  transition: background .15s;
}

.cost-copy-btn:hover {
  background: #6547d7;
}

.cost-fine-print {
  margin: 12px 0 0;
  color: #858d9d;
  font-size: 11px;
  line-height: 1.6;
}

/* ── Price Reference Table ───────────────────────────────── */
.price-ref-section {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.price-ref-section h2 {
  margin: 0 0 8px;
  color: #172033;
  font: 800 28px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: -.8px;
}

.price-ref-section > p {
  margin: 0 0 24px;
  color: #596477;
  font-size: 14px;
  line-height: 1.7;
}

.price-ref-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #e3e6ed;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.price-ref-table th,
.price-ref-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid #eef0f6;
}

.price-ref-table th {
  background: #faf9ff;
  color: #6c6494;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .5px;
  text-transform: uppercase;
}

.price-ref-table td {
  color: #313a4c;
  font-size: 14px;
}

.price-ref-table td strong {
  color: #172033;
}

.price-ref-table td .price-range {
  font-weight: 800;
  color: #EA580C;
}

.price-ref-table tr:last-child td {
  border-bottom: 0;
}

.price-ref-table tr:hover td {
  background: #faf9ff;
}

/* ── Project Type Cards ──────────────────────────────────── */
.project-types-section {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.project-types-section h2 {
  margin: 0 0 8px;
  color: #172033;
  font: 800 28px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: -.8px;
}

.project-types-section > p {
  margin: 0 0 24px;
  color: #596477;
  font-size: 14px;
}

.project-type-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.project-type-card {
  padding: 24px;
  border: 1px solid #e3e6ed;
  border-radius: 14px;
  background: #fff;
  transition: transform .15s, box-shadow .15s;
}

.project-type-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px #2837550a;
}

.project-type-card .ptc-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 16px;
  border-radius: 10px;
  background: #f5f2ff;
  font-size: 22px;
}

.project-type-card h3 {
  margin: 0 0 8px;
  color: #172033;
  font: 800 17px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.project-type-card .ptc-avg {
  margin-bottom: 4px;
  color: #EA580C;
  font: 800 18px/1 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.project-type-card .ptc-cost {
  color: #7c8496;
  font-size: 12px;
}

/* ── How Cost Is Calculated ───────────────────────────────── */
.how-calc-section {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.how-calc-section h2 {
  margin: 0 0 8px;
  color: #172033;
  font: 800 28px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: -.8px;
}

.how-calc-section > p {
  margin: 0 0 24px;
  color: #596477;
  font-size: 14px;
  line-height: 1.7;
}

.how-calc-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.how-calc-step {
  padding: 24px;
  border: 1px solid #e3e6ed;
  border-radius: 12px;
  background: #fff;
}

.how-calc-step .step-num {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-bottom: 14px;
  border-radius: 8px;
  background: #EA580C;
  color: #fff;
  font: 800 14px ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.how-calc-step h3 {
  margin: 0 0 8px;
  color: #172033;
  font: 800 15px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.how-calc-step p {
  margin: 0;
  color: #596477;
  font-size: 13px;
  line-height: 1.6;
}

.how-calc-formula {
  margin-top: 20px;
  padding: 24px;
  border-radius: 12px;
  background: #1d1830;
  color: #fff;
  text-align: center;
}

.how-calc-formula .formula-label {
  margin-bottom: 8px;
  color: #a99fd8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

.how-calc-formula .formula-text {
  font: 800 18px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.how-calc-formula .formula-text span {
  color: #EA580C;
}

/* ── Saving Tips ─────────────────────────────────────────── */
.saving-tips-section {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.saving-tips-section h2 {
  margin: 0 0 8px;
  color: #172033;
  font: 800 28px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  letter-spacing: -.8px;
}

.saving-tips-section > p {
  margin: 0 0 24px;
  color: #596477;
  font-size: 14px;
}

.saving-tips-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
}

.saving-tip-card {
  padding: 20px;
  border: 1px solid #e3e6ed;
  border-radius: 12px;
  background: #fff;
  transition: transform .15s, box-shadow .15s;
}

.saving-tip-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px #2837550a;
}

.saving-tip-card .tip-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  border-radius: 10px;
  background: #fff4ed;
  font-size: 20px;
}

.saving-tip-card h3 {
  margin: 0 0 8px;
  color: #172033;
  font: 800 14px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.saving-tip-card p {
  margin: 0;
  color: #596477;
  font-size: 12px;
  line-height: 1.6;
}

/* ── Internal Links Section ───────────────────────────────── */
.internal-links-section {
  max-width: 1200px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.internal-links-section h2 {
  margin: 0 0 16px;
  color: #172033;
  font: 800 22px/1.2 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

.internal-links-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.internal-link-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 16px;
  border: 1px solid #e3e6ed;
  border-radius: 99px;
  background: #fff;
  color: #313a4c;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}

.internal-link-pill:hover {
  border-color: #EA580C;
  background: #fff4ed;
  color: #EA580C;
  transform: translateY(-1px);
}

.internal-link-pill::after {
  content: '→';
  font-size: 12px;
  opacity: .5;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 1000px) {
  .cost-hero {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 28px;
  }

  .cost-hero-visual {
    min-height: 240px;
    order: -1;
  }

  .cost-calc-body {
    grid-template-columns: 1fr;
  }

  .cost-input-panel {
    border-right: 0;
    border-bottom: 1px solid #eef0f6;
  }

  .how-calc-steps {
    grid-template-columns: 1fr 1fr;
  }

  .saving-tips-grid {
    grid-template-columns: 1fr 1fr 1fr;
  }

  .project-type-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 700px) {
  .cost-hero {
    padding: 20px 16px 24px;
  }

  .cost-hero h1 {
    font-size: 30px;
    letter-spacing: -1.5px;
  }

  .cost-hero .hero-subtitle {
    font-size: 14px;
  }

  .cost-calc-wrap {
    padding: 0 16px;
  }

  .cost-calc-header {
    padding: 18px 20px;
  }

  .cost-input-panel,
  .cost-results-panel {
    padding: 20px 18px;
  }

  .result-cards-grid {
    grid-template-columns: 1fr;
  }

  .result-card.highlight .result-card-value {
    font-size: 32px;
  }

  .donut-chart-wrap {
    flex-direction: column;
    align-items: center;
    gap: 16px;
  }

  .donut-legend {
    width: 100%;
  }

  .price-ref-section,
  .project-types-section,
  .how-calc-section,
  .saving-tips-section,
  .internal-links-section {
    padding: 0 16px;
  }

  .price-ref-section h2,
  .project-types-section h2,
  .how-calc-section h2,
  .saving-tips-section h2 {
    font-size: 22px;
  }

  .price-ref-table {
    display: block;
    overflow-x: auto;
  }

  .project-type-grid {
    grid-template-columns: 1fr;
  }

  .how-calc-steps {
    grid-template-columns: 1fr;
  }

  .saving-tips-grid {
    grid-template-columns: 1fr 1fr;
  }

  .how-calc-formula .formula-text {
    font-size: 14px;
  }

  .cost-per-sqft {
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .saving-tips-grid {
    grid-template-columns: 1fr;
  }

  .cost-field-row,
  .cost-field-row.three {
    grid-template-columns: 1fr;
  }

  .cost-radio-group {
    flex-direction: column;
  }
}
