/* Cost calculator.
 *
 * The markup used to reuse the form plugin's ff-* classes so its stylesheet
 * would render it. Those classes and that stylesheet are gone; this is the
 * calculator's own styling, built on the design system's custom properties.
 */

.wd-calc {
  --wd-calc-border: #d7dee1;
  --wd-calc-radius: 6px;
  text-align: left;
}

.wd-calc fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 100%;
}

.wd-calc__legend {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.wd-calc__field + .wd-calc__field {
  margin-top: 1.2rem;
}

.wd-calc__label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.3;
}

.wd-calc__label--required::after {
  content: " *";
  color: #c0392b;
}

.wd-calc__control {
  display: block;
  width: 100%;
  padding: 11px 15px;
  border: 1px solid var(--wd-calc-border);
  border-radius: var(--wd-calc-radius);
  background-color: #fff;
  color: inherit;
  font-family: inherit;
  /* 16px keeps iOS from zooming the page when a field takes focus. */
  font-size: 16px;
  line-height: 1.4;
}

.wd-calc__control:focus-visible {
  outline: 2px solid var(--primary, #6fbad1);
  outline-offset: 1px;
}

select.wd-calc__control {
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M1.4 0 6 4.6 10.6 0 12 1.4 6 7.4 0 1.4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
  background-size: 12px 8px;
  text-overflow: ellipsis;
}

.wd-calc__control[readonly] {
  background-color: #f2f4f5;
  cursor: default;
}

.wd-calc__range {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.wd-calc__range input[type="range"] {
  flex: 1 1 auto;
  min-width: 0;
  height: 1.5rem;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--primary, #6fbad1);
  cursor: pointer;
}

.wd-calc__range-value {
  flex: 0 0 auto;
  min-width: 2.5em;
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
  background: var(--primary, #6fbad1);
  color: #fff;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.wd-calc__result {
  margin-top: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--wd-calc-radius);
  background: #f6f9fa;
}

.wd-calc__result h3 {
  margin-top: 0;
}

.wd-calc__result p:last-child {
  margin-bottom: 0;
}

@media (max-width: 478px) {
  .wd-calc__control {
    padding-left: 10px;
  }
}
