/* ═══════════════════════════════════════════════════════════════════════
   Energy Savings Calculator — branded red & white modal popup
   ═══════════════════════════════════════════════════════════════════════ */

/* ── Floating trigger ─────────────────────────────────────────────────── */
.esc-trigger {
  position: fixed;
  right: 0;
  top: 52%;
  /* Hidden by default — slides in once user scrolls past the CTA section */
  transform: translateY(-50%) translateX(110%);
  opacity: 0;
  pointer-events: none;
  z-index: 8000;
  background: var(--red, #C9302C);
  border: none;
  border-radius: 10px 0 0 10px;
  padding: 14px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: #fff;
  box-shadow: -3px 0 18px rgba(201, 48, 44, 0.45);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 0.35s ease,
              box-shadow 0.2s ease,
              background 0.2s ease;
  line-height: 1;
}
/* Visible state — added by IntersectionObserver after CTA scrolls past */
.esc-trigger--visible {
  transform: translateY(-50%) translateX(0);
  opacity: 1;
  pointer-events: auto;
}
.esc-trigger--visible:hover {
  background: var(--red-dark, #a52523);
  transform: translateY(-50%) translateX(-4px);
  box-shadow: -6px 0 26px rgba(201, 48, 44, 0.6);
}
.esc-trigger .fa {
  font-size: 20px;
}
.esc-trigger span {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  text-align: center;
  line-height: 1.35;
}

/* ── Overlay ──────────────────────────────────────────────────────────── */
.esc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 8001;
  animation: esc-fade-in 0.25s ease forwards;
}
@keyframes esc-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Modal ────────────────────────────────────────────────────────────── */
.esc-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -46%) scale(0.96);
  z-index: 8002;
  width: 540px;
  max-width: calc(100vw - 32px);
  max-height: 92dvh;
  background: #fff;
  border-radius: 14px;
  box-shadow:
    0 20px 60px rgba(0, 0, 0, 0.22),
    0 4px 16px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.28s ease,
    transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}
