/* ============================================================
   FORM.CSS — Formulario multi-step de profiling de leads
   ============================================================ */

/* ── Container externo ──────────────────────────────────────── */
.lead-form-section {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  position: relative;
  overflow: hidden;
}

.lead-form-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.04) 0%, transparent 70%);
  pointer-events: none;
}

.lead-form-wrap {
  max-width: 680px;
  margin-inline: auto;
  background: #fff;
  border-radius: var(--radius-2xl);
  padding: var(--space-10);
  box-shadow: var(--shadow-2xl);
  position: relative;
  z-index: 1;
}

@media (max-width: 640px) {
  .lead-form-wrap {
    padding: var(--space-6);
    border-radius: var(--radius-xl);
  }
}

/* ── Cabecalho do formulario ────────────────────────────────── */
.form-header {
  text-align: center;
  margin-bottom: var(--space-8);
}

.form-header__icon {
  width: 64px;
  height: 64px;
  background: var(--color-primary-bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  margin-bottom: var(--space-4);
}

.form-header__icon svg {
  width: 32px;
  height: 32px;
  color: var(--color-primary);
}

.form-header__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-2);
  font-family: var(--font-heading);
}

.form-header__subtitle {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

/* ── Indicador de steps ─────────────────────────────────────── */
.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: var(--space-8);
}

.step-dot {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  transition:
    background var(--transition-base),
    border-color var(--transition-base),
    color var(--transition-base);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step-dot.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.step-dot.completed {
  background: var(--color-success);
  border-color: var(--color-success);
  color: #fff;
}

.step-dot.completed::after {
  content: '';
  position: absolute;
  width: 10px;
  height: 6px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translateY(-1px);
}

.step-dot.completed span { display: none; }

.step-line {
  flex: 1;
  height: 2px;
  background: var(--color-border);
  max-width: 80px;
  transition: background var(--transition-base);
  margin: 0 -1px;
}

.step-line.completed {
  background: var(--color-success);
}

/* Barra de progresso */
.form-progress-wrap {
  margin-bottom: var(--space-6);
}

.form-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

/* ── Steps do formulario ─────────────────────────────────────── */
.form-steps-container {
  position: relative;
  min-height: 200px;
}

.form-step {
  display: none;
}

.form-step.active {
  display: block;
  animation: stepIn 250ms ease-out forwards;
}

@keyframes stepIn {
  from { opacity: 0; transform: translateX(16px); }
  to   { opacity: 1; transform: translateX(0); }
}

.form-step__question {
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
  margin-bottom: var(--space-5);
  line-height: var(--leading-snug);
}

/* ── Radio cards (opcoes de resposta) ───────────────────────── */
.radio-cards {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.radio-card {
  position: relative;
}

.radio-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  /* Manter acessibilidade por teclado - pointer-events: none so para mouse */
}

/* Foco visivel para navegacao por teclado */
.radio-card input[type="radio"]:focus-visible + .radio-card__label {
  outline: 3px solid var(--color-primary);
  outline-offset: 2px;
}

.radio-card__label {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: var(--text-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  background: var(--color-surface);
  transition:
    border-color var(--transition-fast),
    background   var(--transition-fast),
    color        var(--transition-fast),
    box-shadow   var(--transition-fast);
  min-height: 56px;   /* touch target >= 44px */
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.radio-card__label:hover {
  border-color: var(--color-primary-light);
  background: var(--color-primary-bg);
}

.radio-card input:checked + .radio-card__label {
  border-color: var(--color-primary);
  background: var(--color-primary-bg);
  color: var(--color-primary-dark);
  box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.15);
}

.radio-card__check {
  width: 22px;
  height: 22px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.radio-card input:checked + .radio-card__label .radio-card__check {
  border-color: var(--color-primary);
  background: var(--color-primary);
}

.radio-card__check::after {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: #fff;
  opacity: 0;
  transform: scale(0);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.radio-card input:checked + .radio-card__label .radio-card__check::after {
  opacity: 1;
  transform: scale(1);
}

.radio-card__emoji {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* ── Campos de texto (step 4) ──────────────────────────────── */
.form-fields {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.form-field__label {
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.form-field__required {
  color: var(--color-error);
  margin-left: 2px;
}

.form-field__input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  min-height: 48px;  /* touch target */
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-field__input::placeholder {
  color: var(--color-text-muted);
}

.form-field__input:focus-visible {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(46, 134, 193, 0.15);
}

.form-field__input:focus:not(:focus-visible) {
  border-color: var(--color-primary-light);
}

.form-field__input.error {
  border-color: var(--color-error);
  box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

.form-field__error {
  font-size: var(--text-xs);
  color: var(--color-error);
  display: none;
  align-items: center;
  gap: var(--space-1);
  margin-top: 2px;
}

.form-field__error.visible {
  display: flex;
}

.form-field__hint {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* ── Navegacao dos steps ────────────────────────────────────── */
.form-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-6);
  flex-wrap: wrap;
}

.btn-form-back {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-secondary);
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  min-height: 44px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-form-back:hover {
  background: var(--color-border);
  color: var(--color-text);
}

.btn-form-next,
.btn-form-submit {
  flex: 1;
  min-width: 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-8);
  border-radius: var(--radius-full);
  font-size: var(--text-base);
  font-weight: var(--font-weight-bold);
  color: #fff;
  background: var(--color-accent);
  border: none;
  min-height: 52px;
  cursor: pointer;
  box-shadow: var(--shadow-cta);
  transition: all var(--transition-fast);
}

.btn-form-next:hover,
.btn-form-submit:hover {
  background: var(--color-accent-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(230,126,34,0.45);
}

.btn-form-next:disabled,
.btn-form-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-form-submit {
  background: var(--color-success);
  box-shadow: 0 8px 24px rgba(39, 174, 96, 0.35);
}

.btn-form-submit:hover {
  background: #1E8449;
  box-shadow: 0 12px 36px rgba(39, 174, 96, 0.5);
}

/* ── Tela de sucesso (step final) ───────────────────────────── */
.form-success {
  display: none;
  text-align: center;
  padding: var(--space-8) 0;
  animation: stepIn 300ms ease-out forwards;
}

.form-success.visible {
  display: block;
}

.form-success__icon {
  width: 80px;
  height: 80px;
  background: var(--color-success-bg);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-inline: auto;
  margin-bottom: var(--space-5);
}

.form-success__icon svg {
  width: 40px;
  height: 40px;
  color: var(--color-success);
}

.form-success__title {
  font-size: var(--text-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  margin-bottom: var(--space-3);
}

.form-success__text {
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
  line-height: var(--leading-relaxed);
}

/* ── LGPD / Privacidade ─────────────────────────────────────── */
.form-lgpd {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  line-height: var(--leading-relaxed);
}

.form-lgpd svg {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  color: var(--color-success);
}
