:root {
  --bg: #0b0f17;
  --bg-elevated: #111827;
  --bg-card: #151e2e;
  --bg-input: #0e1420;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #f3f4f6;
  --text-muted: #9ca3af;
  --accent: #f38020;
  --accent-hover: #ff9438;
  --accent-soft: rgba(243, 128, 32, 0.14);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.14);
  --red: #ef4444;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: radial-gradient(circle at top right, rgba(243, 128, 32, 0.08), transparent 40%), var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100vh;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 0.88em;
  color: #fde68a;
}

.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 15, 23, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  flex-wrap: wrap;
  padding-top: 8px;
  padding-bottom: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #ea580c);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 18px rgba(243, 128, 32, 0.35);
}

.brand-name {
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  display: block;
  line-height: 1.1;
}

.brand-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 2px 7px;
  border-radius: 999px;
  margin-top: 2px;
}

/* Step Navigation */
.step-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.step-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  padding: 8px 13px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.step-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.step-btn.active {
  color: #fff;
  background: var(--accent-soft);
  border-color: rgba(243, 128, 32, 0.45);
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.step-btn.active .step-num {
  background: var(--accent);
  color: #111;
}

/* Main */
.main-content {
  padding-top: 24px;
  padding-bottom: 56px;
}

/* Hero Strip */
.hero-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, rgba(243, 128, 32, 0.12), rgba(21, 30, 46, 0.9));
  border: 1px solid rgba(243, 128, 32, 0.25);
  border-radius: var(--radius);
  padding: 22px 26px;
  margin-bottom: 24px;
}

.hero-text {
  max-width: 740px;
}

.hero-text h1 {
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.hero-text p {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.accent {
  color: var(--accent);
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Cards */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.card-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.muted {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.small {
  font-size: 0.82rem;
}

/* Tabs */
.tab-panel {
  display: none;
  animation: fadeIn 0.2s ease;
}

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #d1d5db;
}

input[type="text"],
input[type="url"],
select,
textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.color-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
}

.color-input-wrap input[type="color"] {
  width: 42px;
  height: 40px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  padding: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.16s ease;
  text-decoration: none;
}

.btn-primary {
  background: var(--accent);
  color: #111827;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn-secondary:hover,
.btn-secondary.active {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--border);
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}

.btn-success {
  background: var(--green);
  color: #052e16;
}

.btn-success:hover {
  filter: brightness(1.08);
}

.btn-xs {
  padding: 6px 10px;
  font-size: 0.78rem;
}

.btn-full {
  width: 100%;
}

/* Search Form Clean */
.search-grid-clean {
  display: grid;
  grid-template-columns: 1.15fr 1.2fr 1fr;
  gap: 14px;
  align-items: end;
}

.search-bottom-left {
  grid-column: 1 / 2;
  justify-content: center;
  padding-bottom: 6px;
}

.search-bottom-right {
  grid-column: 2 / 4;
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 10px;
}

/* Color Studio */
.color-studio {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.color-studio-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.color-studio-head label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #e5e7eb;
}

.palette-swatches {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.swatch-btn {
  width: 36px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.14s ease;
}

.swatch-btn:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
}

.swatch-btn span {
  display: block;
  width: 100%;
  height: 100%;
}

.color-controls-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mini-color {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mini-color span {
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--text-muted);
}

.mini-color .color-input-wrap input[type="color"] {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.mini-color .color-input-wrap input[type="text"] {
  padding: 6px 8px;
  font-size: 0.8rem;
  font-family: monospace;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text);
}

/* Google Maps API optional box */
.gmaps-box {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
}

.gmaps-box summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.84rem;
  color: var(--text-muted);
  list-style: none;
}

.gmaps-box summary::-webkit-details-marker {
  display: none;
}

.gmaps-box-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gmaps-key-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
}

.gmaps-key-row input[type="password"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-strong);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-family: monospace;
  font-size: 0.84rem;
}

