/* ============================================================
   FORMULÁRIO — ENCOMENDA DE CHAVEIROS PERSONALIZADOS
   LieArt Design
   ============================================================
   Índice:
   1. Tokens (cores, fontes, espaçamentos)
   2. Reset & base
   3. Header / banner
   4. Barra de progresso
   5. Cards genéricos
   6. Etapa 1 — Quantidade
   7. Etapa 2 — Blocos de chaveiro
   8. Aviso sobre fotos (OK / EVITE)
   9. Etapa 3 — Dados do cliente + Resumo
   10. Etapa 4 — Confirmação
   11. Botões e navegação
   12. Responsivo
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Cores principais (extraídas da identidade já usada no formulário atual) */
  --maroon-escuro: #3E1E1C;
  --maroon-texto: #2E1613;
  --terracota: #C1714B;
  --terracota-hover: #A85D3A;
  --amarelo-mostarda: #D9A441;
  --verde-oliva: #7C8355;
  --vermelho-suave: #B14A3C;
  --bege-fundo: #EFE8E6;
  --bege-card: #FBF3E4;
  --branco: #FFFFFF;

  --texto: #3A2A22;
  --texto-suave: #8A7669;
  --borda-suave: #E4D9CE;

  /* Tipografia */
  --fonte-titulo: 'Baloo 2', system-ui, sans-serif;
  --fonte-corpo: 'Quicksand', system-ui, sans-serif;

  /* Espaçamentos */
  --raio: 18px;
  --raio-pequeno: 10px;
  --sombra: 0 4px 18px rgba(62, 30, 28, 0.08);
  --sombra-hover: 0 8px 24px rgba(62, 30, 28, 0.14);
}

/* ---------- 2. RESET & BASE ---------- */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--fonte-corpo);
  background: var(--bege-fundo);
  color: var(--texto);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--fonte-titulo);
  color: var(--maroon-texto);
  margin: 0;
}

p {
  margin: 0 0 8px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--texto);
}

input[type="text"],
input[type="tel"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--borda-suave);
  border-radius: var(--raio-pequeno);
  font-family: var(--fonte-corpo);
  font-size: 15px;
  color: var(--texto);
  background: var(--branco);
  transition: border-color 0.2s ease;
}

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

textarea {
  resize: vertical;
  min-height: 80px;
}

.campo {
  margin-bottom: 18px;
}

.campo-obs {
  font-size: 13px;
  color: var(--texto-suave);
  margin-top: 4px;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: 60px;
}

/* ---------- 3. HEADER / BANNER ---------- */
.banner {
  background: linear-gradient(135deg, var(--maroon-escuro), #522824);
  padding: 28px 24px 24px;
  color: var(--branco);
  border-radius: 0 0 28px 28px;
  position: relative;
  overflow: hidden;
}

.banner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
}

.banner-logo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.banner-logo-principal {
  height: 44px;
  width: auto;
  display: block;
}

.banner-logo-icone {
  height: 38px;
  width: auto;
  display: block;
  opacity: 0.95;
}

.banner-tagline {
  margin-top: 6px;
  font-size: 14.5px;
  opacity: 0.85;
  position: relative;
  z-index: 1;
}

/* ---------- 4. BARRA DE PROGRESSO ---------- */
.progress-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bege-fundo);
  padding: 14px 24px 10px;
}

.progress-track {
  height: 8px;
  background: var(--borda-suave);
  border-radius: 20px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 33.33%;
  background: linear-gradient(90deg, var(--terracota), var(--amarelo-mostarda));
  border-radius: 20px;
  transition: width 0.35s ease;
}

.progress-label {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--texto-suave);
  text-align: right;
}

/* ---------- 5. CARDS GENÉRICOS ---------- */
.card {
  background: var(--branco);
  border-radius: var(--raio);
  padding: 22px;
  margin: 16px 24px;
  box-shadow: var(--sombra);
}

.card h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.card .subtitulo {
  color: var(--texto-suave);
  font-size: 14px;
  margin-bottom: 16px;
}

.step {
  display: none;
}

.step.ativo {
  display: block;
}

/* ---------- 6. ETAPA 1 — QUANTIDADE ---------- */
.intro-tag {
  text-align: center;
  padding: 8px 0 4px;
}

