/*
  A página principal do PassFlash (#596). CSS à mão, sem framework, sem tipos de letra nem imagens de terceiros.

  As cores vêm do packages/ui-tokens (light-colors.ts e admin-dark-colors.ts), copiadas para aqui: esta pasta não
  depende de nenhum pacote. O realce é o azul de cianotipia (#1d4f91); à noite é o mesmo azul aclarado.
  Contrastes (WCAG AA, 4,5:1 no texto): claro, texto #161b22 e #4f5b6b sobre #f1f3f6, branco sobre #1d4f91;
  escuro, #e6ebf2 e #a2aebe sobre #111823, #0c1828 sobre #8cb4ee.
*/

:root {
  color-scheme: light dark;

  --fundo: #f1f3f6;
  --texto: #161b22;
  --apagado: #4f5b6b;
  --realce: #1d4f91;
  --sobre-realce: #ffffff;
  --linha: #dce1e8;
  --faixa: #e6edf7;

  /* O topo: cianotipia, um azul cheio com a quadrícula de uma planta. */
  --topo-fundo: #1d4f91;
  --topo-texto: #ffffff;
  --topo-apagado: #d6e2f4;
  --topo-quadricula: rgb(255 255 255 / 9%);
  --topo-ladrilho: #f4f7fb;
  --topo-tinta: #0c1828;
  --topo-botao: #ffffff;
  --topo-sobre-botao: #1d4f91;

  --foco: #1d4f91;
  --entrada: #7a8596;
  --campo-fundo: #ffffff;
  --erro: #b42318;

  --fonte:
    'Avenir Next', 'Segoe UI Variable Text', 'Segoe UI', system-ui, -apple-system, 'Helvetica Neue',
    Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fundo: #111823;
    --texto: #e6ebf2;
    --apagado: #a2aebe;
    --realce: #8cb4ee;
    --sobre-realce: #0c1828;
    --linha: #2b3646;
    --faixa: #18212d;

    --topo-fundo: #162a45;
    --topo-texto: #e6ebf2;
    --topo-apagado: #b4c3d8;
    --topo-quadricula: rgb(140 180 238 / 11%);
    --topo-ladrilho: #e6ebf2;
    --topo-botao: #8cb4ee;
    --topo-sobre-botao: #0c1828;

    --foco: #8cb4ee;
    --entrada: #6b7a8f;
    --campo-fundo: #18212d;
    --erro: #ff9184;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 1.0625rem;
  line-height: 1.6;
}

h1,
h2,
h3,
p,
ol,
ul,
dl,
dd {
  margin: 0;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--foco);
  outline-offset: 3px;
}

.miolo {
  width: 100%;
  max-width: 74rem;
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 3rem);
}

.pular {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  background: var(--realce);
  color: var(--sobre-realce);
  font-weight: 700;
}

.pular:focus {
  top: 1rem;
}

/* A marca: um relâmpago e o nome, tudo texto e uma forma, sem imagem. */
.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  text-decoration: none;
}

.marca svg {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
}

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.5rem 1.5rem;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--botao-fundo, var(--realce));
  color: var(--botao-texto, var(--sobre-realce));
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.botao:hover {
  background: var(--botao-fundo-sobre, color-mix(in srgb, var(--realce) 85%, var(--texto)));
}

.botao--contorno {
  min-height: 2.75rem;
  padding: 0 1.125rem;
  border-color: var(--topo-texto);
  background: transparent;
  color: var(--topo-texto);
}

.botao--contorno:hover {
  background: rgb(255 255 255 / 14%);
}

/* ----- O topo ----- */

.heroi {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--topo-fundo);
  color: var(--topo-texto);
  --foco: var(--topo-texto);
}

.heroi::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--topo-quadricula) 1px, transparent 1px),
    linear-gradient(90deg, var(--topo-quadricula) 1px, transparent 1px);
  background-size: 2rem 2rem;
  background-position: -1px -1px;
  -webkit-mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 35%, transparent 100%);
}

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 1.5rem;
}

.abertura {
  padding-block: clamp(2.5rem, 7vw, 5.5rem) clamp(2.5rem, 6vw, 4rem);
}

