/* ==========================================================================
   UPVCLeads.com — Components
   ========================================================================== */

/* ---- Button -------------------------------------------------------------
   Chamfered, not rounded — a uPVC profile has a chamfer.
   ---------------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--f-body);
  font-size: var(--t-sm);
  font-weight: 600;
  line-height: 1;
  padding: var(--s-3) var(--s-5);
  min-height: 44px;              /* thumb target */
  border: var(--mullion) solid transparent;
  border-radius: var(--r-md);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--d-fast) var(--e-out),
              border-color var(--d-fast) var(--e-out),
              color var(--d-fast) var(--e-out);
  white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn--primary {
  background: var(--c-glass);
  color: #fff;
  border-color: var(--c-glass);
}
.btn--primary:hover:not(:disabled) {
  background: var(--c-glass-deep);
  border-color: var(--c-glass-deep);
}

.btn--secondary {
  background: transparent;
  color: var(--c-ink);
  border-color: var(--c-line-strong);
}
.btn--secondary:hover:not(:disabled) {
  border-color: var(--c-ink);
  background: var(--c-surface-sunk);
}

.btn--ghost {
  background: transparent;
  color: var(--c-glass);
  padding-inline: var(--s-2);
}
.btn--ghost:hover:not(:disabled) { background: var(--c-glass-tint); }

.btn--lg { font-size: var(--t-base); padding: var(--s-4) var(--s-6); min-height: 52px; }
.btn--block { width: 100%; }


/* ---- Badge --------------------------------------------------------------
   The verified badge is the trust anchor. It links to the method page —
   a badge that can't be checked is decoration.
   ---------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s-1);
  font-family: var(--f-mono);
  font-size: var(--t-2xs);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  padding: 3px var(--s-2);
  border-radius: var(--r-sm);
  border: var(--mullion) solid;
  white-space: nowrap;
}
.badge--verified {
  color: var(--c-glass);
  background: var(--c-glass-tint);
  border-color: var(--c-glass-edge);
}
.badge--pending {
  color: var(--c-pending);
  background: var(--c-pending-tint);
  border-color: color-mix(in srgb, var(--c-pending) 35%, transparent);
}
.badge--neutral {
  color: var(--c-steel);
  background: var(--c-steel-tint);
  border-color: var(--c-line-strong);
}


/* ---- Form ---------------------------------------------------------------- */

.field { margin-bottom: var(--s-5); }

.field__label {
  display: block;
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--c-ink);
  margin-bottom: var(--s-2);
}
.field__hint {
  display: block;
  font-size: var(--t-xs);
  color: var(--c-ink-muted);
  margin-top: var(--s-2);
}
.field__error {
  display: block;
  font-size: var(--t-xs);
  color: var(--c-danger);
  margin-top: var(--s-2);
  font-weight: 500;
}

.input, .select, .textarea {
  width: 100%;
  font-family: var(--f-body);
  font-size: var(--t-base);   /* 16px — never smaller, iOS zooms below this */
  color: var(--c-ink);
  background: var(--c-surface-raised);
  border: var(--mullion) solid var(--c-line-strong);
  border-radius: var(--r-md);
  padding: var(--s-3) var(--s-4);
  min-height: 48px;
  transition: border-color var(--d-fast) var(--e-out),
              box-shadow var(--d-fast) var(--e-out);
}
.input::placeholder, .textarea::placeholder { color: var(--c-ink-faint); }

.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--c-glass);
  box-shadow: 0 0 0 3px var(--c-glass-tint);
}
.input[aria-invalid="true"] { border-color: var(--c-danger); }

.textarea { min-height: 96px; resize: vertical; padding-top: var(--s-3); }

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236A7379' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right var(--s-4) center;
  padding-right: var(--s-7);
}

/* Phone input with fixed +91 — every user here is Indian */
.field__phone { display: flex; }
.field__phone .field__cc {
  display: flex;
  align-items: center;
  padding-inline: var(--s-4);
  font-family: var(--f-mono);
  font-size: var(--t-sm);
  color: var(--c-ink-muted);
  background: var(--c-surface-sunk);
  border: var(--mullion) solid var(--c-line-strong);
  border-right: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
}
.field__phone .input {
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-family: var(--f-mono);
  letter-spacing: 0.04em;
}

