/*
 * Portal de visitantes — Fundação Parque Tecnológico de Santos.
 * Tokens tirados do Manual da Marca (2023), os mesmos usados no fpts-app:
 * Kanit para título, Barlow para texto, verde #70bd54 e verde escuro #234819.
 * Nada é carregado de fora: antes da liberação o visitante não alcança a
 * internet, então fontes, logo e estilos moram todos aqui.
 */

@font-face {
  font-family: "Kanit";
  src: url("/assets/fonts/kanit-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Barlow";
  src: url("/assets/fonts/barlow-semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --verde: #70bd54;
  --verde-escuro: #234819;
  --lima: #bcf079;
  --tinta: #16210f;
  --neutro: #6a7460;
  --linha: #e4e7de;
  --neblina: #f5f6f1;
  --folha: #eaf5e4;
  --raio: 14px;
  color-scheme: light;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Barlow", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--tinta);
  background-color: var(--neblina);
  background-image: radial-gradient(120% 90% at 50% 0%, var(--folha) 0%, var(--neblina) 62%);
}

.card {
  position: relative;
  width: 100%;
  max-width: min(400px, 100%);
  padding: 36px 28px 28px;
  background: #fff;
  border: 1px solid var(--linha);
  border-radius: var(--raio);
  box-shadow: 0 14px 40px -18px rgb(35 72 25 / 28%);
  overflow: hidden;
  text-align: center;
}

.card__accent {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--verde-escuro), var(--verde) 55%, var(--lima));
}

.logo {
  width: 224px;
  height: auto;
  margin: 0 auto 22px;
  display: block;
}

h1 {
  margin: 0 0 8px;
  font-family: "Kanit", "Barlow", ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--verde-escuro);
}

.intro {
  margin: 0 0 22px;
  color: var(--neutro);
  font-size: 0.95rem;
}

.aviso {
  margin: 0 0 18px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8e1;
  border: 1px solid #f0dca0;
  color: #5a4a12;
  font-size: 0.85rem;
  text-align: left;
}

.aviso strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.provedores {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.botao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 50px;
  padding: 12px 16px;
  border: 1px solid #c8cfc0;
  border-radius: 10px;
  background: #fff;
  color: var(--tinta);
  font: inherit;
  font-weight: 600;
  font-size: 0.97rem;
  text-decoration: none;
  cursor: pointer;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    transform 140ms ease;
}

.botao:hover {
  background: #f7faf4;
  border-color: var(--verde-escuro);
}

.botao:active {
  transform: translateY(1px);
}

.botao__marca {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.botao[aria-disabled="true"] {
  opacity: 0.72;
}

.botao--primario {
  background: var(--verde-escuro);
  border-color: var(--verde-escuro);
  color: #fff;
  min-height: 44px;
}

.botao--primario:hover {
  background: #1a3713;
  border-color: #1a3713;
}

.consentimento {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 10px;
  text-align: left;
  font-size: 0.88rem;
  color: var(--neutro);
}

/* Aviso de aceite pendente: o vermelho entra na hora e so a volta e animada,
   porque a transicao fica na regra de base e o estado de alerta a desliga. */
.consentimento,
.consentimento .link {
  transition: color 2s ease;
}

.consentimento--alerta,
.consentimento--alerta .link {
  color: #9b1c1c;
  transition: none;
}

.consentimento input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--verde-escuro);
}

.consentimento label {
  cursor: pointer;
}

/* Ancora, e nao <button>: o Chrome blinda o botao como inline-block, e o
   rotulo inteiro viraria uma caixa indivisivel em vez de quebrar em linhas. */
.link {
  font-weight: 600;
  color: var(--verde-escuro);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.erro-inline {
  margin: 12px 0 0;
  color: #9b1c1c;
  font-size: 0.85rem;
  text-align: left;
}

:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid var(--verde-escuro);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Modal dos termos ---------- */

.modal[hidden] {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal__fundo {
  position: absolute;
  inset: 0;
  background: rgb(13 22 10 / 62%);
}

.modal__caixa {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 620px;
  max-height: min(88vh, 720px);
  max-height: min(88dvh, 720px);
  background: #fff;
  border-radius: var(--raio);
  box-shadow: 0 24px 60px -20px rgb(13 22 10 / 55%);
  overflow: hidden;
}

/* Flutua sobre o texto, que rola por baixo: o fundo opaco mantem o X legivel. */
.modal__fechar {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--linha);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px -2px rgb(13 22 10 / 25%);
  color: var(--tinta);
  cursor: pointer;
}

.modal__fechar:hover {
  background: var(--neblina);
}

.modal__fechar svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.modal__corpo {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 18px 20px;
  text-align: left;
  font-size: 0.9rem;
}

.modal__corpo h1,
.modal__corpo h2,
.modal__corpo h3 {
  font-family: "Kanit", "Barlow", ui-sans-serif, system-ui, sans-serif;
  font-weight: 600;
  color: var(--verde-escuro);
  line-height: 1.25;
}

.modal__corpo h1 {
  margin: 0 0 4px;
  font-size: 1.15rem;
}

.modal__corpo h2 {
  margin: 22px 0 6px;
  font-size: 1rem;
}

.modal__corpo h3 {
  margin: 16px 0 4px;
  font-size: 0.93rem;
}

.modal__corpo p,
.modal__corpo ul,
.modal__corpo ol {
  margin: 0 0 10px;
}

.modal__corpo ul,
.modal__corpo ol {
  padding-left: 22px;
}

.modal__corpo li {
  margin-bottom: 4px;
}

.modal__corpo a {
  color: var(--verde-escuro);
  text-underline-offset: 2px;
  overflow-wrap: anywhere;
}

.modal__corpo em {
  color: var(--neutro);
}

.modal__corpo hr {
  margin: 18px 0;
  border: 0;
  border-top: 1px solid var(--linha);
}

.modal__rodape {
  padding: 14px 20px;
  border-top: 1px solid var(--linha);
  background: var(--neblina);
}

.modal__rodape .botao {
  width: 100%;
}

body.travado {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 28px 20px 24px;
  }
  .logo {
    width: 190px;
  }
}

/* ---------- Selos das páginas de resultado ---------- */

.selo {
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.selo svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selo--ok {
  background: var(--folha);
  color: var(--verde-escuro);
}

.selo--erro {
  background: #fdeaea;
  color: #9b1c1c;
}