h1 {
  max-width: 17ch;
  font-size: clamp(2.375rem, 6.4vw + 0.4rem, 4.75rem);
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lede {
  max-width: 34rem;
  margin-top: 1.5rem;
  color: var(--topo-apagado);
  font-size: clamp(1.1875rem, 1.2vw + 0.9rem, 1.4375rem);
  line-height: 1.5;
}

.publico {
  margin-top: 1rem;
  max-width: 34rem;
  color: var(--topo-apagado);
}

/* O caminho de um convidado: o que o produto faz, desenhado com o que o produto tem (pontos e check-ins). */
.rota {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 0;
  list-style: none;
}

.no {
  position: relative;
  padding-right: 1rem;
}

.no strong {
  display: block;
  margin-top: 0.875rem;
  font-size: 1.0625rem;
  line-height: 1.3;
}

.no small {
  display: block;
  margin-top: 0.125rem;
  color: var(--topo-apagado);
  font-size: 0.9375rem;
  line-height: 1.4;
}

.sinal {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  background: var(--topo-fundo);
}

.sinal--qr {
  border-radius: 10px;
  background: var(--topo-ladrilho);
  color: var(--topo-tinta);
}

.sinal--qr svg {
  width: 2.5rem;
  height: 2.5rem;
}

.sinal--ponto {
  border: 2px solid var(--topo-texto);
  border-radius: 50%;
}

.sinal--ponto svg,
.sinal--fim svg {
  width: 1.625rem;
  height: 1.625rem;
}

.sinal--fim {
  border: 2px solid var(--topo-texto);
  border-radius: 10px;
}

/* O traço entre dois sinais: sai do centro de um e chega ao do seguinte, e desenha-se uma vez, à entrada. */
.no:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 1.65625rem;
  left: 1.75rem;
  width: 100%;
  height: 2px;
  background: var(--topo-texto);
  transform-origin: left center;
  animation: tracar 0.55s ease-out both;
}

.no:nth-child(1)::before {
  animation-delay: 0.2s;
}
.no:nth-child(2)::before {
  animation-delay: 0.75s;
}
.no:nth-child(3)::before {
  animation-delay: 1.3s;
}
.no:nth-child(4)::before {
  animation-delay: 1.85s;
}

