/* Base comum ao site e ao painel. Tokens vêm do DESIGN.md. */

@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Poppins";
  src: url("../fonts/poppins-800.woff2") format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Bebas Neue";
  src: url("../fonts/bebas-neue.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --preto: #101010;
  --grafite-0: #161616;
  --grafite-1: #212121;
  --grafite-2: #353535;
  --grafite-3: #424242;
  --ouro: #f3c853;
  --ouro-forte: #f8d877;
  --ouro-fundo: #2a2415;
  --ouro-linha: #dec485;
  --bronze: #a96c43;
  --bronze-escuro: #593c27;
  --r25-azul: #154ca6;
  --r25-marinho: #021746;
  --branco: #ffffff;

  --texto: #f4f2ee;
  --texto-2: #b9b3a8;
  --texto-3: #8d877d;
  --erro: #ff8b7b;
  --erro-fundo: #2e1a17;
  --ok: #86d5a0;
  --ok-fundo: #16261b;

  --fonte: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --fonte-display: "Bebas Neue", "Poppins", system-ui, sans-serif;

  --raio: 10px;
  --raio-p: 6px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  background: var(--preto);
  color: var(--texto);
  font-family: var(--fonte);
  font-size: 1rem;
  line-height: 1.5;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  caret-color: var(--ouro);
}

::selection {
  background: rgba(243, 200, 83, 0.32);
  color: var(--branco);
}

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

ul,
ol {
  padding: 0;
  list-style: none;
}

img,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: var(--ouro);
  text-underline-offset: 0.2em;
  text-decoration-thickness: 1px;
}

:focus-visible {
  outline: 2px solid var(--ouro);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.visualmente-oculto {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.num {
  font-variant-numeric: tabular-nums lining-nums;
}

.selo-vip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--preto);
  background: var(--ouro);
  border-radius: var(--raio-p);
}

/* ---------------------------------------------------------------- campos */

.campo {
  display: grid;
  gap: 6px;
}

.campo label,
.rotulo {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--texto);
}

.campo .dica {
  font-size: 0.8125rem;
  color: var(--texto-2);
  margin-top: -2px;
}

.entrada,
select.entrada,
textarea.entrada {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  font: inherit;
  font-size: 1.0625rem; /* 17px: acima de 16px, o iOS não dá zoom */
  color: var(--texto);
  background: var(--grafite-1);
  border: 1px solid var(--grafite-3);
  border-radius: var(--raio);
  transition: border-color 150ms ease, background-color 150ms ease;
  appearance: none;
}

textarea.entrada {
  min-height: 96px;
  resize: vertical;
}

select.entrada {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23b9b3a8' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
}

.entrada::placeholder {
  color: var(--texto-3);
}

.entrada:focus {
  outline: none;
  border-color: var(--ouro);
  background: var(--grafite-0);
  box-shadow: 0 0 0 3px rgba(243, 200, 83, 0.18);
}

.entrada[aria-invalid="true"] {
  border-color: var(--erro);
}

.entrada[aria-invalid="true"]:focus {
  box-shadow: 0 0 0 3px rgba(255, 139, 123, 0.2);
}

.campo-erro {
  display: flex;
  gap: 6px;
  align-items: flex-start;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--erro);
}

.campo-erro:empty {
  display: none;
}

.campo-erro::before {
  content: "";
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5a6.5 6.5 0 110 13 6.5 6.5 0 010-13zm0 3.25a.75.75 0 00-.75.75v3a.75.75 0 001.5 0v-3A.75.75 0 008 4.75zm0 5.5a.9.9 0 100 1.8.9.9 0 000-1.8z'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M8 1.5a6.5 6.5 0 110 13 6.5 6.5 0 010-13zm0 3.25a.75.75 0 00-.75.75v3a.75.75 0 001.5 0v-3A.75.75 0 008 4.75zm0 5.5a.9.9 0 100 1.8.9.9 0 000-1.8z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.campo .marcar,
.marcar {
  font-weight: 400;
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 12px;
  align-items: start;
  font-size: 0.9375rem;
  color: var(--texto);
  cursor: pointer;
}

.marcar input {
  width: 22px;
  height: 22px;
  margin: 1px 0 0;
  accent-color: var(--ouro);
  cursor: pointer;
}

.marcar small {
  display: block;
  color: var(--texto-2);
  font-size: 0.8125rem;
}

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

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 20px;
  font: inherit;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  color: var(--texto);
  background: var(--grafite-1);
  border: 1px solid var(--grafite-3);
  border-radius: var(--raio);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  transition: transform 120ms var(--ease-out), background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}

.botao:active {
  transform: scale(0.98);
}

.botao-primario {
  color: var(--preto);
  background: var(--ouro);
  border-color: var(--ouro);
  font-weight: 800;
}

.botao-perigo {
  color: var(--erro);
  border-color: rgba(255, 139, 123, 0.45);
  background: transparent;
}

.botao-discreto {
  background: transparent;
  border-color: transparent;
  color: var(--texto-2);
}

.botao[disabled],
.botao[aria-disabled="true"] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.botao .giro {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: giro 700ms linear infinite;
}

.botao[data-carregando] .giro {
  display: inline-block;
}

@keyframes giro {
  to {
    transform: rotate(360deg);
  }
}

@media (hover: hover) and (pointer: fine) {
  .botao:hover {
    border-color: var(--texto-3);
    background: #2a2a2a;
  }
  .botao-primario:hover {
    background: var(--ouro-forte);
    border-color: var(--ouro-forte);
  }
  .botao-perigo:hover {
    background: var(--erro-fundo);
    border-color: var(--erro);
  }
  .botao-discreto:hover {
    background: var(--grafite-1);
    border-color: transparent;
    color: var(--texto);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 1ms !important;
    animation-iteration-count: 1 !important;
  }
  .botao .giro {
    animation: giro 1400ms linear infinite !important;
    animation-iteration-count: infinite !important;
  }
}