/* Choice chips — used for size band, budget, timeline.
   Tapping beats typing on mobile. */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { position: relative; }
.chip input {
  position: absolute;
  opacity: 0;
  width: 100%; height: 100%;
  margin: 0; cursor: pointer;
}
.chip span {
  display: block;
  font-size: var(--t-sm);
  padding: var(--s-3) var(--s-4);
  min-height: 44px;
  display: flex;
  align-items: center;
  border: var(--mullion) solid var(--c-line-strong);
  border-radius: var(--r-md);
  background: var(--c-surface-raised);
  transition: all var(--d-fast) var(--e-out);
}
.chip input:checked + span {
  border-color: var(--c-glass);
  background: var(--c-glass-tint);
  color: var(--c-glass-deep);
  font-weight: 600;
}
.chip input:focus-visible + span {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
}


/* ---- Card ---------------------------------------------------------------- */

.card {
  background: var(--c-surface-raised);
  border: var(--mullion) solid var(--c-line);
  border-radius: var(--r-lg);
  padding: var(--s-5);
}
.card--flush { padding: 0; overflow: hidden; }

/* Firm card — the listing unit on every district page */
.firm {
  display: flex;
  gap: var(--s-4);
  padding: var(--s-5);
  border-bottom: var(--mullion) solid var(--c-line);
  transition: background var(--d-fast) var(--e-out);
}
.firm:last-child { border-bottom: 0; }
.firm:hover { background: var(--c-surface-sunk); }
.firm__mark {
  width: 48px; height: 48px;
  flex: none;
  border-radius: var(--r-md);
  background: var(--c-steel-tint);
  border: var(--mullion) solid var(--c-line);
  display: grid;
  place-items: center;
  font-family: var(--f-display);
  font-weight: 700;
  color: var(--c-steel);
}
.firm__body { flex: 1; min-width: 0; }
.firm__name {
  font-family: var(--f-display);
  font-size: var(--t-md);
  font-weight: 700;
  color: var(--c-ink);
  margin: 0 0 var(--s-1);
}
.firm__meta {
  font-size: var(--t-xs);
  color: var(--c-ink-muted);
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-1) var(--s-3);
}


/* ---- Spec table ---------------------------------------------------------
   The professional track's core artifact. Reads like a datasheet,
   because that's what an architect is actually looking for.
   ---------------------------------------------------------------------- */

.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--t-sm);
}
.spec caption {
  text-align: left;
  font-family: var(--f-mono);
  font-size: var(--t-2xs);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--c-ink-muted);
  padding-bottom: var(--s-3);
}
.spec th, .spec td {
  text-align: left;
  padding: var(--s-3) var(--s-4);
  border-bottom: var(--mullion) solid var(--c-line);
  vertical-align: top;
}
.spec th {
  font-weight: 600;
  color: var(--c-ink);
  width: 42%;
}
.spec td {
  font-family: var(--f-mono);
  font-variant-numeric: tabular-nums;
  color: var(--c-ink-body);
}
.spec tbody tr:nth-child(odd) { background: var(--c-surface-sunk); }
.spec tbody tr:last-child th, .spec tbody tr:last-child td { border-bottom: 0; }


/* ---- Audience toggle ----------------------------------------------------
   Reorders the page and tags the lead type at source.
   Not a decoration — it is the conversion mechanism.
   ---------------------------------------------------------------------- */

.toggle {
  display: inline-flex;
  padding: 3px;
  background: var(--c-surface-sunk);
  border: var(--mullion) solid var(--c-line-strong);
  border-radius: var(--r-md);
  position: relative;
}
.toggle__opt { position: relative; }
.toggle__opt input {
  position: absolute; opacity: 0;
  width: 100%; height: 100%; margin: 0; cursor: pointer;
}
.toggle__opt span {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--c-ink-muted);
  padding: var(--s-2) var(--s-4);
  min-height: 40px;
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: all var(--d-base) var(--e-out);
  white-space: nowrap;
}
.toggle__opt input:checked + span {
  background: var(--c-surface-raised);
  color: var(--c-ink);
  box-shadow: var(--sh-1);
}
.toggle__opt input:focus-visible + span {
  outline: 2px solid var(--c-focus);
  outline-offset: 1px;
}


