/* Estimator, on the site's type system: Archivo headings, Inter prose,
   IBM Plex Mono for labels and figures. The arithmetic is the point here,
   so the mono is doing real work rather than decorating. */

.es-wrap h1, .es-wrap h2, .es-q, .es-service-name, .es-sent-h {
  font-family: 'Archivo', ui-sans-serif, system-ui, sans-serif;
  letter-spacing: -0.015em;
}
.es-label, .es-result-label, .es-factored-head, .es-group-name,
.es-field span, .es-qnum, .es-gst, .es-bd-fig, .es-range, .es-number {
  font-family: 'IBM Plex Mono', ui-monospace, monospace;
}
.es-range { letter-spacing: -0.03em; }


.es-wrap { max-width: 820px; margin: 0 auto; }

.es-label,
.es-result-label,
.es-factored-head,
.es-group-name {
  font-size: 0.6875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-weight: 700;
  color: #9ca3af;
}
.es-label { margin: 0 0 1rem; }

/* ------------------------------ service picker ---------------------- */

.es-services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.es-service {
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  cursor: pointer;
  padding: 1rem 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  color: #1f2937;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.es-service:hover { border-color: #a84536; }
.es-service.is-on {
  background: #a84536;
  border-color: #a84536;
  color: #ffffff;
}
.es-service-name { font-size: 1.0625rem; font-weight: 700; }
.es-service-blurb { font-size: 0.875rem; line-height: 1.45; color: #6b7280; }
.es-service.is-on .es-service-blurb { color: rgba(255, 255, 255, 0.8); }
.es-check { margin-right: 0.45rem; font-size: 0.75rem; }
.es-combined { font-size: 0.9375rem; color: #6b7280; margin: 0.875rem 0 0; }

/* --------------------------------- progress ------------------------- */

.es-progress {
  height: 3px;
  background: var(--rule);
  border-radius: 2px;
  margin: 2.5rem 0;
  overflow: hidden;
}
.es-progress-fill {
  display: block;
  height: 100%;
  background: #a84536;
  transition: width 0.38s cubic-bezier(0.2, 0.7, 0.3, 1);
}

/* -------------------------------- questions ------------------------- */

.es-questions { list-style: none; padding: 0; margin: 0; }
.es-question { border-top: 1px solid var(--rule); padding: 1.625rem 0 1.75rem; }
.es-question:first-child { border-top: none; padding-top: 0; }
.es-q {
  font-size: 1.1875rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}
.es-qnum { font-size: 0.8125rem; font-weight: 500; color: #9ca3af; flex: 0 0 auto; }
.es-hint { font-size: 0.875rem; color: #6b7280; margin: -0.625rem 0 0.875rem 1.6rem; }
.es-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.es-opt {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.125rem;
  text-align: left;
  font-size: 0.9375rem;
  background: #ffffff;
  color: #1f2937;
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 0.375rem;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.es-opt:hover { border-color: #a84536; }
.es-opt.is-on { background: #a84536; border-color: #a84536; color: #ffffff; }
.es-opt-sub { font-size: 0.75rem; line-height: 1.35; color: #6b7280; }
.es-opt.is-on .es-opt-sub { color: rgba(255, 255, 255, 0.8); }

.es-numberwrap { display: flex; align-items: center; gap: 0.625rem; }
.es-number {
  font-family: inherit;
  font-size: 1.125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.6rem 0.75rem;
  width: 7.5rem;
}
.es-number:focus { outline: 2px solid #a84536; outline-offset: 1px; border-color: transparent; }
.es-numbersuffix { font-size: 0.9375rem; color: #6b7280; }

.es-service:focus-visible,
.es-opt:focus-visible,
.es-cta:focus-visible {
  outline: 3px solid #c4850a;
  outline-offset: 2px;
}

/* --------------------------------- result --------------------------- */

.es-result {
  margin-top: 2.75rem;
  border: 1px solid var(--rule);
  border-radius: 0.5rem;
  padding: 2rem;
  background: #ffffff;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.06), 0 2px 4px -2px rgba(0, 0, 0, 0.06);
}
.es-result-label { margin: 0 0 0.875rem; }
.es-nothing { font-size: 1.0625rem; color: #4b5563; margin: 0; }
.es-note { font-size: 0.9375rem; line-height: 1.65; color: #374151; margin: 1.125rem 0 0; }
.es-error {
  font-size: 0.9375rem;
  color: #8b3228;
  background: #fdf5f3;
  border: 1px solid #f0c8bc;
  border-radius: 0.375rem;
  padding: 0.75rem 0.875rem;
  margin: 1.125rem 0 0;
}

/* --------------------------------- actions -------------------------- */

.es-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.125rem; }
.es-cta {
  display: inline-block;
  margin: 1.625rem 0 0;
  cursor: pointer;
  border: none;
  border-radius: 0.5rem;
  background: #a84536;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.8125rem 1.75rem;
  transition: background-color 0.18s ease;
}
.es-cta:hover:not(:disabled) { background: #8b3228; }
.es-cta:disabled { cursor: not-allowed; opacity: 0.45; }
.es-turnaround { font-size: 0.8125rem; color: #9ca3af; margin: 0.75rem 0 0; }

/* --------------------------------- details -------------------------- */

.es-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.375rem;
}
.es-field { display: flex; flex-direction: column; gap: 0.375rem; }
.es-field--wide { grid-column: 1 / -1; }
.es-field span {
  font-size: 0.6875rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  font-weight: 700;
  color: #9ca3af;
}
.es-field input,
.es-field textarea {
  font-family: inherit;
  font-size: 1rem;
  color: #1f2937;
  background: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  padding: 0.6875rem 0.75rem;
  width: 100%;
  box-sizing: border-box;
  resize: vertical;
}
.es-field input:focus,
.es-field textarea:focus {
  outline: 2px solid #a84536;
  outline-offset: 1px;
  border-color: transparent;
}

.es-sent-h { font-size: 1.75rem; font-weight: 700; color: #111827; margin: 0 0 0.75rem; }
.es-legal { font-size: 0.875rem; line-height: 1.7; color: #111827; margin: 1.75rem 0 0; }

/* ---------------------------------- print --------------------------- */

@media print {
  .es-noprint,
  .es-progress,
  .es-cta,
  .es-turnaround,
  header,
  footer { display: none !important; }
  .es-result { border: none; box-shadow: none; padding: 0; margin: 0; break-inside: avoid; }
}

@media (max-width: 640px) {
  .es-services { grid-template-columns: 1fr; }
  .es-result { padding: 1.5rem 1.25rem; }
  .es-fields { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .es-progress-fill,
  .es-service,
  .es-opt,
  .es-cta { transition-duration: 1ms !important; }
}
