/* ───────────────────────────────────────────────────────────────
   Start Your Project — form styles.
   Relies on the design tokens already defined in :root in style.css
   (--rust-accent, --timber-bark, --cream-canvas, etc.), so it stays
   in sync with your brand automatically. Load this AFTER style.css.
   ─────────────────────────────────────────────────────────────── */

.start-section {
  background: var(--light-sage);
  /* Clear the fixed 72px nav (matches the offset your legal pages use). */
  padding-top: 120px;
}

.start-section .sp-shell {
  max-width: 760px;
}

.sp-form {
  margin-top: 40px;
  background: var(--white-clean);
  border: 1px solid rgba(181, 164, 146, 0.3);
  border-radius: 4px;
  padding: clamp(28px, 4vw, 44px);
  box-shadow: 0 12px 40px rgba(44, 26, 14, 0.06);
}

.sp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.sp-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.sp-field-full {
  margin-top: 22px;
}

.sp-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--timber-bark);
}

.sp-req {
  color: var(--rust-accent);
}

.sp-optional {
  font-weight: 400;
  font-size: 0.85em;
  opacity: 0.6;
}

.sp-input,
.sp-textarea {
  width: 100%;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  color: var(--charcoal-ink);
  background: var(--cream-canvas);
  border: 1px solid rgba(181, 164, 146, 0.5);
  border-radius: 4px;
  padding: 12px 14px;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  appearance: none;
}

.sp-textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
}

.sp-input::placeholder,
.sp-textarea::placeholder {
  color: var(--warm-stone);
}

.sp-input:focus,
.sp-textarea:focus {
  outline: none;
  background: var(--white-clean);
  border-color: var(--rust-accent);
  box-shadow: 0 0 0 3px rgba(166, 75, 42, 0.12);
}

select.sp-input {
  cursor: pointer;
  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 fill='%23B5A492' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* Submit button reuses .btn-primary from style.css; these are just the
   resets a <button> needs (vs. the <a> the class was written for). */
.sp-submit {
  margin-top: 28px;
  border: none;
  cursor: pointer;
  font-size: 14px;
}

.sp-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.sp-error {
  margin-top: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: #b23b2e;
}

.sp-error:empty {
  display: none;
}

/* Success state */
.sp-success {
  margin-top: 40px;
  background: var(--white-clean);
  border: 1px solid rgba(181, 164, 146, 0.3);
  border-left: 4px solid var(--golden-grain);
  border-radius: 4px;
  padding: clamp(28px, 4vw, 44px);
}

.sp-success h3 {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--timber-bark);
  margin-bottom: 10px;
  line-height: 1.2;
}

.sp-success p {
  font-family: 'Inter', sans-serif;
  font-size: 16px;
  color: #5c4f44;
  line-height: 1.65;
  margin-bottom: 20px;
}

/* Honeypot — hidden from people, never focusable. Do not remove. */
.sp-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 700px) {
  .sp-grid { grid-template-columns: 1fr; gap: 18px; }
  .sp-field-full { margin-top: 18px; }
  .sp-submit { width: 100%; justify-content: center; }
}


/* ─── PAGE LOAD ANIMATIONS ─── */

/* Base state — everything starts invisible */
.sp-animate {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
              transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-animate.sp-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered delays for sequential reveal */
.sp-delay-1 { transition-delay: 0.05s; }
.sp-delay-2 { transition-delay: 0.15s; }
.sp-delay-3 { transition-delay: 0.28s; }
.sp-delay-4 { transition-delay: 0.42s; }
.sp-delay-5 { transition-delay: 0.58s; }

/* Nav fades in from top */
@keyframes navSlideDown {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}

nav {
  animation: navSlideDown 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Overline line draws in left to right */
@keyframes lineGrow {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

.section-overline::before {
  transform-origin: left center;
  animation: lineGrow 0.5s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

/* Form card lifts in with slight scale */
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(32px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.sp-form {
  animation: cardReveal 0.8s cubic-bezier(0.22, 1, 0.36, 1) 0.55s both;
}

/* Form fields cascade in. The stagger delay is applied per field by
   start-project.js (via an inline animation-delay + the .sp-reveal class) so
   the cascade replays correctly each time a step of the form is shown —
   instead of running once on page load and looking static afterward. */
.sp-field.sp-reveal {
  animation: cardReveal 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Respect user preference */
@media (prefers-reduced-motion: reduce) {
  nav, .sp-form, .sp-field, .sp-field.sp-reveal,
  .section-overline::before {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .sp-animate { opacity: 1; transform: none; transition: none; }
}


/* ─── SALESPERSON PICKER (main lead forms only) ─── */

/* "Do you have a salesperson?" toggle */
.sp-rep-field { margin-top: 22px; }

.sp-rep-toggle {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  cursor: pointer;
  user-select: none;
}

.sp-rep-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--rust-accent);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.sp-rep-toggle span {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--charcoal-ink);
}

/* The list of people (hidden until the box is checked) */
.sp-rep-picker {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
  max-width: 440px;
}

.sp-rep-picker.open { display: flex; }

/* Each selectable person */
.sp-rep-option {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 16px;
  background: var(--white-clean);
  border: 1px solid rgba(181, 164, 146, 0.45);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease,
              box-shadow 0.18s ease, transform 0.18s ease;
}

.sp-rep-option:hover {
  border-color: var(--rust-accent);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(44, 26, 14, 0.09);
}

.sp-rep-option.selected {
  border-color: var(--rust-accent);
  background: var(--cream-canvas);
  box-shadow: 0 0 0 3px rgba(166, 75, 42, 0.14);
}

/* Circular photo — matches the dedicated rep pages */
.sp-rep-photo {
  order: 1;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--white-clean);
  box-shadow: 0 2px 8px rgba(44, 26, 14, 0.16);
  background: var(--warm-stone);
}

.sp-rep-name {
  order: 2;
  flex: 1;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--charcoal-ink);
}

/* Radio sits at the right, regardless of DOM order */
.sp-rep-option input {
  order: 3;
  width: 18px;
  height: 18px;
  accent-color: var(--rust-accent);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}

.sp-rep-note {
  margin: 0;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--warm-stone);
}
