/* TopHelpers Company Registration — style.css */

:root {
  --thcr-primary:      #8F3985;
  --thcr-secondary:    #0D3659;
  --thcr-field-bg:     #F5F5F9;
  --thcr-placeholder:  #AEAEAE;
  --thcr-error:        #DC2626;
  --thcr-radius:       12px;
  --thcr-transition:   150ms ease;
}

/* ── Wrapper / title ─────────────────────────────────────────────── */

#thcr-wrap {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
  font-family: Inter, sans-serif;
  color: var(--thcr-secondary);
}

.thcr-title {
  text-align: center;
  font-size: 40px;
  font-weight: 700;
  color: var(--thcr-secondary);
  margin: 0 0 35px;
  line-height: 1.2;
}

/* ── Card ────────────────────────────────────────────────────────── */

.thcr-card {
  background: #fff;
  border-radius: 24px;
  padding: 50px;
  box-shadow: 0 20px 60px rgba(13, 54, 89, 0.07);
}

/* ── Top bar: breadcrumb + stepper ───────────────────────────────── */

.thcr-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 40px;
}

.thcr-breadcrumb {
  font-size: 16px;
  font-weight: 600;
}

.thcr-breadcrumb__root { color: var(--thcr-secondary); }
.thcr-breadcrumb__sep  { color: var(--thcr-placeholder); margin: 0 8px; }
.thcr-breadcrumb__current { color: var(--thcr-primary); }

.thcr-stepper {
  display: flex;
  align-items: center;
}

.thcr-stepper__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
  background: #fff;
  border: 2px solid #E2E2EC;
  color: var(--thcr-placeholder);
  transition: all var(--thcr-transition);
}

.thcr-stepper__dot--active {
  background: var(--thcr-primary);
  border-color: var(--thcr-primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(143, 57, 133, 0.15);
}

.thcr-stepper__dot--done {
  background: var(--thcr-primary);
  border-color: var(--thcr-primary);
  color: #fff;
  box-shadow: none;
}

.thcr-stepper__line {
  width: 90px;
  height: 2px;
  background: #E2E2EC;
  margin: 0 4px;
}

/* ── Steps / sections ────────────────────────────────────────────── */

.thcr-step[hidden] { display: none; }

.thcr-section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--thcr-secondary);
  margin: 0 0 25px;
}

.thcr-section-title + .thcr-section-subtitle { margin-top: -18px; }

.thcr-section-subtitle {
  font-size: 15px;
  color: #6B7280;
  margin: 0 0 25px;
}

.thcr-grid + .thcr-section-title { margin-top: 45px; }

/* ── Fields ──────────────────────────────────────────────────────── */

.thcr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 25px 30px;
}

.thcr-grid--3 {
  grid-template-columns: 1fr 1fr 1fr;
  margin-top: 25px;
}

/* In the 3-col row labels may differ in height — keep inputs aligned. */
.thcr-grid--3 .thcr-field {
  display: flex;
  flex-direction: column;
}
.thcr-grid--3 .thcr-field .thcr-label {
  flex: 1;
  min-height: 2.6em; /* two lines at 1.3 line-height */
}

.thcr-field {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* A .thcr-field sets display:flex, which would override the [hidden] attribute —
   restore hiding for conditional fields (truck details, CPUC number). */
.thcr-field[hidden] { display: none; }

.thcr-truck-info { margin-top: 20px; }
.thcr-truck-info .thcr-textarea { min-height: 150px; }

.thcr-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--thcr-secondary);
  margin-bottom: 10px;
  line-height: 1.3;
}

.thcr-label--inline { margin-bottom: 0; }

.thcr-optional {
  color: var(--thcr-placeholder);
  font-weight: 500;
}

/* ── Inputs ──────────────────────────────────────────────────────── */

.thcr-input {
  width: 100%;
  height: 56px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--thcr-radius);
  background: var(--thcr-field-bg);
  font-size: 15px;
  font-weight: 500;
  color: var(--thcr-secondary);
  outline: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: box-shadow var(--thcr-transition);
}

