/* CSS do funnel multi-step — isolado com prefix #funnel */

#funnel {
  --primary-50:#FDF4F0; --primary-100:#FADCD2; --primary-300:#F0957D;
  --primary-500:#E2513A; --primary-600:#C73E26; --primary-700:#9E2E19;
  --primary-900:#5B1A0E;
  --navy-700:#1E2D5C; --navy-900:#0F1A3A;
  --slate-50:#F8FAFC; --slate-100:#F1F5F9; --slate-200:#E2E8F0;
  --slate-300:#CBD5E1; --slate-500:#64748B; --slate-700:#334155; --slate-900:#0F172A;
  --success:#22C55E; --danger:#DC2626;
  --radius-sm:4px; --radius-md:8px; --radius-lg:12px; --radius-xl:16px;
  --shadow-sm:0 1px 2px rgba(15,23,42,.06);
  --shadow-md:0 4px 12px rgba(15,23,42,.08);
  --shadow-lg:0 12px 32px rgba(15,23,42,.12);
}

/* MODAL CONTAINER */
.funnel-modal[hidden] { display: none !important; }
.funnel-modal {
  position: fixed; inset: 0;
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  background: rgba(15,26,58,.65);
  backdrop-filter: blur(2px);
  animation: funnelModalFadeIn .2s ease;
}
.funnel-modal-overlay { position: absolute; inset: 0; }
.funnel-modal-content {
  position: relative;
  background: #fff;
  border-radius: var(--radius-lg);
  max-width: 560px; width: 100%;
  max-height: 92vh; overflow-y: auto;
  padding: 32px 24px 24px;
  box-shadow: var(--shadow-lg);
  animation: funnelModalSlideUp .25s ease;
}
.funnel-modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 36px; height: 36px;
  border: none; background: #F1F5F9; color: #334155;
  font-size: 24px; line-height: 1; border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; z-index: 1;
}
.funnel-modal-close:hover { background: #E2E8F0; color: #0F1A3A; }

@keyframes funnelModalFadeIn { from{opacity:0} to{opacity:1} }
@keyframes funnelModalSlideUp { from{transform:translateY(20px);opacity:.5} to{transform:translateY(0);opacity:1} }

/* PROGRESS */
#funnel .progress {
  position: relative; height: 8px;
  background: var(--slate-200);
  border-radius: var(--radius-sm);
  margin-bottom: 8px; overflow: hidden;
}
#funnel .progress-bar {
  position: absolute; top: 0; left: 0; height: 100%;
  background: var(--primary-500);
  border-radius: var(--radius-sm);
  transition: width .25s ease;
  width: 0;
}
#funnel .progress-label {
  display: block;
  font-size: 13px;
  color: var(--slate-500);
  margin-bottom: 24px; margin-top: 8px;
}

/* TITLES + FIELDS */
#funnel h3, #funnel h2:not(.visually-hidden) {
  font-size: 22px; line-height: 1.3;
  color: var(--navy-900);
  margin: 0 0 8px; font-weight: 700;
}
#funnel p { font-size: 15px; color: var(--slate-700); line-height: 1.5; margin-bottom: 24px; }

#funnel .field { margin-bottom: 20px; }
#funnel fieldset.field {
  border: 0 !important;
  padding: 0 !important;
  margin: 0 0 20px !important;
}
#funnel legend { padding: 0; margin: 0 0 8px; }
#funnel label { display: block; font-size: 14px; font-weight: 600; color: var(--navy-900); margin-bottom: 8px; }

#funnel input[type="text"], #funnel input[type="email"], #funnel input[type="tel"],
#funnel select, #funnel textarea {
  width: 100%; padding: 12px 14px;
  font-size: 16px; font-family: inherit;
  border: 2px solid var(--slate-300);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--slate-900);
  transition: border-color .15s ease;
  box-sizing: border-box;
}
#funnel input:focus, #funnel select:focus, #funnel textarea:focus {
  outline: none; border-color: var(--primary-500);
}
#funnel textarea { min-height: 80px; resize: vertical; }