.intro-tag .emoji {
  font-size: 34px;
}

.intro-tag h2 {
  font-size: 22px;
  margin: 8px 0 4px;
}

.intro-tag p {
  color: var(--texto-suave);
  font-size: 14.5px;
}

.stepper-qtd {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin: 22px 0 10px;
}

.stepper-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--terracota);
  background: var(--branco);
  color: var(--terracota);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper-btn:hover {
  background: var(--terracota);
  color: var(--branco);
}

.stepper-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  background: var(--branco);
  color: var(--terracota);
}

.stepper-valor {
  font-family: var(--fonte-titulo);
  font-size: 42px;
  color: var(--maroon-texto);
  min-width: 70px;
  text-align: center;
}

.stepper-legenda {
  text-align: center;
  font-size: 13px;
  color: var(--texto-suave);
  margin-bottom: 4px;
}

/* ---------- 7. ETAPA 2 — BLOCOS DE CHAVEIRO ---------- */
.bloco-chaveiro {
  background: var(--bege-card);
  border-radius: var(--raio);
  padding: 20px;
  margin-bottom: 18px;
  border: 1.5px dashed var(--amarelo-mostarda);
  position: relative;
}

.bloco-cabecalho {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.bloco-numero {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--terracota);
  color: var(--branco);
  font-family: var(--fonte-titulo);
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.bloco-chaveiro:nth-of-type(even) .bloco-numero {
  background: var(--maroon-escuro);
}

.bloco-titulo {
  font-family: var(--fonte-titulo);
  font-size: 17px;
  color: var(--maroon-texto);
}

.bloco-remover {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--vermelho-suave);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 8px;
}

.bloco-remover:hover {
  text-decoration: underline;
}

/* upload de foto */
.upload-area {
  border: 2px dashed var(--borda-suave);
  border-radius: var(--raio-pequeno);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  background: var(--branco);
  transition: border-color 0.2s ease;
}

.upload-area:hover {
  border-color: var(--terracota);
}

.upload-area input[type="file"] {
  display: none;
}

.upload-icone {
  font-size: 26px;
  display: block;
  margin-bottom: 4px;
}

.upload-texto {
  font-size: 13.5px;
  color: var(--texto-suave);
}

.upload-preview {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.upload-preview img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid var(--amarelo-mostarda);
}

.upload-preview .arquivo-generico {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 2px solid var(--amarelo-mostarda);
  background: var(--bege-fundo);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.upload-preview .nome-arquivo {
  font-size: 13px;
  color: var(--texto-suave);
  word-break: break-word;
  flex: 1;
}

.upload-preview .remover-foto {
  background: none;
  border: none;
  color: var(--vermelho-suave);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}

/* grade de expressões */
.expressoes-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 6px;
}

.expressao-opcao {
  position: relative;
  cursor: pointer;
}

.expressao-opcao input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.expressao-card {
  border: 2.5px solid transparent;
  border-radius: 14px;
  background: var(--branco);
  padding: 6px;
  text-align: center;
  transition: all 0.15s ease;
  position: relative;
}

.expressao-card img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: contain;
}

.expressao-sem-imagem {
  width: 100%;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px dashed var(--borda-suave);
  border-radius: 10px;
  font-size: 22px;
  color: var(--texto-suave);
}

.expressao-sem-imagem span {
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  padding: 0 4px;
}

.expressao-opcao input:checked + .expressao-card {
  border-color: var(--terracota);
  background: #FFF7EC;
  box-shadow: var(--sombra);
}

/* fundo (radio pill) */
.fundo-opcoes {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.fundo-opcao {
  flex: 1;
  cursor: pointer;
}

.fundo-opcao input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.fundo-pill {
  border: 2px solid var(--borda-suave);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--texto);
  transition: all 0.15s ease;
}

.fundo-opcao input:checked + .fundo-pill {
  border-color: var(--terracota);
  background: #FFF7EC;
  color: var(--terracota-hover);
}

