/* APM27 — Reserva de estandes
   Linguagem visual dos mockups: azul #052EC6, campos em pílula branca,
   botão preto, header/footer brancos. */

:root {
  --azul: #052EC6;
  --azul-escuro: #04166B;
  --preto: #111;
  --cinza: #F3F4F8;
  --borda: #E2E2EA;
  --texto-fraco: #6B7280;
  --livre: #CBD6FA;
  --ocupado: #E5342F;
  --raio: 14px;
  --sombra: 0 8px 30px rgba(0, 0, 0, .18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font-family: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--preto);
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font: inherit; }

/* ---------- header / footer ---------- */

.topo {
  flex: 0 0 auto;
  height: 58px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px;
  border-bottom: 2px solid #1a1a5e;
  background: #fff; z-index: 20;
}
.topo h1 { font-size: 19px; font-weight: 800; letter-spacing: -.3px; }
.topo img { height: 34px; }
.topo-links { display: none; gap: 18px; align-items: center; }
.topo .so-mobile { display: block; }
.topo-links a { font-size: 13px; font-weight: 700; color: #444; text-decoration: none; }

.rodape {
  flex: 0 0 auto;
  height: 40px;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  border-top: 1px solid #ececec; background: #fff; z-index: 20;
}
.rodape span { font-size: 11px; color: #444; }
.rodape img { height: 22px; }

/* ---------- palco ---------- */

.palco { flex: 1 1 auto; display: flex; min-height: 0; position: relative; background: var(--cinza); }

.mapa-area { flex: 1 1 auto; position: relative; min-width: 0; }
.mapa { position: absolute; inset: 0; touch-action: none; }
.planta-svg { width: 100%; height: 100%; display: block; }
.planta-fundo { pointer-events: none; }

.stand { cursor: pointer; outline: none; }
.stand:focus-visible rect { stroke: #000; stroke-width: 3; }
.stand.is-ocupado, .stand.is-bloqueado { cursor: not-allowed; }
.stand-num { display: none; font-weight: 700; pointer-events: none; }
.planta-svg.mostra-num .stand-num { display: block; }
@media (hover: hover) {
  .stand:not(.is-ocupado):not(.is-bloqueado):hover rect { stroke-width: 2.6; }
}

/* ---------- legenda ---------- */

.legenda {
  position: absolute; left: 0; right: 0; top: 0; z-index: 6;
  background: rgba(255, 255, 255, .97);
  border-bottom: 1px solid var(--borda);
  padding: 8px 12px;
}
.legenda-linha { display: flex; gap: 12px; flex-wrap: wrap; }
.legenda-linha + .legenda-linha { margin-top: 6px; }
.chip { display: flex; align-items: center; gap: 5px; font-size: 10.5px; font-weight: 700; color: #333; }
.chip .quadro { width: 13px; height: 11px; border-radius: 3px; }
.chip .bola { width: 9px; height: 9px; border-radius: 50%; }

/* ---------- controles do mapa ---------- */

.controles {
  position: absolute; right: 12px; bottom: 58px; z-index: 6;
  background: #fff; border: 1px solid #DCDCE4; border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .12); overflow: hidden;
}
.controles button {
  display: block; width: 36px; height: 34px;
  font-size: 17px; font-weight: 800; color: #333;
}
.controles button + button { border-top: 1px solid #EFEFF4; }
.controles .fit { font-size: 9.5px; color: var(--azul); }

.dica {
  position: absolute; left: 12px; right: 60px; bottom: 12px; z-index: 6;
  background: rgba(17, 17, 17, .85); color: #fff;
  border-radius: 999px; padding: 8px 14px;
  font-size: 11px; font-weight: 600; text-align: center;
  pointer-events: none; transition: opacity .3s;
}

.carregando {
  position: absolute; inset: 0; z-index: 30;
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
  background: #fff; font-size: 13px; color: var(--texto-fraco); font-weight: 700;
}
.girando {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid #DDE3F8; border-top-color: var(--azul);
  animation: girar .8s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* ---------- barra lateral (só desktop) ---------- */

.lateral { display: none; }

/* ---------- painel / modal azul ---------- */

.cortina {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(8, 12, 40, .55);
  display: none; align-items: center; justify-content: center; padding: 16px;
}
.cortina.aberta { display: flex; }

.painel {
  background: var(--azul); border-radius: 30px; color: #fff;
  width: 100%; max-width: 420px; max-height: 100%;
  display: flex; flex-direction: column; position: relative;
  box-shadow: var(--sombra);
}
.painel-corpo { padding: 24px 22px 18px; overflow-y: auto; }
.painel-rodape { padding: 0 22px 20px; display: flex; flex-direction: column; gap: 10px; }
.painel-rodape.lado-a-lado { flex-direction: row; }
.painel-rodape.lado-a-lado .botao { flex: 1; }

.fechar {
  position: absolute; top: 14px; right: 16px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255, 255, 255, .22); color: #fff;
  font-size: 17px; font-weight: 800; line-height: 1;
}

.painel h2 { font-size: 27px; font-weight: 800; text-align: center; letter-spacing: -.5px; }
.painel .sub { font-size: 14px; font-weight: 700; text-align: center; margin-top: 3px; opacity: .92; }
.painel .etapa {
  text-align: center; font-size: 10px; font-weight: 800; letter-spacing: 1.2px;
  opacity: .72; margin-top: 10px;
}

.selo {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  background: rgba(255, 255, 255, .18); border-radius: 999px;
  padding: 6px 14px; margin: 12px auto 0; width: fit-content;
}
.selo .bola { width: 10px; height: 10px; border-radius: 50%; }
.selo span { font-size: 11px; font-weight: 800; letter-spacing: .5px; }

.lista { background: rgba(255, 255, 255, .12); border-radius: 18px; padding: 2px 16px; margin-top: 16px; }
.lista .linha { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 9px 0; }
.lista .linha + .linha { border-top: 1px solid rgba(255, 255, 255, .18); }
.lista .rotulo { font-size: 11.5px; font-weight: 700; opacity: .78; flex: 0 0 auto; }
.lista .valor { font-size: 12.5px; font-weight: 800; text-align: right; word-break: break-word; }

.preco { text-align: center; margin-top: 18px; }
.preco .rotulo { font-size: 10.5px; font-weight: 700; letter-spacing: 1px; opacity: .75; }
.preco .valor { font-size: 32px; font-weight: 800; letter-spacing: -1px; margin-top: 2px; }
.preco .parcela { font-size: 11px; font-weight: 600; opacity: .75; margin-top: 3px; }
.badge-indisponivel {
  display: table; margin: 12px auto 0; padding: 7px 16px;
  border-radius: 999px; background: #D12424; color: #fff;
  font-size: 12px; font-weight: 900; letter-spacing: .7px;
}

.aviso-ocupado {
  background: rgba(0, 0, 0, .25); border-radius: 16px; padding: 14px 16px;
  margin-top: 18px; font-size: 13px; line-height: 1.5; text-align: center;
}

/* ---------- formulário ---------- */

.secao-titulo { font-size: 11px; font-weight: 800; letter-spacing: 1.2px; opacity: .8; margin: 18px 0 8px; }
.campos { display: flex; flex-direction: column; gap: 9px; }
.par { display: flex; gap: 9px; }
.par > .campo { flex: 1; min-width: 0; }
.localidade { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) 82px; gap: 9px; }
.localidade .campo { min-width: 0; }
.localidade select { padding: 0 6px 0 11px; }

.campo { position: relative; }
.campo input, .campo select {
  width: 100%; height: 44px; border-radius: 999px; border: 2px solid transparent;
  background: #fff; padding: 0 18px; font-size: 14px; font-weight: 700; color: #111;
}
.campo input::placeholder { color: #8A8785; font-weight: 700; }
.campo input:focus, .campo select:focus { outline: none; border-color: #0B1C7A; }
.campo.erro input, .campo.erro select { border-color: #D12424; border-width: 3px; background: #FFF4F4; color: #AD1717; }
.campo.erro input::placeholder { color: #AD1717; }
.campo .msg { display: none; font-size: 11px; font-weight: 800; padding: 5px 12px; color: #AD1717; }
.campo.erro .msg { display: block; background: #FFF4F4; border-radius: 8px; margin-top: 4px; }

/* escolha Sim/Não — a ficha oficial pede explicitamente um dos dois */
.escolha .opcoes { display: flex; gap: 9px; }
.escolha .opcao {
  flex: 1; height: 44px; border-radius: 999px; background: rgba(255, 255, 255, .16);
  border: 2px solid transparent; display: flex; align-items: center; justify-content: center;
  gap: 8px; font-size: 14px; font-weight: 800; color: #fff; cursor: pointer;
  transition: background .15s;
}
.escolha .opcao input { width: 17px; height: 17px; accent-color: #fff; }
.escolha .opcao:has(input:checked) { background: #fff; color: var(--azul); }
.escolha.erro .opcao { border-color: #D12424; }
.escolha .opcao:has(input:disabled) { opacity: .52; cursor: not-allowed; }
.campo-parcelas { display: block; margin-top: 10px; }
.campo-legenda { display: block; margin-bottom: 6px; font-size: 10px; font-weight: 800; letter-spacing: .8px; color: #fff; }
.pagamento-ajuda { font-size: 11px; line-height: 1.4; opacity: .86; margin-top: 7px; }

/* ---------- botões ---------- */

.botao {
  height: 48px; border-radius: 999px; background: var(--preto); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; padding: 0 28px; width: 100%;
  transition: transform .1s, opacity .2s;
}
.botao:active { transform: scale(.985); }
.botao[disabled] { opacity: .6; cursor: progress; }
.botao.contorno { background: transparent; border: 2px solid #fff; }
.botao.claro { background: #fff; color: var(--azul); }

/* ---------- sucesso ---------- */

.sucesso { text-align: center; padding: 10px 0 4px; }
.anel {
  width: 88px; height: 88px; border-radius: 50%; border: 5px solid #fff;
  margin: 0 auto 20px; display: flex; align-items: center; justify-content: center;
  font-size: 44px; font-weight: 800; line-height: 1;
}
.sucesso h2 { font-size: 21px; line-height: 1.3; }
.sucesso p { font-size: 14px; font-weight: 600; margin-top: 12px; line-height: 1.5; opacity: .94; }
.caixa-codigo {
  background: rgba(255, 255, 255, .15); border-radius: 18px;
  padding: 14px; margin-top: 20px;
}
.caixa-codigo .rotulo { font-size: 10px; font-weight: 800; letter-spacing: 1px; opacity: .78; }
.caixa-codigo .valor { font-size: 22px; font-weight: 800; margin-top: 3px; letter-spacing: 1px; }

/* ---------- modal de erro (REGRA #2: nada técnico na tela) ---------- */

.erro-modal { background: #fff; color: #111; border-radius: 24px; padding: 26px 24px 20px; max-width: 380px; width: 100%; }
.erro-modal .icone {
  width: 54px; height: 54px; border-radius: 50%; background: #FFF0F0; color: #D42B2B;
  display: flex; align-items: center; justify-content: center;
  font-size: 27px; font-weight: 800; margin: 0 auto 16px;
}
.erro-modal h3 { font-size: 18px; font-weight: 800; text-align: center; }
.erro-modal p { font-size: 14px; color: #555; text-align: center; margin-top: 10px; line-height: 1.5; }
.erro-modal .botao { margin-top: 20px; background: var(--azul); }

/* ---------- desktop ---------- */

@media (min-width: 900px) {
  .topo { height: 62px; padding: 0 26px; }
  .topo h1 { font-size: 22px; }
  .topo-links { display: flex; }
  .topo .so-mobile { display: none; }

  .lateral {
    display: flex; flex-direction: column;
    flex: 0 0 258px; background: #fff; border-right: 1px solid #ECECF2;
    padding: 18px 16px 12px; overflow-y: auto;
  }
  .lateral h2 { font-size: 15px; font-weight: 800; }
  .lateral .ajuda { font-size: 11.5px; color: var(--texto-fraco); margin-top: 3px; line-height: 1.45; }
  .contadores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; }
  .contador:last-child { grid-column: 1 / -1; }
  .contador { flex: 1; background: #F5F6FA; border: 1px solid #EAEAF0; border-radius: 10px; padding: 9px 11px; }
  .contador .rotulo { font-size: 9.5px; font-weight: 800; color: #8A8A96; letter-spacing: .5px; }
  .contador .valor { font-size: 21px; font-weight: 800; margin-top: 1px; }
  .contador .valor.azul { color: var(--azul); }
  .contador .valor.vermelho { color: #D42B2B; }
  .contador .valor.cinza { color: #6B7280; }
  .filtro-titulo { font-size: 10px; font-weight: 800; color: #8A8A96; letter-spacing: 1px; margin-bottom: 7px; }
  .filtro { display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 8px; cursor: pointer; }
  .filtro:hover { background: #F6F7FB; }
  .filtro input { width: 15px; height: 15px; accent-color: var(--azul); }
  .filtro .bola { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
  .filtro .nome { flex: 1; font-size: 12px; font-weight: 700; }
  .filtro .qtd { font-size: 10px; color: #9A9AA6; font-weight: 700; }
  .filtro .valor { font-size: 11px; font-weight: 800; color: #555; }
  .busca {
    width: 100%; height: 36px; border-radius: 9px; border: 1.5px solid #E0E0E8;
    padding: 0 12px; font-size: 12.5px; font-weight: 600; margin-bottom: 14px;
  }
  .busca:focus { outline: none; border-color: var(--azul); }
  .lateral .nota { margin-top: auto; font-size: 10.5px; color: #9A9AA6; line-height: 1.5; padding-top: 14px; }

  .legenda { left: auto; right: 12px; top: 12px; border: 1px solid var(--borda); border-radius: 12px; width: auto; }
  .legenda-linha { flex-direction: column; gap: 5px; }

  .dica { left: 16px; right: auto; max-width: 340px; bottom: 16px; }
  .controles { bottom: 16px; right: 16px; }

  /* O painel do estande vira coluna lateral: o mapa continua visível. */
  .cortina.lateral-desktop {
    position: static; display: none; background: none; padding: 0;
    flex: 0 0 372px; align-items: stretch;
  }
  .cortina.lateral-desktop.aberta { display: flex; }
  .cortina.lateral-desktop .painel {
    max-width: none; border-radius: 0; box-shadow: -6px 0 24px rgba(0, 0, 0, .1);
  }
  .cortina.lateral-desktop .painel-corpo { padding: 28px 26px 18px; }
  .cortina.lateral-desktop .painel-rodape { padding: 0 26px 24px; margin-top: auto; }
  .cortina.lateral-desktop .painel h2 { text-align: left; font-size: 32px; }
  .cortina.lateral-desktop .painel .sub { text-align: left; }
  .cortina.lateral-desktop .selo { margin-left: 0; }
  .cortina.lateral-desktop .badge-indisponivel { margin-left: 0; }
  .cortina.lateral-desktop .preco { text-align: left; }

  /* Formulário e revisão ficam em folha larga de 2 colunas. */
  .painel.largo { max-width: 880px; border-radius: 30px; }
  .painel.largo .painel-corpo { padding: 28px 32px 8px; }
  .painel.largo .painel-rodape { flex-direction: row; justify-content: center; padding: 8px 32px 26px; }
  .painel.largo .painel-rodape .botao { width: auto; min-width: 190px; }
  .colunas { display: flex; gap: 26px; }
  .colunas > * { flex: 1; min-width: 0; }
  .painel.largo h2 { font-size: 30px; }
}

@media (max-width: 899px) {
  .colunas { display: block; }
  .painel.largo { max-width: 420px; }
}

@media (max-width: 360px) {
  .localidade { grid-template-columns: minmax(0, 1fr) 82px; }
  .localidade .campo:first-child { grid-column: 1 / -1; }
}