/* RADIO OPTIONS */
#funnel .radio-group { display: grid; gap: 8px; }
#funnel .radio-option {
  position: relative; display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  background: #fff;
  border: 2px solid var(--slate-300);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all .15s ease;
  min-height: 48px;
}
#funnel .radio-option:hover { border-color: var(--primary-300); background: var(--primary-50); }
#funnel .radio-option input { position: absolute; opacity: 0; pointer-events: none; }
#funnel .radio-option .radio-dot {
  flex-shrink: 0; width: 20px; height: 20px;
  border: 2px solid var(--slate-300);
  border-radius: 50%;
  display: block; margin-top: 2px;
  transition: all .15s ease;
  position: relative;
}
#funnel .radio-option input:checked ~ .radio-dot {
  border-color: var(--primary-500);
  background: var(--primary-500);
}
#funnel .radio-option input:checked ~ .radio-dot::after {
  content: ''; position: absolute; inset: 4px;
  background: #fff; border-radius: 50%;
}
#funnel .radio-option:has(input:checked) {
  border-color: var(--primary-500); background: var(--primary-50);
}
#funnel .radio-label {
  font-size: 15px; line-height: 1.4;
  color: var(--slate-700); flex: 1;
}
#funnel .radio-option:has(input:checked) .radio-label {
  color: var(--navy-900); font-weight: 600;
}

/* TRUST BLOCK */
#funnel .trust-block {
  background: var(--slate-50);
  padding: 20px;
  border-radius: var(--radius-md);
  margin-bottom: 28px;
  border-left: 3px solid var(--success);
}
#funnel .trust-block h3 { font-size: 15px; margin-bottom: 12px; color: var(--navy-900); }
#funnel .trust-block ul { list-style: none; padding: 0; margin: 0; }
#funnel .trust-block li {
  padding: 6px 0 6px 24px;
  font-size: 14px; color: var(--slate-700);
  position: relative; line-height: 1.5;
}
/* FIELD OTHER (textarea de "Outro") — oculto por padrão */
#funnel .field-other { display: none; margin-top: 12px; }
#funnel .field-other.visible { display: block; }

#funnel .trust-block li::before {
  content: '✓'; position: absolute; left: 0; top: 6px;
  color: var(--success); font-weight: 900;
}

/* FIELD ERRORS */
#funnel .field-error {
  display: none; margin-top: 8px;
  padding: 10px 12px; font-size: 13px;
  color: var(--danger); background: #FEE2E2;
  border-left: 3px solid var(--danger);
  border-radius: var(--radius-sm); line-height: 1.4;
}
#funnel .field-error.visible { display: block; }
#funnel .errors-summary {
  display: none; margin-bottom: 24px;
  padding: 16px; background: #FEE2E2;
  border: 2px solid var(--danger);
  border-radius: var(--radius-md);
  color: #7F1D1D;
}
#funnel .errors-summary.visible { display: block; }

/* NAV BUTTONS — alta especificidade pra anular .nav escura da home */
.funnel-modal-content #nav,
.funnel-modal-content .nav {
  display: flex !important;
  flex-direction: column-reverse !important;
  gap: 12px !important;
  margin-top: 32px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

.funnel-modal-content #nav .btn,
.funnel-modal-content .nav .btn {
  width: 100% !important;
}

@media (min-width: 480px) {
  .funnel-modal-content #nav,
  .funnel-modal-content .nav {
    flex-direction: row !important;
    justify-content: space-between !important;
  }
  .funnel-modal-content #nav .btn,
  .funnel-modal-content .nav .btn {
    width: auto !important;
    min-width: 140px !important;
  }
  .funnel-modal-content #btn-next {
    flex: 1 !important;
    max-width: 320px !important;
    margin-left: auto !important;
  }
  .funnel-modal-content #btn-back {
    flex: 0 0 auto !important;
  }
}

/* BTNS */
.funnel-modal-content .btn {
  display: inline-block;
  padding: 14px 20px;
  background: var(--primary-500);
  color: #fff !important;
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  transition: background .15s ease, transform .15s ease;
  box-shadow: var(--shadow-md);
  font-family: inherit;
  line-height: 1.3;
}
.funnel-modal-content .btn:hover { background: var(--primary-600); }
.funnel-modal-content .btn:active { transform: translateY(1px); }
.funnel-modal-content .btn:disabled { opacity: .6; cursor: not-allowed; }

.funnel-modal-content .btn-secondary {
  background: transparent !important;
  color: var(--navy-900) !important;
  border: 2px solid var(--slate-300) !important;
  box-shadow: none !important;
}
.funnel-modal-content .btn-secondary:hover {
  border-color: var(--navy-900) !important;
  background: var(--slate-100) !important;
}

/* UTILS */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0;
}
