/* ===========================================
   Capta Projetos — Estilos do formulário
   Compatível com WordPress + Elementor
   Prefixo: cp- para evitar conflitos de tema
   =========================================== */

/* Reset local */
.cp-app *,
.cp-app *::before,
.cp-app *::after {
  box-sizing: border-box;
}

/* Container principal */
.cp-app {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: #1a1a2e;
  max-width: 720px;
  margin: 0 auto;
  padding: 0;
}

/* ---- Barra de progresso ---- */
.cp-progress-wrap {
  height: 4px;
  background: #e8e8e8;
  border-radius: 4px;
  margin-bottom: 1.75rem;
  overflow: hidden;
}

.cp-progress-bar {
  height: 4px;
  background: #1a5fa8;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ---- Indicadores de etapa ---- */
.cp-steps {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border: 1px solid #dde2ec;
  border-radius: 8px;
  overflow: hidden;
}

.cp-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  font-size: 11px;
  color: #888;
  background: #f7f8fc;
  border-right: 1px solid #dde2ec;
  transition: background 0.2s, color 0.2s;
  cursor: default;
  text-align: center;
}

.cp-step:last-child {
  border-right: none;
}

.cp-step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #dde2ec;
  color: #888;
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  transition: background 0.2s, color 0.2s;
}

.cp-step-label {
  font-size: 11px;
  line-height: 1.2;
}

.cp-step.active {
  background: #eaf1fb;
  color: #1a5fa8;
  font-weight: 500;
}

.cp-step.active .cp-step-num {
  background: #1a5fa8;
  color: #fff;
}

.cp-step.done {
  background: #f0f8ee;
  color: #2e7d32;
}

.cp-step.done .cp-step-num {
  background: #2e7d32;
  color: #fff;
}

/* ---- Painéis de etapa ---- */
.cp-panel {
  display: none;
  border: none;
  padding: 0;
  margin: 0;
  animation: cp-fadein 0.2s ease;
}

.cp-panel.active {
  display: block;
}

@keyframes cp-fadein {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cp-panel-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1a2e;
  margin: 0 0 6px;
  display: block;
}

.cp-panel-desc {
  font-size: 13px;
  color: #666;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}

/* ---- Campos ---- */
.cp-field {
  margin-bottom: 1.1rem;
  flex: 1;
}

.cp-field--full {
  width: 100%;
}

.cp-field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  margin-bottom: 5px;
}

.cp-req {
  color: #c0392b;
  margin-left: 2px;
}

.cp-hint {
  font-weight: 400;
  color: #888;
  font-size: 12px;
}

.cp-field input[type="text"],
.cp-field input[type="number"],
.cp-field input[type="email"],
.cp-field input[type="url"],
.cp-field select,
.cp-field textarea {
  width: 100%;
  padding: 9px 12px;
  font-size: 14px;
  font-family: inherit;
  color: #1a1a2e;
  background: #fff;
  border: 1px solid #ccd3df;
  border-radius: 6px;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.cp-field select {
  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='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

.cp-field textarea {
  resize: vertical;
  line-height: 1.5;
  min-height: 90px;
}

.cp-field input:focus,
.cp-field select:focus,
.cp-field textarea:focus {
  outline: none;
  border-color: #1a5fa8;
  box-shadow: 0 0 0 3px rgba(26, 95, 168, 0.12);
}

.cp-field input.cp-invalid,
.cp-field select.cp-invalid,
.cp-field textarea.cp-invalid {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

/* ---- Grid de 2 colunas ---- */
.cp-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 560px) {
  .cp-row {
    grid-template-columns: 1fr;
  }
}

/* ---- Checkboxes ---- */
.cp-check-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cp-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #dde2ec;
  border-radius: 6px;
  cursor: pointer;
  background: #fff;
  transition: background 0.15s, border-color 0.15s;
  font-weight: 400;
  font-size: 13px;
  color: #333;
  line-height: 1.4;
}

.cp-check-item input[type="checkbox"] {
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: #1a5fa8;
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.cp-check-item:hover {
  background: #f0f5fb;
  border-color: #b0c4de;
}

.cp-check-item:has(input:checked) {
  background: #eaf1fb;
  border-color: #1a5fa8;
}

/* Cards de fonte (Etapa 3) */
.cp-check-group--cards .cp-check-item--card {
  padding: 12px 14px;
}

.cp-check-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cp-check-body strong {
  font-size: 14px;
  color: #1a1a2e;
}

.cp-check-body span {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

/* ---- Botões ---- */
.cp-btn-row {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid #eee;
}

.cp-btn {
  padding: 10px 22px;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  border-radius: 6px;
  border: 1px solid #ccd3df;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
  line-height: 1.4;
}

.cp-btn:hover {
  background: #f4f6fa;
  border-color: #b0bbc8;
}

.cp-btn:active {
  transform: scale(0.98);
}

.cp-btn--primary {
  background: #1a5fa8;
  color: #fff;
  border-color: #1a5fa8;
}

.cp-btn--primary:hover {
  background: #154d8a;
  border-color: #154d8a;
}

.cp-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

/* ---- Resumo (Etapa 5) ---- */
#cp-resumo {
  background: #f7f8fc;
  border: 1px solid #dde2ec;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  font-size: 13px;
  line-height: 1.7;
}

#cp-resumo h3 {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #888;
  margin: 1rem 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #dde2ec;
}

#cp-resumo h3:first-child {
  margin-top: 0;
}

