/* ============================================
   TB LEAD FORM — the four-screen contact form
   Shared by /, /services and /contact so the three
   copies can never drift apart again.
   Tokens come from styles/base.css; nothing here
   invents a colour or a font.
   ============================================ */

.tblf {
  --tblf-ring: rgba(44, 152, 217, 0.16);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: 0 10px 30px rgba(65, 92, 118, 0.08);
  container-type: inline-size;
}

@media (max-width: 480px) {
  .tblf { padding: 20px 16px; }
}

/* ── Progress ─────────────────────────────── */
.tblf-progress { margin-bottom: 22px; }

.tblf-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 10px;
}

.tblf-step-label {
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--color-accent);
  letter-spacing: 0.02em;
}

.tblf-step-count {
  font-size: var(--text-small);
  color: var(--color-text-light);
}

.tblf-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--color-bg-lighter);
  overflow: hidden;
}

.tblf-bar span {
  display: block;
  height: 100%;
  width: 25%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  transition: width 0.45s var(--ease-out);
}

/* ── Screens ──────────────────────────────── */
/* Each screen is a <section>, and the site's base.css gives every section a
   72px vertical padding for page bands. Scoped off here, or the card opens with
   an empty half-screen above the first question. */
.tblf-screen { display: none; padding: 0; margin: 0; }
.tblf-screen.is-active { display: block; animation: tblf-in 0.35s var(--ease-out) both; }

@keyframes tblf-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .tblf-screen.is-active { animation: none; }
  .tblf-bar span { transition: none; }
}

.tblf-screen h3 {
  font-size: var(--text-h3);
  margin-bottom: 4px;
}

.tblf-sub {
  font-size: var(--text-small);
  color: var(--color-text-light);
  margin-bottom: 20px;
}

/* ── Fields ───────────────────────────────── */
.tblf fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }

.tblf-field { margin-bottom: 20px; }
.tblf-field:last-of-type { margin-bottom: 0; }

.tblf-field > label,
.tblf-legend {
  display: block;
  font-size: var(--text-small);
  font-weight: 700;
  color: var(--color-heading);
  margin-bottom: 8px;
}

.tblf-hint {
  font-weight: 400;
  color: var(--color-text-light);
}

.tblf input[type="text"],
.tblf input[type="email"],
.tblf input[type="tel"],
.tblf select,
.tblf textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--text-body);
  color: var(--color-body);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.tblf select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2387909e' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

.tblf input:focus,
.tblf select:focus,
.tblf textarea:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px var(--tblf-ring);
}

.tblf textarea { resize: vertical; min-height: 96px; }

.tblf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@container (max-width: 420px) {
  .tblf-row { grid-template-columns: 1fr; }
}

/* ── Option cards (radio / checkbox) ──────── */
.tblf-options {
  display: grid;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0;
}

.tblf-options--2col { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@container (max-width: 420px) {
  .tblf-options--2col { grid-template-columns: 1fr; }
}

.tblf-opt {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  font-size: var(--text-small);
  color: var(--color-body);
  line-height: 1.35;
  transition: border-color 0.18s, background 0.18s, box-shadow 0.18s;
}

.tblf-opt:hover { border-color: var(--color-bg-sky); background: var(--color-bg-light); }

.tblf-opt input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.tblf-mark {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--color-bg-sky);
  background: #fff;
  display: grid;
  place-items: center;
  transition: border-color 0.18s, background 0.18s;
}

.tblf-opt--radio .tblf-mark { border-radius: 50%; }
.tblf-opt--check .tblf-mark { border-radius: 5px; }

.tblf-mark::after {
  content: "";
  opacity: 0;
  transition: opacity 0.18s;
}

.tblf-opt--radio .tblf-mark::after {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.tblf-opt--check .tblf-mark::after {
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}

.tblf-opt:has(input:checked) {
  border-color: var(--color-accent);
  background: var(--color-bg-light);
  box-shadow: 0 0 0 3px var(--tblf-ring);
}

.tblf-opt:has(input:checked) .tblf-mark {
  border-color: var(--color-accent);
  background: var(--color-accent);
}

.tblf-opt:has(input:checked) .tblf-mark::after { opacity: 1; }
.tblf-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: 2px; }

/* ── Errors ───────────────────────────────── */
.tblf-error {
  display: none;
  font-size: var(--text-small);
  color: #b4443a;
  margin-top: 8px;
}

.tblf-error.is-shown { display: block; }

/* ── Actions ──────────────────────────────── */
.tblf-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
}

.tblf-btn {
  font-family: inherit;
  font-size: var(--text-body);
  font-weight: 700;
  padding: 13px 28px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s, opacity 0.2s;
}

.tblf-btn--next {
  background: var(--color-primary);
  color: #fff;
  margin-left: auto;
}

.tblf-btn--next:hover { background: var(--color-primary-hover); }
.tblf-btn--next[disabled] { opacity: 0.45; cursor: not-allowed; }

.tblf-btn--back {
  background: transparent;
  color: var(--color-text-light);
  border: 1px solid var(--color-border);
  padding: 13px 20px;
}

.tblf-btn--back:hover { color: var(--color-heading); border-color: var(--color-bg-sky); }
.tblf-btn--back[hidden] { display: none; }

.tblf-reassure {
  font-size: 13px;
  color: var(--color-text-light);
  margin-top: 14px;
  text-align: center;
}

/* ── Success ──────────────────────────────── */
.tblf-done {
  display: none;
  text-align: center;
  padding: 44px 20px;
}

.tblf-done.is-shown { display: block; animation: tblf-in 0.4s var(--ease-out) both; }
.tblf-done h3 { color: var(--color-accent); margin-bottom: 10px; }
.tblf-done p { color: var(--color-text-light); }

.tblf-tick {
  width: 54px;
  height: 54px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: var(--color-bg-light);
  display: grid;
  place-items: center;
  color: var(--color-accent);
}

.tblf-tick svg { width: 26px; height: 26px; }

/* ── No-JS fallback ───────────────────────── */
.tblf-nojs {
  padding: 8px 0;
  font-size: var(--text-body);
}

.tblf-nojs a { color: var(--color-accent); font-weight: 700; }