.thcr-input::placeholder { color: var(--thcr-placeholder); font-weight: 500; }

.thcr-input:focus { box-shadow: 0 0 0 2px rgba(143, 57, 133, 0.25); }

.thcr-input--error { box-shadow: inset 0 0 0 1.5px var(--thcr-error); }

/* Right-pointing chevron for dropdowns (matches design) */
.thcr-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='14' viewBox='0 0 8 14'%3E%3Cpath fill='none' stroke='%230D3659' stroke-width='2' stroke-linecap='round' d='M1 1l6 6-6 6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  padding-right: 42px;
  cursor: pointer;
}

/* ── Searchable dropdown (State / City) ─────────────────────────────── */

.thcr-searchdrop { position: relative; }

.thcr-searchdrop__box {
  display: flex;
  align-items: center;
  cursor: text;
  padding: 0 16px;
}

.thcr-searchdrop__input {
  flex: 1;
  min-width: 0;
  height: 56px;
  background: transparent;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--thcr-secondary);
  font-family: inherit;
}

.thcr-searchdrop__input::placeholder { color: var(--thcr-placeholder); font-weight: 400; }
.thcr-searchdrop__input:disabled { cursor: not-allowed; }

.thcr-searchdrop__chevron {
  flex-shrink: 0;
  color: var(--thcr-secondary);
  opacity: 0.5;
  transition: transform 0.2s;
  pointer-events: none;
}

.thcr-searchdrop.is-open .thcr-searchdrop__chevron { transform: rotate(180deg); }

.thcr-searchdrop--disabled .thcr-searchdrop__box { opacity: 0.5; cursor: not-allowed; }

.thcr-searchdrop__panel {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border-radius: var(--thcr-radius);
  box-shadow: 0 12px 35px rgba(13, 54, 89, 0.15);
  max-height: 220px;
  overflow-y: auto;
}

.thcr-searchdrop__panel[hidden] { display: none; }

.thcr-searchdrop__item {
  padding: 11px 16px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--thcr-secondary);
  transition: background 0.15s;
}

.thcr-searchdrop__item:hover,
.thcr-searchdrop__item.is-active { background: var(--thcr-field-bg); }

.thcr-searchdrop__empty {
  padding: 11px 16px;
  font-size: 14px;
  color: var(--thcr-placeholder);
}

.thcr-textarea {
  height: auto;
  padding: 16px 18px;
  resize: vertical;
  line-height: 1.5;
}

/* ── Multi-select (Service Offerings) ────────────────────────────── */

.thcr-multiselect { position: relative; }

.thcr-multiselect__toggle {
  display: flex;
  align-items: center;
  text-align: left;
}

.thcr-multiselect__text {
  color: var(--thcr-secondary);
  font-weight: 500;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thcr-multiselect__text.thcr-placeholder { color: var(--thcr-placeholder); }

.thcr-multiselect__panel {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  background: #fff;
  border-radius: var(--thcr-radius);
  box-shadow: 0 12px 35px rgba(13, 54, 89, 0.15);
  border: 1px solid #EEE;
  padding: 8px;
  max-height: 240px;
  overflow-y: auto;
}

.thcr-multiselect__panel[hidden] { display: none; }

.thcr-multiselect__option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--thcr-secondary);
  cursor: pointer;
}

.thcr-multiselect__option:hover { background: var(--thcr-field-bg); }

.thcr-multiselect__option input {
  width: 17px;
  height: 17px;
  accent-color: var(--thcr-primary);
  cursor: pointer;
}

/* ── Own-truck / radio rows ──────────────────────────────────────── */

.thcr-truck {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px 28px;
  margin-top: 30px;
}

.thcr-radio-group { display: flex; gap: 28px; }

.thcr-radio-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  color: var(--thcr-secondary);
  cursor: pointer;
}

.thcr-radio {
  width: 18px;
  height: 18px;
  accent-color: var(--thcr-primary);
  cursor: pointer;
}