@keyframes tracar {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.nota {
  margin-top: 2rem;
  padding-bottom: clamp(2.5rem, 6vw, 4.5rem);
  color: var(--topo-apagado);
  font-size: 0.9375rem;
}

@media (max-width: 47.9375rem) {
  .rota {
    grid-template-columns: minmax(0, 1fr);
  }

  .no {
    display: grid;
    grid-template-columns: 3.5rem minmax(0, 1fr);
    column-gap: 1rem;
    align-content: start;
    padding: 0 0 1.75rem;
    min-height: 3.5rem;
  }

  .no:last-child {
    padding-bottom: 0;
  }

  .no .sinal {
    grid-row: 1 / span 2;
  }

  .no strong {
    align-self: end;
    margin-top: 0;
  }

  .no small {
    align-self: start;
  }

  .no:not(:last-child)::before {
    top: 1.75rem;
    left: 1.65625rem;
    width: 2px;
    height: 100%;
    transform-origin: center top;
    animation-name: tracar-na-vertical;
  }

  @keyframes tracar-na-vertical {
    from {
      transform: scaleY(0);
    }
    to {
      transform: scaleY(1);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .no:not(:last-child)::before {
    animation: none;
  }
}

/* ----- O resto da página ----- */

.secao {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.secao--faixa {
  background: var(--faixa);
}

h2 {
  max-width: 22ch;
  font-size: clamp(1.75rem, 3.2vw + 0.6rem, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

/* Os três passos são uma sequência de verdade, por isso levam número. */
.passos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 4vw, 3rem);
  margin-top: clamp(2rem, 5vw, 3.5rem);
  padding: 0;
  list-style: none;
  counter-reset: passo;
}

.passos li {
  padding-top: 1.25rem;
  border-top: 2px solid var(--realce);
  counter-increment: passo;
}

.passos li::before {
  content: counter(passo);
  display: block;
  color: var(--realce);
  font-size: 3.5rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.passos h3 {
  margin-top: 0.75rem;
}

.passos p {
  max-width: 28rem;
  margin-top: 0.75rem;
}

.terreno {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: clamp(2rem, 6vw, 5rem);
  margin-top: clamp(2rem, 5vw, 3.5rem);
}

.terreno > div {
  padding-block: 1.5rem 1.75rem;
  border-top: 1px solid var(--linha);
}

.terreno dt {
  font-size: 1.1875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

.terreno dd {
  max-width: 34rem;
  margin-top: 0.5rem;
}

.ao-vivo {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.ao-vivo p {
  max-width: 28rem;
  margin-top: 1.25rem;
}

.painel-ao-vivo {
  padding: 0;
  list-style: none;
  border-top: 2px solid var(--realce);
}

.painel-ao-vivo li {
  position: relative;
  padding: 1rem 0 1rem 1.75rem;
  border-bottom: 1px solid var(--linha);
}

.painel-ao-vivo li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 1.5rem;
  width: 0.625rem;
  height: 0.625rem;
  background: var(--realce);
}

.entrada {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 3rem;
}

.rodape {
  padding-block: 2rem 2.5rem;
  border-top: 1px solid var(--linha);
}

.rodape .miolo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.rodape .marca {
  font-size: 1.125rem;
}

.rodape .marca svg {
  width: 1.25rem;
  height: 1.25rem;
}

.rodape a:not(.marca) {
  color: var(--apagado);
}

/* A página 404 */
.perdida {
  padding-block: clamp(3rem, 9vw, 7rem);
}

.perdida .lede {
  color: var(--topo-apagado);
}

.acoes {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.acoes .botao--contorno {
  min-height: 3rem;
}

@media (max-width: 47.9375rem) {
  .passos,
  .terreno,
  .ao-vivo {
    grid-template-columns: minmax(0, 1fr);
  }

  .terreno > div:last-child {
    border-bottom: 1px solid var(--linha);
  }

  .rodape .miolo {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Os botões do topo e da 404 ficam brancos (ou azuis claros, à noite) sobre o fundo de cianotipia. */
.heroi .botao:not(.botao--contorno) {
  --botao-fundo: var(--topo-botao);
  --botao-texto: var(--topo-sobre-botao);
  --botao-fundo-sobre: var(--topo-apagado);
}

/* ----- Os botões e o formulário de contato ----- */

.botao--grande {
  min-height: 3.5rem;
  padding-inline: 2rem;
  font-size: 1.0625rem;
}

.botao--secundario {
  border-color: var(--realce);
  background: transparent;
  color: var(--realce);
}

.botao--secundario:hover {
  background: var(--faixa);
}

.acoes-do-topo {
  margin-top: 2rem;
}

.entrada .acoes {
  margin-top: 0;
}

.heroi--curto .abertura--curta {
  padding-block: clamp(1.5rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4rem);
}

.heroi--curto h1 {
  max-width: 20ch;
  font-size: clamp(2.125rem, 5vw + 0.5rem, 3.75rem);
}

.contato {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.contato__texto p {
  max-width: 24rem;
  margin-top: 1rem;
}

.formulario {
  display: grid;
  gap: 2.25rem;
}

.formulario fieldset {
  min-width: 0;
  margin: 0;
  padding: 1.25rem 0 0;
  border: 0;
  border-top: 2px solid var(--realce);
}

.formulario legend {
  padding: 0 0.75rem 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.campos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem 1.5rem;
  margin-top: 0.75rem;
}

.campo--cheio {
  grid-column: 1 / -1;
}

.campo label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 700;
  line-height: 1.35;
}

.opcional {
  color: var(--apagado);
  font-weight: 400;
}

.campo input,
.campo select,
.campo textarea {
  display: block;
  width: 100%;
  min-height: 3rem;
  padding: 0.625rem 0.875rem;
  border: 1.5px solid var(--entrada);
  border-radius: 8px;
  background: var(--campo-fundo);
  color: var(--texto);
  font: inherit;
  line-height: 1.4;
}

.campo textarea {
  resize: vertical;
}

.campo input:focus-visible,
.campo select:focus-visible,
.campo textarea:focus-visible {
  outline-offset: 1px;
  border-color: var(--realce);
}

/* Só depois de o campo ter sido tocado e estar errado (sem JavaScript, o :user-invalid é o do navegador). */
.campo input:user-invalid,
.campo select:user-invalid,
.campo textarea:user-invalid {
  border-color: var(--erro);
}

/* O campo de reserva fica fora do ecrã e da ordem do teclado: quem usa o formulário nunca o vê nem o preenche. */
.reserva {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.consentimento {
  display: grid;
  grid-template-columns: 1.5rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.consentimento input {
  width: 1.5rem;
  height: 1.5rem;
  margin: 0.125rem 0 0;
  accent-color: var(--realce);
}

.formulario .botao {
  justify-self: start;
  cursor: pointer;
}

@media (max-width: 47.9375rem) {
  .contato {
    grid-template-columns: minmax(0, 1fr);
  }

  .campos {
    grid-template-columns: minmax(0, 1fr);
  }

  .formulario .botao {
    justify-self: stretch;
  }
}

.campo .dica {
  margin: 0.375rem 0 0;
  color: var(--apagado);
  font-size: 0.9375rem;
  line-height: 1.4;
}