.status-bar {
  margin-top: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(243, 128, 32, 0.12);
  border: 1px solid rgba(243, 128, 32, 0.3);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hidden {
  display: none !important;
}

/* Results Grid */
.results-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 16px;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-icon {
  font-size: 2.4rem;
  margin-bottom: 10px;
}

.empty-state h3 {
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  max-width: 560px;
  margin: 0 auto;
  font-size: 0.92rem;
}

.biz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.biz-card:hover {
  border-color: rgba(243, 128, 32, 0.45);
  transform: translateY(-2px);
}

.biz-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.pill {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
}

.pill-green {
  background: var(--green-soft);
  color: #34d399;
}

.pill-orange {
  background: var(--accent-soft);
  color: var(--accent);
}

.pill-gray {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.biz-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.biz-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.84rem;
  color: var(--text-muted);
}

.biz-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* Builder Layout */
.builder-layout {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 20px;
  align-items: start;
}

.builder-sidebar {
  max-height: calc(100vh - 110px);
  overflow-y: auto;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.sidebar-head h2 {
  font-size: 1.1rem;
}

.builder-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.export-box {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.export-box h3 {
  font-size: 0.96rem;
}

.export-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.export-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

/* Preview Panel */
.preview-panel {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 110px);
  min-height: 640px;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: #0d1320;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.browser-dots {
  display: flex;
  gap: 6px;
}

.browser-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.preview-url {
  background: rgba(255, 255, 255, 0.06);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: monospace;
}

.preview-controls {
  display: flex;
  gap: 6px;
}

.preview-stage {
  flex: 1;
  background: #070a10;
  display: flex;
  justify-content: center;
  padding: 0;
  overflow: hidden;
}

.preview-stage.mobile-mode {
  padding: 16px;
}

#sitePreviewFrame {
  width: 100%;
  height: 100%;
  border: none;
  background: #fff;
  transition: width 0.25s ease;
}

.preview-stage.mobile-mode #sitePreviewFrame {
  width: 390px;
  border-radius: 24px;
  border: 6px solid #1f2937;
}

/* Scripts / Abordagem */
.pitch-config {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 22px;
}

.scripts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
}

.script-card {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.script-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.script-card-head h3 {
  font-size: 0.96rem;
}

.script-text {
  white-space: pre-wrap;
  font-size: 0.86rem;
  color: #d1d5db;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  flex: 1;
}

.script-actions {
  display: flex;
  gap: 8px;
}

/* Cloudflare Guide */
.guide-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  align-items: start;
}

.checklist {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.check-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border);
  cursor: pointer;
}

.check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  accent-color: var(--accent);
}

.check-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.check-item p {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.info-sidebar h3 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.benefit-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.benefit-list li {
  font-size: 0.88rem;
  color: #d1d5db;
  padding-left: 20px;
  position: relative;
}

.benefit-list li::before {
  content: "✓";
  color: var(--green);
  font-weight: 800;
  position: absolute;
  left: 0;
}

.tip-box {
  background: var(--accent-soft);
  border: 1px solid rgba(243, 128, 32, 0.3);
  border-radius: var(--radius-sm);
  padding: 14px;
  font-size: 0.86rem;
}

.tip-box p {
  margin-top: 6px;
  color: #f3f4f6;
}

/* Leads */
.leads-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.lead-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.lead-info h3 {
  font-size: 0.98rem;
  margin-bottom: 2px;
}

.lead-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.lead-controls select {
  width: auto;
  padding: 6px 10px;
  font-size: 0.82rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: #1f2937;
  color: #fff;
  border: 1px solid rgba(243, 128, 32, 0.5);
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
  z-index: 100;
}

/* Responsive */
@media (max-width: 1024px) {
  .search-grid-clean {
    grid-template-columns: 1fr 1fr;
  }
  .search-bottom-left,
  .search-bottom-right {
    grid-column: 1 / -1;
  }
  .builder-layout,
  .guide-grid {
    grid-template-columns: 1fr;
  }
  .builder-sidebar {
    max-height: none;
  }
  .preview-panel {
    height: 700px;
  }
  .pitch-config {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .search-grid-clean {
    grid-template-columns: 1fr;
  }
  .search-bottom-right {
    grid-template-columns: 1fr;
  }
  .field-row,
  .color-controls-grid {
    grid-template-columns: 1fr;
  }
}