/* ── Checkbox / terms ────────────────────────────────────────────── */

.thcr-terms { margin-top: 25px; }

.thcr-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--thcr-secondary);
  cursor: pointer;
  line-height: 1.5;
}

.thcr-checkbox {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--thcr-primary);
  cursor: pointer;
}

.thcr-link { color: var(--thcr-primary); text-decoration: underline; }

/* ── Error & hint ────────────────────────────────────────────────── */

.thcr-error {
  font-size: 12px;
  color: var(--thcr-error);
  margin-top: 5px;
  min-height: 14px;
}

.thcr-error:empty { min-height: 0; }

.thcr-hint { font-size: 12px; color: #6B7280; margin-top: 5px; }

/* ── Navigation ──────────────────────────────────────────────────── */

.thcr-nav {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  margin-top: 45px;
}

.thcr-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 56px;
  padding: 0 34px;
  border: none;
  border-radius: var(--thcr-radius);
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background var(--thcr-transition), color var(--thcr-transition);
}

.thcr-btn[hidden] { display: none; }

.thcr-btn--next { background: var(--thcr-primary); color: #fff; }
.thcr-btn--next:hover { background: var(--thcr-secondary); }
.thcr-btn--next:disabled { background: #D1D5DB; cursor: not-allowed; }

.thcr-btn--back { background: #EAF1EF; color: var(--thcr-secondary); }
.thcr-btn--back:hover { background: #dbe7e3; }

/* ── API error banner ────────────────────────────────────────────── */

.thcr-api-error {
  margin-top: 24px;
  padding: 14px 16px;
  border-radius: var(--thcr-radius);
  background: #FEF2F2;
  border: 1px solid #FECACA;
  color: var(--thcr-error);
  font-size: 14px;
  line-height: 1.5;
}

.thcr-api-error[hidden] { display: none; }

/* ── Success ─────────────────────────────────────────────────────── */

.thcr-success[hidden] { display: none; }

.thcr-success {
  display: flex;
  flex-direction: column;
  max-width: 580px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #DDD;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(13, 54, 89, 0.08);
}

/* Logo strip */
.thcr-success__logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 24px;
  border-bottom: 1px solid #DDD;
}
.thcr-success__logo { display: block; max-width: 180px; height: auto; }
.thcr-success__site-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--thcr-secondary);
}

/* Content */
.thcr-success__body {
  display: grid;
  gap: 20px;
  padding: 36px 30px;
  text-align: center;
  color: var(--thcr-secondary);
}
.thcr-success__line { font-size: 16px; margin: 0; line-height: 1.55; }
.thcr-success__line--bold { font-weight: 600; }

.thcr-success__received {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 600;
  color: var(--thcr-secondary);
  margin: 0;
}

.thcr-success__smile {
  display: block;
  margin: 4px auto 0;
}

/* Footer strip */
.thcr-success__footer {
  padding: 26px 24px;
  background: #F9F9F9;
  display: flex;
  justify-content: center;
}
.thcr-success__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 32px;
  background: var(--thcr-primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  transition: background var(--thcr-transition);
}
.thcr-success__btn:hover { background: var(--thcr-secondary); color: #fff; }

/* ── Step 2 · Licenses ───────────────────────────────────────────── */

.thcr-mt    { margin-top: 12px; }
.thcr-mt-lg { margin-top: 35px; }

/* "Learn more" + CPUC input on the same row */
.thcr-cpuc-row {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-top: 12px;
}
/* "Learn more" link — fills remaining space, pushes CPUC card to the right */
.thcr-cpuc-row__left  { flex: 1; min-width: 0; }
/* CPUC card — same width as one insurance card column (50% minus half the 30px gap) */
.thcr-cpuc-row__right { flex: 0 0 calc(50% - 15px); min-width: 0; }
.thcr-cpuc-row__right[hidden] { display: none; }

/* Gray "license" card (CPUC question, insurance rows, DOT/CA) */
.thcr-license {
  background: var(--thcr-field-bg);
  border-radius: var(--thcr-radius);
  padding: 16px 20px;
}

.thcr-license__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.thcr-license__label {
  font-size: 15px;
  font-weight: 500;
  color: var(--thcr-secondary);
  line-height: 1.35;
}

/* When paired with a text input (not radio), label keeps natural width */
.thcr-license__row:has(.thcr-license__input) .thcr-license__label {
  flex-shrink: 0;
}

/* "Upload" button */
.thcr-upload-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 10px 28px;
  background: #E7ECF3;
  color: var(--thcr-secondary);
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background var(--thcr-transition);
}
.thcr-upload-btn:hover { background: #d9e1ec; }

/* Inline input (CPUC / DOT / CA#) — fills right side of the row, value right-aligned */
.thcr-license__input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  font-size: 15px;
  font-weight: 500;
  color: var(--thcr-secondary);
  outline: none;
  text-align: right;
}
.thcr-license__input::placeholder { color: var(--thcr-placeholder); font-weight: 400; text-align: left; }
.thcr-license__input:focus { box-shadow: 0 0 0 1.5px rgba(143, 57, 133, 0.45); }

/* Selected-file chip inside the card */
.thcr-license__file {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid #E7E7EF;
  border-radius: 8px;
}
.thcr-license__file[hidden] { display: none; }
.thcr-license__file-icon { flex-shrink: 0; }
.thcr-license__file-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  color: var(--thcr-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.thcr-license__file-remove {
  flex-shrink: 0;
  display: inline-flex;
  border: 0;
  background: none;
  color: #9A9AA8;
  cursor: pointer;
  padding: 2px;
}
.thcr-license__file-remove:hover { color: var(--thcr-error); }

/* Licenses grid — two columns, items aligned to top so "Learn more" sits under each */
.thcr-grid--licenses {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 30px;
  align-items: start;
}
.thcr-license-cell { min-width: 0; }

/* "Learn more" link + tooltip */
.thcr-learnmore {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 18px;
  color: var(--thcr-primary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.thcr-learnmore__icon { display: inline-flex; flex-shrink: 0; }
.thcr-learnmore__text { text-decoration: underline; }

.thcr-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 10;
  width: 320px;
  max-width: 80vw;
  padding: 16px 18px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(13, 54, 89, 0.18);
  color: #4E4E4E;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.55;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity var(--thcr-transition), transform var(--thcr-transition), visibility var(--thcr-transition);
}
.thcr-tooltip strong { display: block; color: var(--thcr-secondary); margin-bottom: 6px; }
.thcr-tooltip p { margin: 0 0 8px; }
.thcr-tooltip p:last-child { margin-bottom: 0; }
.thcr-tooltip a { color: var(--thcr-primary); text-decoration: underline; }

.thcr-learnmore:hover .thcr-tooltip,
.thcr-learnmore:focus .thcr-tooltip,
.thcr-learnmore:focus-within .thcr-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Terms scroll box */
.thcr-terms-box {
  height: 230px;
  overflow-y: auto;
  padding: 18px 24px;
  background: var(--thcr-field-bg);
  border-radius: var(--thcr-radius);
  color: #9A9AA8;
  font-size: 14px;
  line-height: 1.65;
}
.thcr-terms-box p { margin: 0 0 14px; }
.thcr-terms-box p:last-child { margin-bottom: 0; }

/* ── Responsive ──────────────────────────────────────────────────── */

@media (max-width: 640px) {
  .thcr-title { font-size: 30px; }
  .thcr-card { padding: 25px; border-radius: 18px; }
  .thcr-grid,
  .thcr-grid--3,
  .thcr-grid--licenses { grid-template-columns: 1fr; }
  .thcr-stepper__line { width: 50px; }
  .thcr-nav { justify-content: stretch; }
  .thcr-btn { flex: 1; justify-content: center; padding: 0 20px; }
  .thcr-tooltip { width: 280px; }
}
