/* ===== Tokens ===== */
:root {
  --noite: #17142a;        /* fundo */
  --noite-2: #211d3a;      /* superfícies */
  --noite-3: #2c2750;      /* superfícies elevadas */
  --lavanda: #b9a6ff;      /* destaque */
  --pessego: #ffb38a;      /* detalhe raro */
  --texto: #f1eefc;
  --nevoa: #a29bc0;        /* texto secundário */
  --linha: rgba(241, 238, 252, .12);
  --perigo: #ff8f9c;

  --display: 'Bagel Fat One', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --ui: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;

  /* escala 1.25 */
  --t-12: .75rem;
  --t-14: .875rem;
  --t-16: 1rem;
  --t-20: 1.25rem;
  --t-25: 1.5625rem;
  --t-31: 1.953rem;
  --t-39: 2.441rem;
  --t-49: 3.052rem;
  --t-61: 3.815rem;

  --raio-g: 28px;
  --raio-m: 16px;
  --raio-p: 10px;

  color-scheme: dark;
}

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

[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--noite);
  color: var(--texto);
  font-family: var(--ui);
  font-size: var(--t-16);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }

.icone { width: 1.25em; height: 1.25em; flex: none; display: block; }

:focus-visible {
  outline: 2px solid var(--lavanda);
  outline-offset: 3px;
  border-radius: 6px;
}

.so-leitor {
  position: absolute !important;
  width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ===== Fundo padrão com brilho e granulado ===== */
.ceu {
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(55% 45% at 18% 12%, rgba(185, 166, 255, .26), transparent 70%),
    radial-gradient(45% 40% at 88% 88%, rgba(255, 179, 138, .14), transparent 70%),
    radial-gradient(70% 60% at 50% 110%, rgba(110, 86, 220, .22), transparent 70%),
    var(--noite);
}
.ceu::after {
  content: '';
  position: absolute;
  inset: 0;
  opacity: .09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}

/* ===== Vidro ===== */
.vidro {
  background: rgba(23, 20, 42, .58);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  backdrop-filter: blur(18px) saturate(1.2);
  border: 1px solid var(--linha);
}

/* ===== Botões ===== */
.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  border: 0;
  background: var(--lavanda);
  color: var(--noite);
  font-weight: 600;
  font-size: var(--t-14);
  text-decoration: none;
  transition: filter .15s ease, transform .15s ease;
}
.botao:hover { filter: brightness(1.08); }
.botao:active { transform: scale(.98); }
.botao:disabled { opacity: .5; cursor: not-allowed; filter: none; transform: none; }

.botao.secundario {
  background: rgba(241, 238, 252, .07);
  color: var(--texto);
  border: 1px solid var(--linha);
}
.botao.secundario:hover { background: rgba(241, 238, 252, .12); filter: none; }

.botao.perigo { background: transparent; color: var(--perigo); border: 1px solid rgba(255, 143, 156, .35); }
.botao.perigo:hover { background: rgba(255, 143, 156, .1); filter: none; }

.botao.pequeno { min-height: 34px; padding: 0 14px; font-size: var(--t-14); }

.botao-icone {
  display: inline-grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: var(--nevoa);
  transition: color .15s ease, background .15s ease;
}
.botao-icone:hover { color: var(--texto); background: rgba(241, 238, 252, .08); }

/* ===== Formulários ===== */
.campo { display: grid; gap: 6px; align-content: start; }
.campo > span, .rotulo {
  font-size: var(--t-14);
  font-weight: 500;
  color: var(--nevoa);
}
.campo small { color: var(--nevoa); font-size: var(--t-12); line-height: 1.45; }

.entrada-texto,
.campo input[type="text"],
.campo input[type="password"],
.campo input[type="url"],
.campo input[type="date"],
.campo input[type="number"],
.campo select,
.campo textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: var(--raio-p);
  border: 1px solid var(--linha);
  background: rgba(10, 8, 22, .45);
  color: var(--texto);
  font-size: var(--t-16);
}
.campo textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.campo input:focus, .campo select:focus, .campo textarea:focus {
  outline: none;
  border-color: var(--lavanda);
  box-shadow: 0 0 0 3px rgba(185, 166, 255, .22);
}
.campo input[type="file"] { font-size: var(--t-14); color: var(--nevoa); }
.campo input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--linha);
  background: rgba(241, 238, 252, .08);
  color: var(--texto);
  font-weight: 500;
  cursor: pointer;
}

.mensagem-erro {
  color: var(--perigo);
  font-size: var(--t-14);
  min-height: 1.4em;
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}
