/* ================================================
   Skalary — Onboarding de Clientes
   Fundo #0B0A07 · texto #F7F5F0 · dourado #D4AF37
   O dourado é a exceção, não a regra: barra de
   progresso, foco, botão principal e o ponto do
   wordmark. Mais nada.
   ================================================ */

:root {
  --bg:        #0B0A07;
  --fg:        #F7F5F0;
  --gold:      #D4AF37;
  --gold-dim:  rgba(212, 175, 55, 0.32);

  /* Cinzentos derivados do fundo, não neutros puros — encostam ao quente
     do #0B0A07 em vez de destoarem para azul. */
  --muted:     #A9A498;  /* 7.3:1 sobre o fundo — legível a sério */
  --faint:     #7C776C;  /* 4.6:1 — só para texto de apoio curto */
  --line:      rgba(247, 245, 240, 0.13);
  --line-str:  rgba(247, 245, 240, 0.24);
  --surface:   #121009;
  --surface-2: #17140C;
  --danger:    #E8705E;

  --radius:    14px;
  --radius-lg: 20px;
  --maxw:      680px;
}

* { box-sizing: border-box; }

/* O atributo hidden esconde-se com display:none vindo do browser, que perde
   para qualquer regra nossa com display (.btn é inline-flex, .logo-preview é
   flex). Sem isto, elementos marcados como escondidos aparecem na mesma. */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 20px 80px;
}

@media (min-width: 640px) {
  .wrap { padding: 64px 24px 96px; }
}

/* ---------- Marca ---------- */

.brand { text-align: center; margin-bottom: 44px; }

.wordmark {
  margin: 0;
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1;
  display: inline-flex;
  align-items: flex-end;
  gap: 4px;
}

.wordmark .dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--gold);
  margin-bottom: 3px;
}

.brand-sub {
  margin: 12px 0 0;
  font-size: 14px;
  color: var(--muted);
  letter-spacing: 0.01em;
}

/* ---------- Passos e progresso ---------- */

.steps { margin-bottom: 32px; }

.steps-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.step-chip {
  width: 100%;
  background: none;
  border: 0;
  padding: 6px 2px;
  color: var(--faint);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  transition: color .2s ease;
}

.step-chip:disabled { cursor: default; }

.step-num {
  width: 27px;
  height: 27px;
  border-radius: 50%;
  border: 1px solid var(--line-str);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 500;
  transition: all .25s ease;
}

.step-name {
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.step-chip.is-done { color: var(--muted); }
.step-chip.is-done .step-num {
  border-color: var(--gold-dim);
  color: var(--gold);
}

.step-chip.is-active { color: var(--fg); }
.step-chip.is-active .step-num {
  background: var(--gold);
  border-color: var(--gold);
  color: #0B0A07;
  font-weight: 600;
}

.progress {
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 25%;
  background: var(--gold);
  border-radius: 2px;
  transition: width .35s cubic-bezier(.4, 0, .2, 1);
}

/* ---------- Cartão ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
}

@media (min-width: 640px) {
  .card { padding: 40px 36px; }
}

.step-head { margin-bottom: 32px; }

.step-head h2 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

@media (min-width: 640px) {
  .step-head h2 { font-size: 31px; }
}

.step-head p {
  margin: 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Campos ---------- */

.field { margin-bottom: 22px; }
.field.sub { margin-bottom: 0; margin-top: 14px; }

label,
.label-lg {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--fg);
}

.label-lg { font-size: 15px; font-weight: 600; }

.opt {
  color: var(--faint);
  font-weight: 400;
}

.hint {
  margin: 7px 0 0;
  font-size: 12.5px;
  color: var(--faint);
  line-height: 1.45;
}

.label-lg + .hint { margin: -3px 0 10px; }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="number"],
textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--line-str);
  border-radius: var(--radius);
  padding: 13px 15px;
  color: var(--fg);
  font: inherit;
  font-size: 16px; /* 16px trava o zoom automático do Safari em iOS */
  transition: border-color .18s ease, box-shadow .18s ease;
}

textarea { resize: vertical; min-height: 84px; line-height: 1.5; }

input::placeholder,
textarea::placeholder { color: var(--faint); }

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.13);
}

input.has-error,
textarea.has-error { border-color: var(--danger); }

.err {
  margin: 6px 0 0;
  font-size: 12.5px;
  color: var(--danger);
  display: none;
}
.err.show { display: block; }

.row-2, .row-3 { display: grid; gap: 14px; }
.row-2 { grid-template-columns: 1fr; }
.row-3 { grid-template-columns: repeat(3, 1fr); }

@media (min-width: 560px) {
  .row-2 { grid-template-columns: 1fr 1fr; }
}

.row-2 .field, .row-3 .field { margin-bottom: 22px; }

/* ---------- Grupos ---------- */

