:root {
  --teton-blue: #0b1e78;
  --teton-ink: #172033;
  --teton-muted: #5c667a;
  --teton-line: #d8deea;
  --teton-bg: #f7f9fc;
  --teton-white: #ffffff;
  --teton-error: #b42318;
  --teton-success: #177245;
  --teton-focus: #3157d5;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--teton-bg);
}

.teton-widget {
  max-width: 860px;
  margin: 0 auto;
  padding: 24px;
  color: var(--teton-ink);
}

.teton-widget__shell {
  background: var(--teton-white);
  border: 1px solid var(--teton-line);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(23, 32, 51, 0.08);
  overflow: hidden;
}

.teton-widget__header {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 22px 26px;
  border-bottom: 1px solid var(--teton-line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.teton-widget__logo {
  width: 96px;
  max-width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  background: transparent;
  display: block;
}

.teton-widget h2 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: 0;
}

.teton-widget__title {
  font-size: 26px;
  font-weight: 760;
}

.teton-widget__subtitle {
  margin: 7px 0 0;
  color: var(--teton-muted);
  font-size: 15px;
  line-height: 1.5;
}

.teton-widget form {
  padding: 22px 26px 24px;
}

.teton-widget__progress {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.teton-widget__progress-item {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
  color: var(--teton-muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.25;
}

.teton-widget__progress-item span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--teton-line);
  border-radius: 999px;
  background: #f5f7fb;
  color: var(--teton-muted);
  font-size: 12px;
}

.teton-widget__progress-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.teton-widget__progress-item.is-active {
  color: var(--teton-blue);
}

.teton-widget__progress-item.is-active span {
  border-color: var(--teton-blue);
  background: var(--teton-blue);
  color: var(--teton-white);
}

.teton-widget__progress-item.is-complete span {
  border-color: rgba(23, 114, 69, 0.22);
  background: rgba(23, 114, 69, 0.1);
  color: var(--teton-success);
}

.teton-widget__step {
  padding: 20px;
  border: 1px solid var(--teton-line);
  border-radius: 8px;
  background: #ffffff;
}

.teton-widget__step-header {
  margin-bottom: 16px;
}

.teton-widget__step-header p {
  margin: 0 0 6px;
  color: var(--teton-muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.teton-widget__step-header h2 {
  margin: 0;
  color: var(--teton-blue);
  font-size: 22px;
  font-weight: 780;
}

.teton-widget__step-intro {
  margin: -6px 0 16px;
  color: var(--teton-muted);
  font-size: 14px;
  line-height: 1.45;
}

.teton-widget__section-label {
  margin: 0 0 10px;
  color: var(--teton-blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.teton-widget__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.teton-widget__grid--property {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.teton-widget__field {
  display: grid;
  grid-template-rows: minmax(34px, auto) auto minmax(18px, auto);
  min-width: 0;
  gap: 7px;
}

.teton-widget__field--full {
  grid-column: 1 / -1;
}

.teton-widget__field--street {
  grid-column: span 8;
}

.teton-widget__field--unit {
  grid-column: span 4;
}

.teton-widget__field--city {
  grid-column: span 6;
}

.teton-widget__field--state,
.teton-widget__field--zip {
  grid-column: span 3;
}

.teton-widget__section-label--details {
  grid-column: 1 / -1;
  margin: 2px 0 -2px;
}

.teton-widget__field--detail {
  grid-column: span 3;
}

.teton-widget__field > label {
  display: flex;
  min-height: 34px;
  align-items: flex-end;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.teton-widget input,
.teton-widget select,
.teton-widget textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid #b9c2d3;
  border-radius: 6px;
  padding: 10px 12px;
  background: var(--teton-white);
  color: var(--teton-ink);
  font: inherit;
  font-size: 15px;
}

.teton-widget textarea {
  min-height: 106px;
  resize: vertical;
}

.teton-widget input:focus,
.teton-widget select:focus,
.teton-widget textarea:focus {
  border-color: var(--teton-focus);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.16);
  outline: none;
}

.teton-widget__error {
  min-height: 18px;
  color: var(--teton-error);
  font-size: 12px;
  line-height: 1.4;
}

.teton-widget__consent {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
  border: 1px solid #c4ccdc;
  border-radius: 8px;
  padding: 14px;
  background: #ffffff;
  color: var(--teton-ink);
  font-size: 13px;
  line-height: 1.45;
}

.teton-widget__consent input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  align-self: center;
  margin: 0;
}

.teton-widget__security {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.teton-widget__turnstile {
  min-height: 65px;
}

.teton-widget__hidden {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.teton-widget__footer {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid var(--teton-line);
}

.teton-widget__disclaimer {
  margin: 0;
  color: var(--teton-muted);
  font-size: 13px;
  line-height: 1.5;
}

.teton-widget__button {
  min-height: 48px;
  width: fit-content;
  border: 0;
  border-radius: 6px;
  padding: 0 22px;
  background: var(--teton-blue);
  color: var(--teton-white);
  cursor: pointer;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
}

.teton-widget__button--secondary {
  border: 1px solid var(--teton-line);
  background: var(--teton-white);
  color: var(--teton-blue);
}

.teton-widget__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.teton-widget__button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.teton-widget__alert {
  display: none;
  border-radius: 6px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
}

.teton-widget__alert--success {
  border: 1px solid rgba(23, 114, 69, 0.24);
  background: rgba(23, 114, 69, 0.08);
  color: var(--teton-success);
}

.teton-widget__alert--error {
  border: 1px solid rgba(180, 35, 24, 0.24);
  background: rgba(180, 35, 24, 0.08);
  color: var(--teton-error);
}

.teton-widget__alert.is-visible {
  display: block;
}

@media (max-width: 680px) {
  .teton-widget {
    padding: 14px;
  }

  .teton-widget__header {
    grid-template-columns: 1fr;
    padding: 22px;
  }

  .teton-widget form {
    padding: 22px;
  }

  .teton-widget__progress {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .teton-widget__progress-item {
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .teton-widget__step {
    min-height: auto;
    padding: 18px;
  }

  .teton-widget__grid {
    grid-template-columns: 1fr;
  }

  .teton-widget__section-label--details,
  .teton-widget__field--street,
  .teton-widget__field--unit,
  .teton-widget__field--city,
  .teton-widget__field--state,
  .teton-widget__field--zip,
  .teton-widget__field--detail {
    grid-column: 1;
  }

  .teton-widget__actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .teton-widget__actions .teton-widget__button {
    justify-self: stretch;
    width: 100%;
  }
}

/* Keep iOS from enlarging the page when a field receives focus. */
@media (max-width: 768px) {
  .teton-widget input:not([type="checkbox"]):not([type="radio"]),
  .teton-widget select,
  .teton-widget textarea {
    font-size: 16px !important;
  }
}
