/* Direção visual: dossiê de projeto, não "wizard de SaaS genérico".
   Fundo off-white quente, roxo só como cor de ação/hairline (nunca gradiente),
   labels em caixa alta estilo ficha editorial, sidebar de etapas como índice. */

:root {
  --roxo: #5b2a86;
  --roxo-2: #7c3aed;
  --tinta: #1e2430;
  --tinta-suave: #565f72;
  --fundo: #faf9f6;
  --fundo-card: #ffffff;
  --linha: #e4dfd8;
  --linha-forte: #cfc7ba;
  --alerta-bg: #fbf3e7;
  --alerta-borda: #d8a24a;
  --ok: #2f7a4f;
  --radius: 4px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--fundo);
  color: var(--tinta);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    linear-gradient(var(--linha) 1px, transparent 1px),
    linear-gradient(90deg, var(--linha) 1px, transparent 1px);
  background-size: 100% 100%, 100% 100%;
}

.shell {
  display: grid;
  grid-template-columns: 300px 1fr;
  min-height: 100vh;
}

/* ---------- Sidebar (índice de etapas) ---------- */

.sidebar {
  border-right: 1px solid var(--linha);
  padding: 40px 32px;
  background: var(--fundo);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: block; margin-bottom: 40px; }
.brand img { height: 40px; width: auto; display: block; }

.steps-index { list-style: none; margin: 0; padding: 0; }

.steps-index li {
  position: relative;
  padding: 10px 0 10px 18px;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  border-left: 2px solid var(--linha);
  cursor: pointer;
  transition: color .15s, border-color .15s;
}

.steps-index li .n { font-family: var(--serif); font-style: italic; margin-right: 8px; opacity: .6; }

.steps-index li.done { color: var(--tinta); }
.steps-index li.done::after { content: "✓"; position: absolute; right: 0; color: var(--ok); font-size: 11px; }

.steps-index li.active {
  color: var(--roxo);
  border-left-color: var(--roxo);
  font-weight: 600;
}

.sidebar-foot {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--linha);
  font-size: 12px;
  color: var(--tinta-suave);
  line-height: 1.6;
}

/* ---------- Main ---------- */

.main { padding: 56px 64px 120px; max-width: 760px; }

.briefing-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.briefing-type-card {
  min-height: 210px; padding: 24px; border: 1px solid var(--linha-forte); border-radius: var(--radius);
  background: var(--fundo-card); color: var(--tinta); font: inherit; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; align-items: flex-start;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.briefing-type-card:hover, .briefing-type-card:focus-visible {
  border-color: var(--roxo); box-shadow: 0 10px 28px rgba(30, 36, 48, .08); transform: translateY(-2px); outline: none;
}
.briefing-type-card .type-number { font-family: var(--serif); font-style: italic; color: var(--roxo-2); margin-bottom: auto; }
.briefing-type-card strong { font-size: 20px; margin: 28px 0 8px; }
.briefing-type-card small { color: var(--tinta-suave); font-size: 13.5px; line-height: 1.55; }
.back-link { border: 0; background: transparent; color: var(--tinta-suave); padding: 0; margin: 0 0 28px; font: inherit; font-size: 13px; cursor: pointer; }
.back-link:hover { color: var(--roxo); }

.progress-line { height: 2px; background: var(--linha); margin-bottom: 28px; position: relative; }
.progress-line span { position: absolute; inset: 0 auto 0 0; background: var(--roxo); transition: width .25s ease; }

.step-eyebrow {
  font-family: var(--serif);
  font-style: italic;
  color: var(--roxo-2);
  font-size: 14px;
  margin: 0 0 6px;
}

.step-title {
  font-size: 32px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.step-intro {
  color: var(--tinta-suave);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 32px;
  max-width: 56ch;
}

.field { margin-bottom: 26px; }

.field > label, .field > .group-label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--tinta-suave);
  margin-bottom: 8px;
}

.field .hint { font-size: 12.5px; color: var(--tinta-suave); margin-top: 6px; }

input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="url"], textarea, select {
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--linha-forte);
  background: transparent;
  padding: 10px 2px;
  font-size: 15.5px;
  font-family: var(--sans);
  color: var(--tinta);
  border-radius: 0;
}

textarea { resize: vertical; min-height: 90px; line-height: 1.55; border: 1px solid var(--linha-forte); border-radius: var(--radius); padding: 12px; }
textarea.big { min-height: 220px; }

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--roxo);
}

