/* GoodLeads Flow Builder — vanilla CSS, sem framework
   Paleta: laranja GoodLeads (#EE3924 / #D42F1C) sobre base dark */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  line-height: 1.5;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

.topbar {
  background: linear-gradient(180deg, #1a0d09 0%, #0f172a 100%);
  border-bottom: 2px solid #EE3924;
  padding: 1.75rem 0 1.25rem;
}
.topbar h1 {
  margin: 0 0 .25rem;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  background: linear-gradient(90deg, #EE3924 0%, #F26B5A 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}
.topbar .subtitle { margin: 0; color: #94a3b8; font-size: .95rem; }
.topbar .brand-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #EE3924;
  margin-bottom: .25rem;
}

main.wrap { padding-top: 1.75rem; padding-bottom: 3rem; }

.card {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 1.5rem;
  margin-bottom: 1.25rem;
}
.card h2 {
  margin: 0 0 .5rem;
  font-size: 1.1rem;
  color: #f1f5f9;
}
.hint { margin: 0 0 1rem; color: #94a3b8; font-size: .85rem; }
.hint.warn { color: #fbbf24; }
.hint code { background: #0f172a; padding: 1px 6px; border-radius: 4px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
}
@media (max-width: 720px) { .grid-2 { grid-template-columns: 1fr; } }

label {
  display: block;
  margin-bottom: .35rem;
  font-size: .85rem;
  color: #cbd5e1;
  font-weight: 500;
}
.req { color: #EE3924; }
.sensitive {
  background: #4a1410;
  color: #fecaca;
  font-size: .7rem;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: .25rem;
  font-weight: 400;
  border: 1px solid #7f1d1d;
}

input, textarea, select {
  width: 100%;
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  border-radius: 6px;
  padding: .55rem .75rem;
  font-size: .9rem;
  font-family: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #EE3924;
  box-shadow: 0 0 0 3px rgba(238, 57, 36, 0.15);
}
input[readonly] {
  background: #1a2030;
  color: #94a3b8;
  cursor: not-allowed;
  border-style: dashed;
}
input[readonly]:focus {
  border-color: #334155;
  box-shadow: none;
}
textarea {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .8rem;
  line-height: 1.45;
}

/* Galeria */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: .75rem;
  margin-bottom: 1rem;
}
.gallery-item {
  border: 2px solid #334155;
  background: #0f172a;
  border-radius: 8px;
  padding: .9rem 1rem;
  cursor: pointer;
  transition: all .15s ease;
}
.gallery-item:hover {
  border-color: #EE3924;
  transform: translateY(-1px);
}
.gallery-item.selected {
  border-color: #EE3924;
  background: linear-gradient(135deg, #2a1410 0%, #1e293b 100%);
  box-shadow: 0 0 0 1px rgba(238, 57, 36, 0.3);
}
.gallery-item h3 { margin: 0 0 .35rem; font-size: .95rem; color: #f1f5f9; }
.gallery-item.selected h3 { color: #F26B5A; }
.gallery-item p { margin: 0; font-size: .78rem; color: #94a3b8; line-height: 1.4; }

/* Botoes */
.actions {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
button {
  background: #334155;
  color: #e2e8f0;
  border: none;
  border-radius: 6px;
  padding: .65rem 1.25rem;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
}
button:hover { background: #475569; }
button.primary {
  background: #EE3924;
  color: #fff;
  box-shadow: 0 2px 8px rgba(238, 57, 36, 0.25);
}
button.primary:hover {
  background: #D42F1C;
  box-shadow: 0 4px 12px rgba(238, 57, 36, 0.35);
  transform: translateY(-1px);
}
button.ghost {
  background: transparent;
  border: 1px solid #334155;
}
button.ghost:hover {
  background: #1e293b;
  border-color: #EE3924;
  color: #F26B5A;
}
button:disabled { opacity: .5; cursor: not-allowed; }

/* Validacao */
.validation {
  margin-bottom: 1rem;
  padding: .65rem .85rem;
  border-radius: 6px;
  font-size: .85rem;
  display: none;
}
.validation.error {
  display: block;
  background: #4a1410;
  color: #fecaca;
  border-left: 3px solid #EE3924;
}
.validation.ok {
  display: block;
  background: #14532d;
  color: #bbf7d0;
  border-left: 3px solid #16A34A;
}

/* Preview JSON */
.json-preview {
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 1rem;
  max-height: 400px;
  overflow: auto;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: .75rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-all;
  color: #cbd5e1;
}

/* Detalhes (collapsible) */
details.adv {
  margin-top: 1rem;
  border-top: 1px solid #334155;
  padding-top: 1rem;
}
details.adv summary {
  cursor: pointer;
  color: #94a3b8;
  font-size: .85rem;
  user-select: none;
  transition: color .15s ease;
}
details.adv summary:hover { color: #F26B5A; }
details.adv[open] summary { margin-bottom: 1rem; color: #f1f5f9; }

footer {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid #1e293b;
  text-align: center;
}
footer p {
  margin: 0;
  font-size: .8rem;
  color: #64748b;
}
footer .accent { color: #EE3924; font-weight: 600; }
footer code { background: #1e293b; padding: 1px 6px; border-radius: 4px; }