/* ---- Side tab -----------------------------------------------------------
   Fixed right edge. Never blocks content, never times out, never pops.
   Opens a slide-over — not a modal.
   ---------------------------------------------------------------------- */

.sidetab {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: var(--z-sidetab);
  display: flex;
  align-items: center;
  gap: var(--s-2);
  writing-mode: vertical-rl;
  font-family: var(--f-body);
  font-size: var(--t-sm);
  font-weight: 600;
  color: #fff;
  background: var(--c-glass);
  border: 0;
  border-radius: var(--r-md) 0 0 var(--r-md);
  padding: var(--s-5) var(--s-3);
  cursor: pointer;
  box-shadow: var(--sh-2);
  transition: background var(--d-fast) var(--e-out);
}
.sidetab:hover { background: var(--c-glass-deep); }
.sidetab svg { transform: rotate(90deg); }
@media (max-width: 720px) { .sidetab { display: none; } }

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 26, 0.55);
  z-index: var(--z-overlay);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--d-base) var(--e-out), visibility var(--d-base);
}
.overlay[data-open="true"] { opacity: 1; visibility: visible; }

.panel {
  position: fixed;
  top: 0; right: 0;
  height: 100dvh;
  width: min(440px, 100vw);
  background: var(--c-surface-raised);
  border-left: var(--mullion) solid var(--c-line);
  z-index: var(--z-panel);
  transform: translateX(100%);
  transition: transform var(--d-slow) var(--e-out);
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-3);
}
.panel[data-open="true"] { transform: translateX(0); }

@media (max-width: 720px) {
  .panel {
    width: 100vw;
    height: 92dvh;
    top: auto; bottom: 0;
    border-left: 0;
    border-top: var(--mullion) solid var(--c-line);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    transform: translateY(100%);
  }
  .panel[data-open="true"] { transform: translateY(0); }
}

.panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-5);
  border-bottom: var(--mullion) solid var(--c-line);
  flex: none;
}
.panel__body { flex: 1; overflow-y: auto; padding: var(--s-5); }
.panel__foot {
  flex: none;
  padding: var(--s-5);
  border-top: var(--mullion) solid var(--c-line);
  background: var(--c-surface);
}
.panel__close {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  background: transparent;
  border: var(--mullion) solid var(--c-line-strong);
  border-radius: var(--r-md);
  color: var(--c-ink-muted);
  cursor: pointer;
}
.panel__close:hover { background: var(--c-surface-sunk); color: var(--c-ink); }

/* Step progress — three screens, always. Shows where you are and
   how much is left, because unknown length kills form completion. */
.steps {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.steps__dot {
  height: 3px;
  flex: 1;
  background: var(--c-line);
  border-radius: var(--r-pill);
  transition: background var(--d-base) var(--e-out);
}
.steps__dot[data-state="done"], .steps__dot[data-state="active"] {
  background: var(--c-glass);
}


/* ---- Sticky mobile CTA --------------------------------------------------
   Thumb zone. Desktop gets the side tab instead.
   ---------------------------------------------------------------------- */

.stickybar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: var(--z-sticky);
  display: none;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-4);
  padding-bottom: calc(var(--s-3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--c-surface-raised) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: var(--mullion) solid var(--c-line);
}
@media (max-width: 720px) { .stickybar { display: flex; } }
.stickybar .btn { flex: 1; }
.stickybar .btn--secondary { flex: none; width: 52px; padding: 0; }


/* ---- Toast --------------------------------------------------------------- */

.toast {
  position: fixed;
  bottom: var(--s-5);
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: var(--z-toast);
  background: var(--c-ink);
  color: #fff;
  font-size: var(--t-sm);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--r-md);
  box-shadow: var(--sh-3);
  transition: transform var(--d-base) var(--e-out);
}
.toast[data-open="true"] { transform: translateX(-50%) translateY(0); }


/* ---- Empty state --------------------------------------------------------
   No fake data, ever. An empty district says so, and offers the action.
   ---------------------------------------------------------------------- */

.empty {
  text-align: center;
  padding: var(--s-7) var(--s-5);
  border: 1px dashed var(--c-line-strong);
  border-radius: var(--r-lg);
  background: var(--c-surface-sunk);
}
.empty h3 { margin-bottom: var(--s-2); }
.empty p { color: var(--c-ink-muted); font-size: var(--t-sm); }