/* botão adicionar chaveiro */
.btn-adicionar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px;
  border-radius: var(--raio-pequeno);
  border: 2px dashed var(--terracota);
  background: transparent;
  color: var(--terracota-hover);
  font-family: var(--fonte-corpo);
  font-weight: 700;
  font-size: 14.5px;
  cursor: pointer;
  transition: all 0.15s ease;
  margin-top: 4px;
}

.btn-adicionar:hover {
  background: #FFF7EC;
}

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

/* ---------- 8. AVISO SOBRE FOTOS ---------- */
.aviso-fotos {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.aviso-coluna h3 {
  font-size: 14.5px;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}

.aviso-coluna.ok h3 { color: var(--verde-oliva); }
.aviso-coluna.evite h3 { color: var(--vermelho-suave); }

.aviso-coluna ul {
  margin: 0;
  padding-left: 18px;
  font-size: 13.5px;
  color: var(--texto);
}

.aviso-coluna li {
  margin-bottom: 6px;
}

.aviso-contato {
  grid-column: 1 / -1;
  margin-top: 10px;
  font-size: 13px;
  color: var(--texto-suave);
  border-top: 1px solid var(--borda-suave);
  padding-top: 12px;
}

.aviso-contato a {
  color: var(--terracota-hover);
  font-weight: 700;
  text-decoration: none;
}

/* ---------- 9. ETAPA 3 — CLIENTE + RESUMO ---------- */
.resumo-card {
  background: var(--bege-card);
  border-radius: var(--raio-pequeno);
  padding: 18px;
  margin-top: 8px;
  border: 1.5px solid var(--amarelo-mostarda);
}

.resumo-card h3 {
  font-size: 15px;
  margin-bottom: 10px;
  color: var(--maroon-texto);
}

.resumo-linha {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--borda-suave);
}

.resumo-linha:last-child {
  border-bottom: none;
}

.resumo-linha span:first-child {
  color: var(--texto-suave);
}

.resumo-linha span:last-child {
  font-weight: 700;
  text-align: right;
  max-width: 60%;
}

.resumo-bloco-titulo {
  font-weight: 700;
  color: var(--terracota-hover);
  margin-top: 12px;
  margin-bottom: 4px;
  font-size: 13px;
}

/* ---------- 10. CONFIRMAÇÃO ---------- */
.confirmacao {
  text-align: center;
  padding: 30px 10px;
}

.confirmacao .emoji {
  font-size: 48px;
}

.confirmacao h2 {
  font-size: 22px;
  margin: 10px 0 6px;
}

.confirmacao p {
  color: var(--texto-suave);
  font-size: 14.5px;
}

/* ---------- 11. BOTÕES E NAVEGAÇÃO ---------- */
.btn-primary,
.btn-secondary {
  padding: 14px 26px;
  border-radius: 50px;
  font-family: var(--fonte-corpo);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}

.btn-primary {
  background: var(--terracota);
  color: var(--branco);
  box-shadow: 0 4px 14px rgba(193, 113, 75, 0.35);
}

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

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: transparent;
  color: var(--texto-suave);
  border: 2px solid var(--borda-suave);
}

.btn-secondary:hover {
  border-color: var(--terracota);
  color: var(--terracota-hover);
}

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 22px;
}

.step-nav .btn-primary,
.step-nav .btn-secondary {
  flex: 1;
}

.acao-central {
  text-align: center;
  margin-top: 20px;
}

.erro-campo {
  color: var(--vermelho-suave);
  font-size: 12.5px;
  margin-top: 4px;
  display: none;
}

.campo.invalido input,
.campo.invalido select,
.campo.invalido .upload-area {
  border-color: var(--vermelho-suave);
}

.campo.invalido .erro-campo {
  display: block;
}

/* ---------- 12. RESPONSIVO ---------- */
@media (max-width: 480px) {
  .banner {
    padding: 22px 18px 18px;
    border-radius: 0 0 22px 22px;
  }

  .banner-logo-principal {
    height: 32px;
  }

  .banner-logo-icone {
    height: 28px;
  }

  .card {
    margin: 12px 14px;
    padding: 18px;
  }

  .progress-header {
    padding: 12px 16px 8px;
  }

  .expressoes-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .aviso-fotos {
    grid-template-columns: 1fr;
  }

  .stepper-valor {
    font-size: 34px;
    min-width: 54px;
  }
}