.group {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

/* Títulos de secção dentro de um passo. Brancos e com um halo suave para se
   destacarem do corpo do formulário sem gastar o dourado, que fica reservado
   para o que é acionável. */
.group h3 {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: #FFFFFF;
  text-shadow: 0 0 24px rgba(247, 245, 240, 0.30);
}

.group h3 .opt {
  font-size: 15px;
  font-weight: 400;
  color: var(--faint);
  text-shadow: none;
}

.group h3 + .field,
.group h3 + .row-2,
.group h3 + .row-3 { margin-top: 18px; }

.group-note {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--muted);
  max-width: 46ch;
}

/* ---------- Checkboxes de serviços ---------- */

.checkgrid { display: grid; grid-template-columns: 1fr; gap: 8px; }

@media (min-width: 560px) {
  .checkgrid { grid-template-columns: 1fr 1fr; }
}

.check {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border: 1px solid var(--line-str);
  border-radius: var(--radius);
  background: var(--surface-2);
  cursor: pointer;
  font-size: 14px;
  transition: border-color .18s ease, background .18s ease;
}

.check:hover { border-color: var(--line-str); background: #1B1710; }

.check input { position: absolute; opacity: 0; pointer-events: none; }

.check .box {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  border: 1px solid var(--line-str);
  border-radius: 5px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: transparent;
  transition: all .18s ease;
}

.check input:checked ~ .box {
  background: var(--gold);
  border-color: var(--gold);
  color: #0B0A07;
}

.check input:focus-visible ~ .box {
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.2);
}

.check:has(input:checked) { border-color: var(--gold-dim); }

/* ---------- Chips / etiquetas ---------- */

.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.chips:empty { margin-top: 0; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 8px 5px 11px;
  background: var(--surface-2);
  border: 1px solid var(--line-str);
  border-radius: 999px;
  font-size: 13px;
}

.chip button {
  background: none;
  border: 0;
  color: var(--faint);
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  padding: 0 2px;
  transition: color .15s ease;
}
.chip button:hover { color: var(--danger); }

.inline-add { display: flex; gap: 8px; }
.inline-add input { flex: 1; }

.tagbox {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  min-height: 50px;
  padding: 8px 10px;
  background: var(--surface-2);
  border: 1px solid var(--line-str);
  border-radius: var(--radius);
  cursor: text;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.tagbox:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.13);
}

.tagbox input {
  flex: 1;
  min-width: 130px;
  background: none;
  border: 0;
  padding: 4px 2px;
  color: var(--fg);
  font: inherit;
  font-size: 15px;
}
.tagbox input:focus { outline: none; box-shadow: none; }

/* ---------- Cores ---------- */

.colorpick { display: flex; align-items: center; gap: 9px; }

.colorpick input[type="color"] {
  width: 42px;
  height: 42px;
  padding: 3px;
  border: 1px solid var(--line-str);
  border-radius: 11px;
  background: var(--surface-2);
  cursor: pointer;
}
.colorpick input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.colorpick input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 7px; }

.colorval {
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--muted);
}

@media (max-width: 460px) {
  .row-3 { grid-template-columns: 1fr; }
  .colorpick { gap: 12px; }
}

/* ---------- Upload ---------- */

.drop {
  border: 1px dashed var(--line-str);
  border-radius: var(--radius);
  padding: 26px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease;
}

.drop-lg { padding: 36px 18px; }

.drop:hover,
.drop:focus-visible {
  border-color: var(--gold-dim);
  background: rgba(212, 175, 55, 0.03);
  outline: none;
}

.drop.is-over {
  border-color: var(--gold);
  background: rgba(212, 175, 55, 0.07);
}

.drop-inner { display: flex; flex-direction: column; align-items: center; gap: 7px; }

.drop-ico { font-size: 26px; color: var(--faint); line-height: 1; }
.drop-title { margin: 0; font-size: 14px; font-weight: 500; }
.drop-sub { margin: 0; font-size: 12.5px; color: var(--faint); }

.logo-preview {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line-str);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.logo-preview img { height: 52px; width: auto; max-width: 130px; object-fit: contain; border-radius: 6px; }
.logo-preview .meta { flex: 1; min-width: 0; }
.logo-preview .name { margin: 0; font-size: 14px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo-preview .size { margin: 2px 0 0; font-size: 12px; color: var(--faint); }

.grid-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 14px;
}
.grid-thumbs:empty { margin-top: 0; }

@media (min-width: 560px) { .grid-thumbs { grid-template-columns: repeat(4, 1fr); } }

.thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface-2);
}

.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

.thumb .rm {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 23px;
  height: 23px;
  border: 0;
  border-radius: 50%;
  background: rgba(11, 10, 7, 0.78);
  color: var(--fg);
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background .15s ease;
}
.thumb .rm:hover { background: var(--danger); }

.thumb.is-failed { border-color: var(--danger); }
.thumb.is-done::after {
  content: '✓';
  position: absolute;
  bottom: 5px;
  left: 6px;
  font-size: 12px;
  color: var(--gold);
  text-shadow: 0 1px 3px #0B0A07;
}

