/* ==========================================================================
   THREE broker sign-up form (three-broker-sign-up.html)

   Recreates the Gravity Forms "orbital" form formerly embedded from
   simonforms.com, with the values measured from it. Everything is scoped
   under .tbs-page so the site's global styles (main.css) don't leak in.
   ========================================================================== */

@font-face {
  font-family: 'Rubik';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url('fonts/rubik-latin.woff2') format('woff2');
}

.tbs-page {
  --tbs-primary: #16bba9;
  --tbs-primary-rgb: 22, 187, 169;
  --tbs-secondary: #00516a;
  --tbs-text: #112337;
  --tbs-muted: #585e6a;
  --tbs-danger: #c02b0a;
  --tbs-danger-rgb: 192, 43, 10;
  --tbs-input-border: #ddf0ee;
  --tbs-shadow: 0 1px 4px rgba(18, 25, 97, 0.08);

  padding: 20px 0 50px;
  font-family: 'Rubik', sans-serif;
  font-size: 17px;
  line-height: 23px;
  color: #000;
}

.tbs-page *,
.tbs-page *::before,
.tbs-page *::after {
  box-sizing: border-box;
}

.tbs-container {
  width: 95%;
  max-width: 1170px;
  margin: 0 auto;
}

.tbs-form {
  background-color: #fff;
  border-radius: 10px;
  padding: 50px;
}

/* --- Progress --- */
/* The top margin matches the original's (empty) form heading. */
.tbs-progress {
  margin: 15px 0 24px;
}

.tbs-progress__title {
  margin: 0 0 16px;
  font-size: 14px;
  font-weight: 600;
  line-height: 14px;
  color: var(--tbs-muted);
}

.tbs-progress__track {
  height: 10px;
  border-radius: 100px;
  background-color: rgba(17, 35, 55, 0.1);
  overflow: hidden;
}

.tbs-progress__fill {
  width: 50%;
  height: 100%;
  border-radius: 100px;
  background-color: var(--tbs-primary);
  transition: width 0.3s ease;
}

/* --- Error summary (shown when a step fails validation) --- */
.tbs-errors {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 40px;
  padding: 20px 16px;
  border: 1px solid rgba(var(--tbs-danger-rgb), 0.25);
  border-radius: 3px;
  background-color: rgba(var(--tbs-danger-rgb), 0.03);
  box-shadow: var(--tbs-shadow);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.43;
  color: var(--tbs-danger);
}

.tbs-errors[hidden] {
  display: none;
}

.tbs-errors:focus {
  outline: 2px solid rgba(var(--tbs-danger-rgb), 0.65);
  outline-offset: 2px;
}

.tbs-errors__icon {
  display: inline-grid;
  place-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 2px solid rgba(var(--tbs-danger-rgb), 0.25);
  border-radius: 50%;
  background-color: rgba(var(--tbs-danger-rgb), 0.05);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

/* --- Steps and fields --- */
.tbs-step[hidden] {
  display: none;
}

.tbs-fields {
  display: grid;
  row-gap: 40px;
}

/* main.css gives every h3 Raleway and letter-spacing; undo it here. */
.tbs-intro h3 {
  margin: 0 0 15px;
  font-family: inherit;
  letter-spacing: 0;
  font-size: 19.89px;
  font-weight: 700;
  line-height: 23px;
  color: #000;
}

.tbs-intro p {
  margin: 0 0 15px;
  font-size: 17px;
  font-weight: 700;
  line-height: 23px;
  color: #000;
}

.tbs-field {
  margin: 0;
  padding: 0;
  border: 0;
  min-width: 0;
}

.tbs-label {
  display: block;
  margin: 0 0 8px;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 20.02px;
  color: var(--tbs-text);
}

.tbs-label__text {
  padding-right: 6px;
}

.tbs-required {
  font-size: 12px;
  font-weight: 500;
  color: var(--tbs-danger);
}

.tbs-sublabel {
  display: block;
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 18.59px;
  color: var(--tbs-muted);
}

.tbs-input {
  display: block;
  width: 100%;
  height: 38px;
  margin: 0;
  padding: 0 12px;
  border: 2px solid var(--tbs-input-border);
  border-radius: 3px;
  background-color: rgba(var(--tbs-primary-rgb), 0.15);
  box-shadow: var(--tbs-shadow);
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  line-height: 38px;
  color: var(--tbs-text);
  outline: none;
  transition: border-color 0.5s;
}

.tbs-input::placeholder {
  color: rgba(17, 35, 55, 0.65);
  opacity: 1;
}

.tbs-input:focus {
  border-color: var(--tbs-primary);
}

.tbs-name {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.tbs-name__col {
  flex: 1 1 0;
  min-width: 0;
}

/* --- Field errors --- */
.tbs-field__error {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.43;
  color: var(--tbs-danger);
}

.tbs-field__error[hidden] {
  display: none;
}

.tbs-input[aria-invalid="true"] {
  border-color: var(--tbs-danger);
}

/* --- Buttons --- */
.tbs-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.tbs-button {
  display: inline-flex;
  align-items: center;
  height: 38px;
  margin: 0;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 3px;
  background-color: var(--tbs-primary);
  box-shadow: var(--tbs-shadow);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 14px;
  color: #fff;
  cursor: pointer;
}

.tbs-button--secondary {
  border-color: #686e77;
  background-color: var(--tbs-secondary);
}

.tbs-button:disabled {
  opacity: 0.6;
  cursor: wait;
}

.tbs-button:focus-visible {
  outline: 2px solid var(--tbs-secondary);
  outline-offset: 2px;
}

/* --- Confirmation (replaces the form after a successful submit) --- */
.tbs-form[hidden],
.tbs-confirmation[hidden] {
  display: none;
}

.tbs-confirmation {
  padding: 100px 50px;
  border-radius: 10px;
  background-color: #fff;
  text-align: center;
  outline: none;
}

.tbs-confirmation p {
  margin: 0;
  font-size: 17px;
  line-height: 23px;
  color: #000;
}

/* Honeypot: hidden from people, left for bots to fill in. */
.tbs-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media screen and (max-width: 601px) {
  .tbs-form {
    padding: 10px 20px;
  }

  .tbs-confirmation {
    padding: 50px 20px;
  }
}

@media screen and (max-width: 640px) {
  .tbs-name__col {
    flex-basis: 100%;
  }
}