::placeholder { color: #a8a196; }

.options-row { display: flex; flex-wrap: wrap; gap: 10px; }

.chip {
  border: 1px solid var(--linha-forte);
  border-radius: 999px;
  padding: 8px 16px;
  font-size: 13.5px;
  cursor: pointer;
  background: var(--fundo-card);
  user-select: none;
  transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--roxo-2); }
.chip.selected { border-color: var(--roxo); background: var(--roxo); color: #fff; }

.bool-row { display: flex; align-items: center; gap: 12px; }
.switch {
  width: 40px; height: 22px; border-radius: 999px; background: var(--linha-forte);
  position: relative; cursor: pointer; flex: none; transition: background .15s;
}
.switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: left .15s;
}
.switch.on { background: var(--roxo); }
.switch.on::after { left: 20px; }

/* credenciais: destaque visual de "isso fica protegido" */
.field.sensitive {
  background: var(--alerta-bg);
  border: 1px dashed var(--alerta-borda);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.field.sensitive input { border-bottom-color: var(--alerta-borda); }

/* listas dinâmicas */
.list-rows { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.list-row { display: flex; gap: 8px; align-items: center; }
.list-row input { flex: 1; }
.icon-btn {
  border: 1px solid var(--linha-forte); background: var(--fundo-card); border-radius: var(--radius);
  width: 34px; height: 34px; flex: none; cursor: pointer; font-size: 16px; color: var(--tinta-suave);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { border-color: var(--roxo); color: var(--roxo); }
.add-row-btn {
  border: 1px dashed var(--linha-forte); background: transparent; border-radius: var(--radius);
  padding: 9px 14px; font-size: 13.5px; color: var(--roxo); cursor: pointer;
}
.add-row-btn:hover { border-color: var(--roxo); background: #f6f1fa; }

.service-card {
  border: 1px solid var(--linha); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; position: relative;
}
.service-card input { margin-bottom: 10px; }

/* sliders bipolares */
.slider-pair { margin-bottom: 24px; }
.slider-labels { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--tinta-suave); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.slider-pair input[type="range"] {
  width: 100%; appearance: none; height: 2px; background: var(--linha-forte); outline: none; margin: 0;
}
.slider-pair input[type="range"]::-webkit-slider-thumb {
  appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--roxo); cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--roxo);
}
.slider-pair input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; background: var(--roxo); cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--roxo);
}

/* ---------- footer / ações ---------- */

.step-actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--linha);
}

.btn {
  font-family: var(--sans); font-size: 14px; letter-spacing: .02em; cursor: pointer;
  border-radius: var(--radius); padding: 12px 22px; border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary { background: var(--roxo); color: #fff; }
.btn-primary:hover { background: #4a2270; }
.btn-primary:disabled { background: var(--linha-forte); cursor: default; }
.btn-ghost { background: transparent; color: var(--tinta-suave); border-color: var(--linha-forte); }
.btn-ghost:hover { border-color: var(--tinta); color: var(--tinta); }

.spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- toast ---------- */

#toast-host { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 50; }
.toast {
  background: var(--tinta); color: #fff; padding: 14px 18px; border-radius: var(--radius);
  font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.18); border-left: 3px solid var(--roxo-2);
  max-width: 340px; animation: toast-in .2s ease;
}
.toast.error { border-left-color: #c94b4b; }
@keyframes toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* watermark autoral discreto */
.mark-watermark {
  position: absolute; opacity: .05; width: 220px; pointer-events: none; right: -30px; bottom: -30px;
}

/* ---------- mobile ---------- */

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 20px; display: flex; align-items: center; justify-content: space-between; }
  .brand { margin-bottom: 0; }
  .brand img { height: 30px; }
  .steps-index { display: none; }
  .mobile-progress { display: block; font-size: 12px; color: var(--tinta-suave); text-align: right; }
  .main { padding: 28px 20px 100px; }
  .briefing-type-grid { grid-template-columns: 1fr; }
  .briefing-type-card { min-height: 170px; }
  .step-title { font-size: 24px; }
  .options-row { gap: 8px; }
  .chip { padding: 7px 13px; font-size: 13px; }
  #toast-host { left: 16px; right: 16px; bottom: 16px; }
  .toast { max-width: none; }
}

@media (min-width: 861px) {
  .mobile-progress { display: none; }
}
