/**
 * TP4 Lead Form — styles
 * Owner: agente tpsoft-pedidos (vive em tp-template-v4 / cross-agent).
 *
 * Design coerente com o resto do V4 (clean / minimal, sem dependências
 * externas). Variáveis CSS usam --tp4-primary se existir (do tema V4).
 */

.tp4-lf-wrap {
  max-width: 880px;
  margin: 32px auto;
  padding: 0 16px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1a1a1a;
}

.tp4-lf-header { text-align: center; margin-bottom: 24px; }
.tp4-lf-title {
  margin: 0;
  font-size: 28px;
  font-weight: 700;
  color: #0f1520;
}
.tp4-lf-subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  color: #64748b;
}

.tp4-lf-form { display: block; }

.tp4-lf-section {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 22px 24px;
  margin-bottom: 16px;
}

.tp4-lf-section legend {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #64748b;
  padding: 0 8px;
  font-weight: 600;
}

.tp4-lf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}

.tp4-lf-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tp4-lf-field span {
  font-size: 12px;
  color: #475569;
  font-weight: 500;
}

.tp4-lf-field em {
  color: #ef4444;
  font-style: normal;
  margin-left: 2px;
}

.tp4-lf-col-full {
  grid-column: 1 / -1;
}

.tp4-lf-input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #cbd5e1;
  background: #fff;
  font-size: 14px;
  color: #0f172a;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
  transition: border-color .15s, box-shadow .15s;
}

.tp4-lf-input:focus {
  outline: none;
  border-color: var(--tp4-primary, #81BB42);
  box-shadow: 0 0 0 3px rgba(129, 187, 66, 0.15);
}

.tp4-lf-textarea {
  resize: vertical;
  min-height: 70px;
}

.tp4-lf-mono {
  text-transform: uppercase;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: 0.5px;
}

.tp4-lf-items {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 10px;
}

.tp4-lf-item {
  padding: 14px;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  background: #f8fafc;
  position: relative;
}

.tp4-lf-item-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 90px;
  gap: 10px;
}

@media (max-width: 640px) {
  .tp4-lf-item-grid { grid-template-columns: 1fr; }
}

.tp4-lf-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  background: transparent;
  color: #ef4444;
  border: none;
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  font-family: inherit;
}
.tp4-lf-remove:hover {
  background: rgba(239, 68, 68, 0.08);
}

.tp4-lf-add {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px dashed #cbd5e1;
  background: transparent;
  border-radius: 10px;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.tp4-lf-add:hover {
  border-color: var(--tp4-primary, #81BB42);
  color: #0f172a;
}

.tp4-lf-actions {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.tp4-lf-error {
  padding: 12px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #b91c1c;
  border-radius: 10px;
  font-size: 13px;
}

.tp4-lf-submit {
  display: block;
  width: 100%;
  padding: 14px 24px;
  border-radius: 999px;
  border: none;
  background: linear-gradient(135deg, var(--tp4-primary, #81BB42), #6fa030);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 4px 16px rgba(129, 187, 66, 0.25);
  transition: transform .1s, box-shadow .15s;
}
.tp4-lf-submit:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(129, 187, 66, 0.35);
}
.tp4-lf-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.tp4-lf-success {
  text-align: center;
  padding: 48px 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
}
.tp4-lf-success-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  font-weight: 700;
}
.tp4-lf-success h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: #0f1520;
}
.tp4-lf-success p {
  margin: 0 0 20px;
  color: #475569;
  font-size: 14px;
  line-height: 1.5;
}
.tp4-lf-close {
  padding: 10px 24px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: transparent;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
}
.tp4-lf-close:hover {
  border-color: var(--tp4-primary, #81BB42);
  color: #0f172a;
}

/* Phase 7 — Attachments uploader (drag-drop + preview) */
.tp4-lf-dropzone {
  padding: 28px 20px;
  border: 2px dashed #cbd5e1;
  border-radius: 12px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  outline: none;
}
.tp4-lf-dropzone:hover,
.tp4-lf-dropzone:focus,
.tp4-lf-dropzone.is-drag {
  border-color: var(--tp4-primary, #81BB42);
  background: rgba(129, 187, 66, 0.06);
}
.tp4-lf-dropzone-icon {
  font-size: 28px;
  line-height: 1;
  margin-bottom: 6px;
}
.tp4-lf-dropzone-text {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 2px;
}
.tp4-lf-dropzone-hint {
  font-size: 11px;
  color: #94a3b8;
}

.tp4-lf-attach-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.tp4-lf-attach-tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #475569;
  text-align: center;
  padding: 4px;
}
.tp4-lf-attach-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.tp4-lf-attach-tile.is-error {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.06);
  color: #b91c1c;
}
.tp4-lf-attach-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 11px;
  background: rgba(0,0,0,0.7);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}
.tp4-lf-attach-name {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2px 4px;
  font-size: 9px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