#cp-resumo p {
  margin: 4px 0;
  color: #333;
}

#cp-resumo strong {
  color: #1a1a2e;
  min-width: 160px;
  display: inline-block;
}

/* ---- Aviso ---- */
.cp-notice {
  padding: 12px 14px;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.5;
  margin-top: 1rem;
}

.cp-notice--info {
  background: #eaf1fb;
  border: 1px solid #b0c4de;
  color: #1a3a5c;
}

/* ---- Loading ---- */
#cp-enviando {
  text-align: center;
  padding: 3rem 1rem;
}

.cp-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #ccd3df;
  border-top-color: #1a5fa8;
  border-radius: 50%;
  animation: cp-spin 0.75s linear infinite;
  margin: 0 auto 1.25rem;
}

@keyframes cp-spin {
  to { transform: rotate(360deg); }
}

.cp-loading-text {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a2e;
  margin: 0 0 6px;
}

.cp-loading-sub {
  font-size: 13px;
  color: #888;
  margin: 0;
}

/* ---- Sucesso / Erro ---- */
.cp-resultado {
  text-align: center;
  padding: 3rem 1.5rem;
}

.cp-resultado h2 {
  font-size: 20px;
  font-weight: 600;
  margin: 0 0 12px;
}

.cp-resultado p {
  font-size: 14px;
  color: #555;
  margin: 0 0 8px;
  line-height: 1.6;
}

.cp-resultado-sub {
  font-size: 13px !important;
  color: #888 !important;
}

.cp-resultado-sub a {
  color: #1a5fa8;
  text-decoration: none;
}

.cp-resultado-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  margin: 0 auto 1.25rem;
}

.cp-resultado--sucesso .cp-resultado-icon {
  background: #e8f5e9;
  position: relative;
}

.cp-resultado--sucesso .cp-resultado-icon::after {
  content: '';
  position: absolute;
  left: 16px;
  top: 24px;
  width: 8px;
  height: 14px;
  border: 3px solid #2e7d32;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-6px);
}

.cp-resultado--sucesso h2 { color: #1b5e20; }

.cp-resultado--erro .cp-resultado-icon {
  background: #fdecea;
  position: relative;
}

.cp-resultado--erro .cp-resultado-icon::before,
.cp-resultado--erro .cp-resultado-icon::after {
  content: '';
  position: absolute;
  left: 24px;
  top: 14px;
  width: 3px;
  height: 24px;
  background: #c0392b;
  border-radius: 2px;
}

.cp-resultado--erro .cp-resultado-icon::before { transform: rotate(45deg); }
.cp-resultado--erro .cp-resultado-icon::after  { transform: rotate(-45deg); }

.cp-resultado--erro h2 { color: #7b1c1c; }

/* ---- Responsivo ---- */
@media (max-width: 480px) {
  .cp-steps { display: none; }
  .cp-btn-row { flex-direction: column; }
  .cp-btn { width: 100%; text-align: center; }
}
