:root {
  --bg: #070d08;
  --card: #0f1c12;
  --card-hover: #152919;
  --border: rgba(143, 188, 106, 0.28);
  --primary: #8fbc6a;
  --primary-hover: #a3d47c;
  --accent: #e4a853;
  --danger: #ef4444;
  --text: #f5f8f3;
  --muted: #9bb09c;
}

* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color: transparent; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* BARRA SUPERIOR */
header.top-bar {
  background: #0a140c;
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.top-brand { font-weight: 800; font-size: 16px; color: #fff; display: flex; align-items: center; gap: 8px; text-decoration: none; }
.top-brand span { color: var(--primary); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.btn-exit {
  background: rgba(239, 68, 68, 0.15); border: 1px solid rgba(239, 68, 68, 0.35);
  color: #fca5a5; padding: 7px 16px; border-radius: 999px; font-size: 12px; font-weight: 700; cursor: pointer;
}

/* LINHA SUPERIOR: BOTAO VOLTAR E VER PREVIEW LADO A LADO */
.top-nav-row {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
  width: 100%;
}
.btn-action-pill {
  flex: 1;
  max-width: 200px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.btn-preview-theme {
  background: rgba(22, 36, 24, 0.95);
  border: 1px solid rgba(143, 188, 106, 0.45);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.btn-preview-theme:hover { background: rgba(143, 188, 106, 0.35); transform: translateY(-1px); }
.btn-back-theme {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.btn-back-theme:hover { background: rgba(143, 188, 106, 0.2); border-color: var(--primary); transform: translateX(-2px); }
.btn-semente-icon { width: 16px; height: 16px; object-fit: contain; }

/* MODAL CENTRADO DE PREVIEW DO SITE */
.site-preview-modal-overlay {
  position: fixed; inset: 0; z-index: 999999; background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: none; align-items: center; justify-content: center; padding: 20px 14px;
}
.site-preview-modal-overlay.is-open { display: flex; animation: modalPop 0.25s ease-out; }
@keyframes modalPop { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

.site-preview-card {
  width: 100%; max-width: 840px; height: 82vh; background: #071008;
  border: 1.5px solid var(--border); border-radius: 20px; display: flex; flex-direction: column;
  overflow: hidden; box-shadow: 0 25px 70px rgba(0, 0, 0, 0.95);
}
.preview-card-header {
  height: 48px; background: #0c180e; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; padding: 0 16px; flex-shrink: 0;
}
.preview-card-title {
  display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13.5px; color: #fff;
}
.btn-preview-close {
  background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.4); color: #fca5a5;
  font-size: 12px; font-weight: 800; padding: 5px 14px; border-radius: 999px; cursor: pointer; transition: all 0.2s;
}
.btn-preview-close:hover { background: #ef4444; color: #fff; }
.preview-iframe-wrapper { flex: 1; width: 100%; height: 100%; background: #000; position: relative; }
.preview-iframe-wrapper iframe { width: 100%; height: 100%; border: none; display: block; }

/* CONTAINER PRINCIPAL */
main { flex: 1; padding: 20px 18px 90px; max-width: 960px; margin: 0 auto; width: 100%; }

.section-card {
  background: var(--card); border: 1px solid var(--border); border-radius: 22px;
  padding: 24px; margin-bottom: 24px; text-align: left; box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.section-title { font-size: 20px; font-weight: 800; color: #fff; display: flex; align-items: center; gap: 8px; }

/* CAMPOS DE FORMULÁRIO */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; width: 100%; }
label { font-size: 11px; font-weight: 700; text-transform: uppercase; color: var(--muted); letter-spacing: 0.5px; }

input, select, textarea {
  background: #060b07; border: 1px solid rgba(255, 255, 255, 0.16); border-radius: 10px;
  padding: 11px 14px; color: #fff; font-size: 13.5px; font-family: inherit; outline: none; width: 100%; transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary); background: #081109; }
textarea { min-height: 85px; resize: vertical; }

/* SELECT COM SETA RESPIRADA */
select {
  padding-right: 48px !important;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238fbc6a' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: calc(100% - 18px) center !important;
  background-size: 16px !important;
}

.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .form-row-2 { grid-template-columns: 1fr; } }

/* BOTÕES GERAIS */
.btn-main-action {
  background: var(--primary); color: #061508; font-size: 13.5px; font-weight: 800;
  padding: 10px 20px; border-radius: 12px; border: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s;
}
.btn-main-action:hover { background: var(--primary-hover); transform: translateY(-1px); }

.btn-sec-action {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18);
  color: #fff; font-size: 13px; font-weight: 700; padding: 10px 20px; border-radius: 12px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn-sec-action:hover { background: rgba(255,255,255,0.15); }

/* TOAST */
#toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(60px);
  background: var(--primary); color: #061508; padding: 12px 24px; border-radius: 999px;
  font-weight: 800; font-size: 13.5px; box-shadow: 0 10px 30px rgba(0,0,0,0.8); opacity: 0;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1); z-index: 100005; white-space: nowrap; pointer-events: none;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }