/* ============================================================================
   TB15 Homepage Lead Form (v1.0.84)
   Self-contained .sg-lead namespace. Cream-on-section card, gold focus (TB3),
   gold submit with press feedback, RTL-native, mobile stacks at <=600px.
   Does NOT share styles with the partnership form (.sg-plead) — independent.
   ============================================================================ */

.sg-lead {
  background: var(--sg-cream, #FAF8F5);
  padding: clamp(40px, 6vw, 72px) 0;
  border-block-start: 1px solid var(--color-border, #ECE3D8);
  /* Anchor jumps (e.g. a future "contact" link) clear the sticky header. */
  scroll-margin-block-start: 96px;
}

.sg-lead__inner {
  max-width: 760px;
}

.sg-lead__head {
  text-align: center;
  margin-block-end: 28px;
}

.sg-lead__title {
  font-size: clamp(1.6rem, 3.5vw, 2.1rem);
  font-weight: 800;
  color: var(--sg-brown, #3D2C1E);
  margin: 0 0 8px;
}

.sg-lead__sub {
  color: var(--sg-text-muted, #5b6b80);
  font-size: 1.02rem;
  line-height: 1.6;
  max-width: 560px;
  margin-inline: auto;
}

/* Form sits on a white card to lift it off the cream section background. */
.sg-lead__form {
  background: #fff;
  border: 1px solid var(--color-border, #ECE3D8);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(61, 44, 30, 0.08);
  padding: clamp(20px, 4vw, 32px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sg-lead__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.sg-lead__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--sg-text, #3D2C1E);
}

.sg-lead__field > span i {
  color: var(--sg-gold-dark, #A88A5C);
  font-style: normal;
}

.sg-lead__field input,
.sg-lead__field select,
.sg-lead__field textarea {
  font: inherit;
  font-weight: 500;
  color: var(--sg-text, #3D2C1E);
  background: #fff;
  border: 1px solid var(--color-border, #ECE3D8);
  border-radius: 6px;            /* TB12 radius unity */
  padding: 11px 13px;
  width: 100%;
  transition: border-color .18s ease, box-shadow .18s ease;
}

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

/* TB3 gold focus system — ring + gold border on focus. */
.sg-lead__field input:focus,
.sg-lead__field select:focus,
.sg-lead__field textarea:focus {
  outline: none;
  border-color: var(--sg-gold, var(--sg-gold,#C9A24B));
  box-shadow: var(--sg-focus-shadow, 0 0 0 3px rgba(197, 165, 114, 0.28));
}

/* Per-field error state + inline hint. */
.sg-lead__field.has-error input,
.sg-lead__field.has-error select,
.sg-lead__field.has-error textarea {
  border-color: #c0392b;
}
.sg-lead__field.has-error input:focus,
.sg-lead__field.has-error textarea:focus {
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.18);
}
.sg-lead__hint {
  display: none;
  font-style: normal;
  font-weight: 600;
  font-size: 0.8rem;
  color: #c0392b;
}
.sg-lead__field.has-error .sg-lead__hint {
  display: block;
}

/* Honeypot — still in the DOM for bots, but hidden with the bulletproof
   visually-hidden clip pattern (NOT left:-9999px, which leaked 9999px of
   horizontal scroll on pages that don't clip overflow-x, e.g. the homepage). */
.sg-lead__hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.sg-lead__error {
  background: #fdecea;
  color: #b3261e;
  border: 1px solid #f5c6c0;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 0.92rem;
  font-weight: 600;
}

/* Gold submit with TB3-style press feedback. */
.sg-lead__submit {
  align-self: flex-start;
  font: inherit;
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  background: var(--sg-gold, var(--sg-gold,#C9A24B));
  border: 0;
  border-radius: 8px;
  padding: 14px 40px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(197, 165, 114, 0.36);
  transition: background .2s ease, transform .12s ease, box-shadow .2s ease;
}
.sg-lead__submit:hover:not([disabled]) {
  background: var(--sg-gold-dark, #A88A5C);
  transform: translateY(-2px);
  box-shadow: 0 9px 20px rgba(168, 138, 92, 0.42);
}
.sg-lead__submit:active:not([disabled]) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 3px 8px rgba(168, 138, 92, 0.36);
}
.sg-lead__submit:focus-visible {
  outline: none;
  box-shadow: var(--sg-focus-shadow, 0 0 0 3px rgba(197, 165, 114, 0.28)), 0 6px 16px rgba(197, 165, 114, 0.36);
}
.sg-lead__submit[disabled] {
  opacity: 0.6;
  cursor: default;
}

.sg-lead__privacy {
  margin: 0;
  font-size: 0.82rem;
  color: var(--sg-text-muted, #5b6b80);
}

/* Success state replaces the form. */
.sg-lead__success {
  text-align: center;
  background: #fff;
  border: 1px solid var(--color-border, #ECE3D8);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(61, 44, 30, 0.08);
  padding: clamp(32px, 6vw, 56px) 24px;
}
.sg-lead__check {
  width: 68px;
  height: 68px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--color-success, #10B981);
  color: #fff;
  font-size: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: sg-lead-pop 380ms cubic-bezier(0.34, 1.4, 0.64, 1);
}
.sg-lead__success h3 {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--sg-brown, #3D2C1E);
  margin: 0 0 8px;
}
.sg-lead__success p {
  color: var(--sg-text-muted, #5b6b80);
  margin: 0;
}
@keyframes sg-lead-pop { from { transform: scale(0); } to { transform: scale(1); } }

[data-lead-form][hidden],
[data-lead-success][hidden],
[data-lead-error][hidden] { display: none; }

/* Mobile: stack the 2-col rows + full-width submit. */
@media (max-width: 600px) {
  .sg-lead__row { grid-template-columns: 1fr; }
  .sg-lead__submit { align-self: stretch; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  .sg-lead__check { animation: none; }
  .sg-lead__submit,
  .sg-lead__field input,
  .sg-lead__field select,
  .sg-lead__field textarea { transition: none; }
}