/* ---------- Remarketing ---------- */

.label-inline { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.label-inline label { margin-bottom: 0; }

.help-btn {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  border: 1px solid var(--line-str);
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: all .18s ease;
}
.help-btn:hover { color: var(--gold); border-color: var(--gold-dim); }

.help-box {
  margin: 0 0 14px;
  padding: 15px 16px;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  background: rgba(212, 175, 55, 0.045);
  font-size: 13.5px;
  line-height: 1.55;
}
.help-box p { margin: 0 0 9px; }
.help-box p:last-child { margin-bottom: 0; }
.help-title { font-weight: 600; }
.help-muted { color: var(--muted); }

.wa-preview {
  background: #ECE5DD;
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.wa-bubble {
  margin-left: auto;
  max-width: 86%;
  background: #DCF8C6;
  color: #111;
  border-radius: 10px 3px 10px 10px;
  padding: 9px 11px;
  font-size: 13.5px;
  line-height: 1.45;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}
.wa-bubble p { margin: 0 0 5px; }
.wa-bubble p:last-of-type { margin-bottom: 0; }
.wa-link { color: #039BE5; text-decoration: underline; word-break: break-all; }
.wa-meta { display: block; text-align: right; font-size: 10px; color: rgba(0, 0, 0, 0.45); margin-top: 3px; }

/* ---------- Estado de envio ---------- */

.upload-status { margin: 22px 0 0; }
.upload-label { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.upload-bar { height: 3px; background: var(--line); border-radius: 3px; overflow: hidden; }
.upload-fill { height: 100%; width: 0; background: var(--gold); border-radius: 3px; transition: width .3s ease; }

.alert-error {
  margin: 22px 0 0;
  padding: 15px 16px;
  border: 1px solid rgba(232, 112, 94, 0.45);
  border-radius: var(--radius);
  background: rgba(232, 112, 94, 0.07);
  font-size: 13.5px;
}
.alert-error p { margin: 0; }
.alert-error ul { margin: 9px 0 0; padding-left: 18px; font-size: 12.5px; color: rgba(232, 112, 94, 0.9); }
.alert-error li { word-break: break-all; }
.error-contact { margin-top: 11px !important; color: var(--muted); font-size: 12.5px; }
.error-contact a { color: var(--gold); }

/* ---------- Botões ---------- */

.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .18s ease, background .18s ease, border-color .18s ease;
}

.btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.btn-primary { background: var(--gold); color: #0B0A07; font-weight: 600; }
.btn-primary:hover { opacity: .88; }

.btn-ghost { background: none; color: var(--muted); border-color: var(--line-str); }
.btn-ghost:hover { color: var(--fg); border-color: var(--fg); }

.btn-sm { padding: 13px 16px; font-size: 14px; }

.btn-block { width: 100%; }

.btn:disabled { opacity: .5; cursor: not-allowed; }

.chev { font-size: 14px; }

/* ---------- Bloco de submissão ---------- */

.submit-block {
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

/* O aviso ocupa exatamente a largura do botão que está por baixo, fica um
   degrau abaixo do corpo do formulário (13px vs 16px) e usa --muted, que
   dá 7.3:1 sobre o fundo — discreto sem ser cinzento sobre cinzento. */
.privacy {
  width: 100%;
  margin: 0 0 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
  text-align: center;
}

.privacy a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.privacy a:hover { opacity: .8; }

.submit-block .btn-ghost { margin-top: 10px; border-color: transparent; }
.submit-block .btn-ghost:hover { border-color: var(--line-str); }

/* ---------- Sucesso ---------- */

.success { text-align: center; padding-top: 52px; padding-bottom: 52px; }

.success-mark {
  width: 62px;
  height: 62px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-dim);
  color: var(--gold);
  font-size: 26px;
  display: grid;
  place-items: center;
}

.success h2 {
  margin: 0 0 10px;
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.success-sub {
  margin: 0 auto 22px;
  max-width: 400px;
  color: var(--muted);
  font-size: 14.5px;
}

.success-note {
  margin: 0 auto;
  max-width: 400px;
  font-size: 13.5px;
  color: var(--muted);
}

/* Aviso de ficheiros que não subiram. Não é um erro — as respostas já estão
   guardadas — por isso não usa o vermelho de falha. */
.success-warn {
  margin: 0 0 18px;
  padding: 13px 15px;
  border: 1px solid var(--gold-dim);
  border-radius: var(--radius);
  background: rgba(212, 175, 55, 0.05);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--fg);
  text-align: left;
}

.success-help {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--muted);
}

.success-help a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.success-help a:hover { opacity: .8; }

/* ---------- Honeypot ---------- */

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* ---------- Movimento ---------- */

.step { animation: rise .32s cubic-bezier(.4, 0, .2, 1); }

@keyframes rise {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
