/* Price estimate and the printable quote. */

.estimate-section,
.quote-section {
  padding-top: var(--sp5);
}

.estimate-top {
  display: grid;
  gap: var(--sp5);
  align-items: start;
  margin-bottom: var(--sp7);
}

@media (min-width: 960px) {
  .estimate-top {
    grid-template-columns: 7fr 5fr;
    gap: var(--sp6);
  }
}

.estimate-form {
  display: grid;
  gap: var(--sp4);
  margin-bottom: var(--sp6);
}

.estimate-top .estimate-form {
  margin-bottom: 0;
}

.estimate-heading {
  margin: var(--sp6) 0 var(--sp3);
  font-size: var(--fs-xl);
}

/* The result at a glance: the monthly price is the one big number of the page. */
.estimate-summary {
  border-color: var(--accent-line);
  background: var(--accent-tint);
}

.estimate-summary p {
  margin: 0;
}

.estimate-summaryLabel {
  margin: 0 0 var(--sp2);
  color: var(--text-dim);
  font-size: var(--fs-sm);
  font-weight: 700;
}

.estimate-summaryTotal {
  display: flex;
  align-items: baseline;
  gap: var(--sp2);
  font-variant-numeric: tabular-nums;
}

.estimate-summaryTotal strong {
  font-size: var(--fs-3xl);
  line-height: 1.1;
}

.estimate-summaryConfig {
  margin-top: var(--sp2);
  font-weight: 700;
}

.estimate-summaryBest {
  margin-top: var(--sp3);
  color: var(--ok-text);
  font-weight: 700;
}

.estimate-summaryNote {
  margin-top: var(--sp3);
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

.estimate-summary .estimate-summaryActions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp3);
  margin-top: var(--sp4);
}

/* A price that is not set is a state with a name, not a gap. */
.priceTag {
  display: inline-block;
  padding: 2px var(--sp3);
  border: 1px dashed var(--accent-line);
  border-radius: var(--radius-pill);
  background: var(--accent-tint);
  color: var(--accent-btn-hover);
  font-size: var(--fs-sm);
  font-weight: 700;
}

/* Price not set: a state with a name, what to send and where to go. */
.estimate-closed {
  max-width: 640px;
}

.estimate-closed h2 {
  margin: 0 0 var(--sp3);
  font-size: var(--fs-xl);
}

.estimate-closed p {
  margin: 0 0 var(--sp3);
}

.estimate-closed .estimate-closedTell {
  margin-bottom: var(--sp2);
  font-weight: 700;
}

.estimate-closedList {
  margin: 0 0 var(--sp5);
  padding-left: 1.2em;
  color: var(--text-dim);
}

.estimate-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp3);
}

.estimate-fields {
  display: grid;
  gap: var(--sp4);
}

@media (min-width: 600px) {
  .estimate-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.estimate-form .btn[type="submit"] {
  justify-self: start;
}

.estimate-presetList {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.estimate-table {
  width: 100%;
}

.estimate-table th[scope="row"] {
  text-align: left;
  font-weight: 700;
}

.estimate-table tfoot th,
.estimate-table tfoot td {
  background: var(--fill-dim);
}

.estimate-table .estimate-num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.estimate-grand strong {
  font-size: var(--fs-lg);
}

.estimate-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp2) var(--sp4);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Narrow screens: one card per period, each figure labelled, instead of a 6 column table that scrolls sideways. */
@media (max-width: 719px) {
  .estimate-periods thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .estimate-periods,
  .estimate-periods tbody,
  .estimate-periods tr {
    display: block;
  }

  .estimate-periods tr {
    margin-bottom: var(--sp3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
  }

  .estimate-periods th,
  .estimate-periods td {
    display: flex;
    justify-content: space-between;
    gap: var(--sp3);
    border-width: 0 0 1px;
  }

  .estimate-periods td[data-label]::before {
    content: attr(data-label);
    color: var(--text-dim);
  }

  .estimate-periods .estimate-next {
    border-bottom: 0;
  }
}

/* ---- The quote sheet ---------------------------------------- */

.quote-tools {
  display: grid;
  gap: var(--sp2);
  justify-items: start;
  margin-bottom: var(--sp5);
}

.quote-printButton[hidden] {
  display: none;
}

.quote-sheet {
  max-width: 800px;
  padding: var(--sp5);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--panel-bg);
}

.quote-sheet h1 {
  text-align: center;
  margin-bottom: var(--sp5);
}

.quote-sheet h2 {
  margin-top: var(--sp5);
  font-size: var(--fs-lg);
}

.quote-meta {
  margin: 0 0 var(--sp4);
}

.quote-meta div {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--sp3);
  padding: var(--sp1) 0;
  border-bottom: 1px solid var(--border);
}

.quote-meta dt {
  min-width: 120px;
  color: var(--text-faint);
}

.quote-meta dd {
  margin: 0;
}

.quote-total {
  margin-top: var(--sp4);
}

.quote-grand th,
.quote-grand td {
  background: var(--accent-tint);
  font-size: var(--fs-lg);
}

.quote-note {
  margin: var(--sp4) 0 0;
  color: var(--text-dim);
  font-size: var(--fs-sm);
}

/* An invoice an operator made asks for the terms and the no-refund notice before it shows where to pay. */
.invoice-accept {
  margin-top: var(--sp5);
  padding: var(--sp4);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel-bg);
}

.invoice-accept h2 {
  margin-top: 0;
}

.invoice-accept form {
  display: grid;
  gap: var(--sp3);
  margin-top: var(--sp3);
}

.invoice-accept .consent-label {
  display: flex;
  align-items: flex-start;
  gap: var(--sp3);
}

/* The quote prints alone on an A4 page: the site header, footer and the buttons stay out. */
@media print {
  .site-header,
  .site-footer,
  .skip-link,
  .quote-tools,
  .invoice-accept {
    display: none;
  }

  .quote-section {
    padding: 0;
  }

  .quote-sheet {
    max-width: none;
    padding: 0;
    border: 0;
  }

  .quote-grand th,
  .quote-grand td {
    background: transparent;
    border-top: 2px solid var(--text-primary);
  }
}

.estimate-spec {
  max-width: 720px;
  margin-top: var(--sp7);
}

.estimate-spec > summary {
  display: flex;
  align-items: center;
  min-height: var(--h-ctl);
  font-weight: 700;
  cursor: pointer;
}

.estimate-spec[open] > summary {
  margin-bottom: var(--sp3);
}

.estimate-back {
  margin-top: var(--sp4);
}

.quote-sheet .spec {
  margin-top: var(--sp5);
  padding: 0;
  border: 0;
}
