/* Instant estimate box. Uses the colour and radius tokens from site.css. */

.est-section { background: var(--bg3); }

.est-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  margin-top: 40px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.est-inputs { padding: 28px; }
.est-output {
  padding: 28px;
  background: var(--bg2);
  border-inline-start: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 420px;
}

.est-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.est-tab {
  flex: 1;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
}
.est-tab.is-active { color: #fff; background: var(--navy); border-color: var(--navy); }
.est-tab:focus-visible,
.est-chip:focus-visible,
.est-input:focus-visible,
.est-textarea:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

.est-label { display: block; margin-bottom: 6px; font-size: 0.82rem; font-weight: 600; color: var(--text); }
.est-textarea,
.est-input {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-hi);
  border-radius: 10px;
}
.est-textarea { resize: vertical; min-height: 84px; }

.est-examples { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 18px; }
.est-chip {
  padding: 6px 10px;
  font: inherit;
  font-size: 0.78rem;
  color: var(--teal-dark);
  background: var(--teal-light);
  border: 1px solid var(--teal-mid);
  border-radius: 999px;
  cursor: pointer;
}

.est-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.est-field-wide { grid-column: 1 / -1; }
.est-field[hidden] { display: none; }

.est-submit { width: 100%; justify-content: center; }
.est-submit[disabled] { opacity: 0.6; cursor: wait; }
.est-hint { margin-top: 10px; font-size: 0.78rem; color: var(--muted2); }

.est-state { text-align: center; color: var(--muted); }
.est-state[hidden],
.est-result[hidden],
.est-panel[hidden] { display: none; }
.est-state-icon { font-size: 2rem; color: var(--teal-mid); margin-bottom: 10px; }
.est-state-error .est-state-icon { color: var(--amber); }
.est-state-error p { color: var(--text); }

.est-spinner {
  display: inline-block;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  border: 3px solid var(--teal-mid);
  border-top-color: var(--teal);
  border-radius: 50%;
  animation: est-spin 0.8s linear infinite;
}
@keyframes est-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .est-spinner { animation-duration: 3s; } }

.est-result-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; }
.est-result-title { font-size: 1.05rem; font-weight: 700; color: var(--navy); }
.est-result-size { font-size: 0.82rem; color: var(--muted); }

.est-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0; }
.est-facts > div { padding: 10px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 10px; }
.est-facts dt { font-size: 0.72rem; color: var(--muted2); }
.est-facts dd { margin: 2px 0 0; font-size: 1.05rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }

.est-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.est-table caption { text-align: start; margin-bottom: 4px; font-size: 0.72rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted2); }
.est-table th { padding: 6px 0; font-weight: 400; text-align: start; color: var(--muted); }
.est-table td { padding: 6px 0; text-align: end; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.est-table tr + tr { border-top: 1px solid var(--border); }
.est-row-strong th,
.est-row-strong td { font-weight: 700; color: var(--navy); }

.est-total { margin: 14px 0; padding: 12px 14px; background: var(--teal-light); border-radius: 10px; }
.est-total > div { display: flex; justify-content: space-between; gap: 12px; font-size: 0.88rem; color: var(--muted); }
.est-total strong { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.est-total-main { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--teal-mid); font-size: 1rem !important; }
.est-total-main span { font-weight: 700; color: var(--navy); }
.est-total-main strong { font-size: 1.15rem; color: var(--teal-dark); }

.est-cta { width: 100%; justify-content: center; }
.est-share { margin-top: 8px; cursor: pointer; font: inherit; font-weight: 600; }
.est-share-hint { margin-top: 6px; font-size: 0.74rem; color: var(--muted2); text-align: center; }
.est-disclaimer { margin-top: 10px; font-size: 0.76rem; line-height: 1.5; color: var(--muted2); }
.est-privacy { margin-top: 14px; text-align: center; font-size: 0.78rem; color: var(--muted2); }

@media (max-width: 860px) {
  .est-card { grid-template-columns: minmax(0, 1fr); }
  .est-output { min-height: 0; border-inline-start: 0; border-top: 1px solid var(--border); }
  .est-inputs,
  .est-output { padding: 20px 16px; }
}
@media (max-width: 420px) {
  .est-grid { grid-template-columns: minmax(0, 1fr); }
}