.esc-modal--open {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

/* ── Modal header ─────────────────────────────────────────────────────── */
.esc-modal-header {
  background: linear-gradient(135deg, #C9302C 0%, #a52523 100%);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.esc-modal-header-text {
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
}
.esc-modal-header-text > .fa {
  font-size: 26px;
  opacity: 0.9;
}
.esc-modal-title {
  font-family: var(--serif, 'Oswald', sans-serif);
  font-size: 20px;
  font-weight: 600;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
  margin-bottom: 4px;
}
.esc-modal-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.esc-modal-close {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #fff;
  font-size: 16px;
  transition: background 0.15s;
  flex-shrink: 0;
}
.esc-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ── Step dots ────────────────────────────────────────────────────────── */
.esc-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 16px 24px 0;
  background: #fff;
  flex-shrink: 0;
  position: relative;
}
.esc-dots::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 1px;
  background: #ebebeb;
}
.esc-dot-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
  position: relative;
  padding-bottom: 14px;
}
.esc-dot-item:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 14px;
  left: calc(50% + 16px);
  right: calc(-50% + 16px);
  height: 2px;
  background: #e5e5e5;
  z-index: 0;
}
.esc-dot-item.active:not(:last-child)::after {
  background: rgba(201, 48, 44, 0.25);
}
.esc-dot-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background: #f5f5f5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  color: #999;
  position: relative;
  z-index: 1;
  transition: all 0.25s ease;
}
.esc-dot-item.active .esc-dot-circle {
  border-color: var(--red, #C9302C);
  background: var(--red, #C9302C);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(201, 48, 44, 0.14);
}
.esc-dot-label {
  font-size: 10px;
  font-weight: 600;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: color 0.25s;
}
.esc-dot-item.active .esc-dot-label {
  color: var(--red, #C9302C);
}

/* ── Scrollable body ──────────────────────────────────────────────────── */
.esc-body {
  padding: 24px 24px 28px;
  overflow-y: auto;
  flex: 1;
  animation: esc-step-in 0.28s ease;
}
.esc-body::-webkit-scrollbar {
  width: 5px;
}
.esc-body::-webkit-scrollbar-track {
  background: #f5f5f5;
}
.esc-body::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}
@keyframes esc-step-in {
  from { opacity: 0; transform: translateX(14px); }
  to   { opacity: 1; transform: translateX(0); }
}

.esc-section-title {
  font-family: var(--serif, 'Oswald', sans-serif);
  font-size: 18px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--black, #111);
  letter-spacing: 0.03em;
  margin: 0 0 20px;
}

/* ── Fields ───────────────────────────────────────────────────────────── */
.esc-field {
  margin-bottom: 22px;
}
.esc-field-label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #555;
  margin-bottom: 10px;
}
.esc-field-label .fa {
  color: var(--red, #C9302C);
  font-size: 13px;
}
.esc-field-value {
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--red, #C9302C);
  background: rgba(201, 48, 44, 0.07);
  border-radius: 20px;
  padding: 2px 10px;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Select ───────────────────────────────────────────────────────────── */
.esc-select-wrap {
  position: relative;
}
.esc-select {
  width: 100%;
  padding: 11px 38px 11px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--black, #111);
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.esc-select:focus {
  border-color: var(--red, #C9302C);
}
.esc-select-arrow {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  font-size: 11px;
  pointer-events: none;
}

/* ── Range slider ─────────────────────────────────────────────────────── */
.esc-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #e8e8e8;
  outline: none;
  cursor: pointer;
  display: block;
}
.esc-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red, #C9302C);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(201, 48, 44, 0.4);
  border: 2px solid #fff;
  transition: transform 0.15s, box-shadow 0.15s;
}
.esc-range::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 14px rgba(201, 48, 44, 0.55);
}
.esc-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--red, #C9302C);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(201, 48, 44, 0.4);
  border: 2px solid #fff;
}
.esc-range-ends {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: #aaa;
  margin-top: 6px;
}

/* ── Era buttons ──────────────────────────────────────────────────────── */
.esc-era-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 10px;
}
.esc-era-btn {
  background: #f7f7f7;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  padding: 10px 6px;
  font-size: 12px;
  font-weight: 600;
  color: #555;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
}
.esc-era-btn:hover {
  border-color: var(--red, #C9302C);
  color: var(--red, #C9302C);
  background: rgba(201, 48, 44, 0.04);
}
.esc-era-btn.active {
  background: var(--red, #C9302C);
  border-color: var(--red, #C9302C);
  color: #fff;
}

/* ── Field note ───────────────────────────────────────────────────────── */
.esc-field-note {
  font-size: 12px;
  color: #888;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  line-height: 1.4;
}
.esc-field-note .fa {
  color: var(--red, #C9302C);
  font-size: 12px;
  flex-shrink: 0;
}

/* ── Service cards ────────────────────────────────────────────────────── */
.esc-service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.esc-service-card {
  background: #f9f9f9;
  border: 1.5px solid #e5e5e5;
  border-radius: 10px;
  padding: 16px 12px 14px;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}
.esc-service-wide {
  grid-column: span 2;
  flex-direction: row;
  justify-content: center;
  gap: 10px;
  padding: 13px 20px;
}
.esc-service-wide .esc-svc-sub {
  display: none;
}
.esc-service-card .fa {
  font-size: 22px;
  color: #aaa;
  transition: color 0.15s;
}
.esc-service-card:hover {
  border-color: var(--red, #C9302C);
  background: rgba(201, 48, 44, 0.03);
  transform: translateY(-1px);
}
.esc-service-card:hover .fa {
  color: var(--red, #C9302C);
}
.esc-service-card.active {
  background: rgba(201, 48, 44, 0.06);
  border-color: var(--red, #C9302C);
  box-shadow: 0 0 0 3px rgba(201, 48, 44, 0.1);
}
.esc-service-card.active .fa {
  color: var(--red, #C9302C);
}
.esc-svc-label {
  font-size: 13px;
  font-weight: 700;
  color: #222;
}
.esc-svc-sub {
  font-size: 11px;
  color: #999;
  line-height: 1.3;
}
.esc-service-card.active .esc-svc-label {
  color: var(--red, #C9302C);
}

/* ── Efficiency strip ─────────────────────────────────────────────────── */
.esc-eff-strip {
  display: flex;
  align-items: center;
  background: #fafafa;
  border: 1px solid #ebebeb;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 4px;
  gap: 0;
}
.esc-eff-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.esc-eff-label {
  font-size: 11px;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.esc-eff-val {
  font-size: 16px;
  font-weight: 800;
  color: var(--red, #C9302C);
}
.esc-eff-sep {
  width: 1px;
  height: 36px;
  background: #e5e5e5;
  margin: 0 16px;
  flex-shrink: 0;
}

/* ── Buttons ──────────────────────────────────────────────────────────── */
.esc-btn-primary {
  width: 100%;
  height: 50px;
  background: var(--red, #C9302C);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 8px;
  transition: background 0.18s ease, transform 0.18s ease;
  box-shadow: 0 3px 14px rgba(201, 48, 44, 0.35);
}
.esc-btn-primary:hover:not(:disabled) {
  background: var(--red-dark, #a52523);
  transform: translateY(-1px);
  box-shadow: 0 5px 20px rgba(201, 48, 44, 0.45);
}
.esc-btn-primary:disabled {
  opacity: 0.38;
  cursor: not-allowed;
  box-shadow: none;
}
.esc-btn-row {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.esc-btn-row .esc-btn-primary {
  flex: 1;
  margin-top: 0;
}
.esc-btn-ghost {
  flex: 0 0 auto;
  height: 50px;
  padding: 0 18px;
  background: #fff;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: #666;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  transition: border-color 0.15s, color 0.15s;
}
.esc-btn-ghost:hover {
  border-color: #999;
  color: #333;
}

/* ── Results ──────────────────────────────────────────────────────────── */
.esc-results-context {
  font-size: 12px;
  color: #999;
  margin: -14px 0 20px;
  line-height: 1.5;
}
/* ── Before / After comparison strip ─────────────────────────────────────── */
.esc-compare-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
}
.esc-compare-box {
  flex: 1;
  border-radius: 10px;
  padding: 14px 12px;
  text-align: center;
}
.esc-compare-before {
  background: #fdf2f2;
  border: 1px solid #f5c6c6;
}
.esc-compare-after {
  background: #f0faf2;
  border: 1px solid #b7dfc0;
}
.esc-compare-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #999;
  margin-bottom: 6px;
}
.esc-compare-before .esc-compare-amt {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #c0392b;
}
.esc-compare-after .esc-compare-amt {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #27ae60;
}
.esc-compare-arrow {
  color: #bbb;
  font-size: 18px;
  flex-shrink: 0;
}

.esc-result-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #f9f9f9;
  border: 1px solid #ebebeb;
  border-left: 4px solid #ddd;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 10px;
  animation: esc-step-in 0.3s ease;
}
.esc-result-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.esc-icon-cool {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
  border-left-color: #3b82f6;
}
.esc-icon-heat {
  background: rgba(234, 88, 12, 0.1);
  color: #ea580c;
}
.esc-result-row:has(.esc-icon-cool) {
  border-left-color: #3b82f6;
}
.esc-result-row:has(.esc-icon-heat) {
  border-left-color: #ea580c;
}
.esc-result-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #888;
  margin-bottom: 4px;
}
.esc-result-amt {
  font-size: 28px;
  font-weight: 800;
  color: #111;
  line-height: 1;
}
.esc-result-amt span {
  font-size: 14px;
  font-weight: 500;
  color: #999;
  margin-left: 2px;
}

/* ── Total card ───────────────────────────────────────────────────────── */
.esc-total-card {
  background: linear-gradient(135deg, #C9302C 0%, #a52523 100%);
  border-radius: 12px;
  padding: 22px 22px 18px;
  color: #fff;
  margin: 14px 0;
  box-shadow: 0 6px 24px rgba(201, 48, 44, 0.35);
  animation: esc-step-in 0.4s ease;
}
.esc-total-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.esc-total-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.75);
}
.esc-total-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 4px;
  padding: 2px 7px;
  color: rgba(255, 255, 255, 0.85);
}
.esc-total-number {
  font-family: var(--serif, 'Oswald', sans-serif);
  font-size: 54px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
  letter-spacing: -0.01em;
}
.esc-total-yr {
  font-family: var(--sans, 'Inter', system-ui, sans-serif);
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.65);
  margin-left: 4px;
}
.esc-total-decade {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 10px;
}
.esc-total-decade strong {
  color: #fff;
  font-weight: 700;
}

/* ── CTA button ───────────────────────────────────────────────────────── */
.esc-cta {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  height: 52px;
  background: linear-gradient(135deg, #1a56db 0%, #1446b8 100%);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  box-shadow: 0 4px 16px rgba(26, 86, 219, 0.35);
  margin-bottom: 12px;
}
.esc-cta:hover {
  background: linear-gradient(135deg, #1446b8 0%, #0f3a9e 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(26, 86, 219, 0.5);
  color: #fff;
  text-decoration: none;
}

/* ── Recalculate ──────────────────────────────────────────────────────── */
.esc-recalc {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: none;
  border: none;
  padding: 6px;
  font-size: 13px;
  color: #bbb;
  cursor: pointer;
  width: 100%;
  transition: color 0.15s;
  margin-bottom: 14px;
}
.esc-recalc:hover {
  color: #666;
}

/* ── Disclaimer ───────────────────────────────────────────────────────── */
.esc-disclaimer {
  font-size: 11px;
  color: #bbb;
  line-height: 1.55;
  text-align: center;
  margin: 0;
}

/* ── Mobile ───────────────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .esc-modal {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    transform: translateY(20px) scale(0.98);
    max-width: 100%;
    width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 92dvh;
  }
  .esc-modal--open {
    transform: translateY(0) scale(1);
  }
  .esc-era-grid {
    grid-template-columns: 1fr 1fr;
  }
  .esc-total-number {
    font-size: 44px;
  }
  .esc-trigger {
    top: auto;
    bottom: 72px;
    transform: translateX(110%);
  }
  .esc-trigger--visible {
    transform: translateX(0);
  }
  .esc-trigger--visible:hover {
    transform: translateX(-4px);
  }
}
