/* Resenha Garantida — base: tokens, tipografia, botões, formulários, avisos, gaveta e diálogo */
:root {
  --bg: #02040c;
  --surface: #070c1c;
  --surface-2: #0b1330;
  --line: #14234a;
  --line-2: #1f3573;
  --blue: #2d7bff;
  --blue-2: #1b5ddb;
  --cyan: #6fd3ff;
  --text: #eef3ff;
  --muted: #8794b3;
  --ok: #35d6a0;
  --warn: #ffc24b;
  --bad: #ff5d6c;

  --font-display: 'Anton', 'Arial Narrow', Impact, sans-serif;
  --font: 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;

  /* posição da "luz" azul que acompanha o cursor (atualizada por js/app.js) */
  --lx: 18vw;
  --ly: 12vh;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  font-optical-sizing: auto;
  overflow-x: hidden;
}

/* A luz: um foco azul fixo que segue o cursor, como o flare da arte do servidor */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(520px circle at var(--lx) var(--ly), rgba(45, 123, 255, 0.26), rgba(45, 123, 255, 0.06) 45%, transparent 70%),
    radial-gradient(900px circle at 0% 0%, rgba(27, 93, 219, 0.2), transparent 60%);
}

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

a {
  color: var(--cyan);
  text-underline-offset: 3px;
}
a:hover {
  color: #fff;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 750;
}
h2 {
  font-size: clamp(1.7rem, 3.4vw, 2.5rem);
}
h3 {
  font-size: 1.2rem;
}
p {
  margin: 0;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--blue);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
  text-decoration: none;
}
.skip:focus {
  top: 12px;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.muted {
  color: var(--muted);
}
.hidden {
  display: none !important;
}

/* ---------------------------------------------------------------- logotipo */
.wordmark {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: 0.01em;
  transform: skewX(-8deg);
  filter: url(#rough) drop-shadow(0 0 22px rgba(45, 123, 255, 0.55));
  margin: 0;
}
.wordmark .l1,
.wordmark .l2 {
  display: block;
}
.wordmark .l1 {
  color: #fff;
}
.wordmark .l2 {
  background: linear-gradient(180deg, #7cc2ff 0%, #2d7bff 55%, #1b5ddb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------------------------------------------------------------- botões */
.btn {
  --b: var(--blue);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.62rem 1.25rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: var(--b);
  color: #fff;
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  box-shadow: 0 10px 30px -12px rgba(45, 123, 255, 0.9);
}
.btn:hover {
  color: #fff;
  background: #4a8dff;
  transform: translateY(-1px);
  box-shadow: 0 14px 34px -10px rgba(45, 123, 255, 1);
}
.btn:active {
  transform: translateY(0);
}
.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}
.btn-ghost {
  background: rgba(45, 123, 255, 0.08);
  border-color: var(--line-2);
  box-shadow: none;
  color: var(--text);
}
.btn-ghost:hover {
  background: rgba(45, 123, 255, 0.18);
  border-color: var(--blue);
  box-shadow: none;
}
.btn-danger {
  background: rgba(255, 93, 108, 0.12);
  border-color: rgba(255, 93, 108, 0.5);
  color: #ffb3bb;
  box-shadow: none;
}
.btn-danger:hover {
  background: var(--bad);
  color: #fff;
  box-shadow: none;
}
.btn-sm {
  min-height: 34px;
  padding: 0.3rem 0.8rem;
  font-size: 0.88rem;
  border-radius: 9px;
}
.btn-block {
  width: 100%;
}
.btn .spin {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------------------------------------------- formulários */
label {
  display: grid;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #c7d3f0;
}
label small {
  font-weight: 400;
  color: var(--muted);
}
input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-weight: 450;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea {
  min-height: 96px;
  resize: vertical;
  line-height: 1.5;
}
input::placeholder,
textarea::placeholder {
  color: #566489;
}
input:hover,
select:hover,
textarea:hover {
  border-color: var(--line-2);
}
input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(45, 123, 255, 0.25);
}
input[type='checkbox'] {
  width: 18px;
  min-height: 18px;
  height: 18px;
  accent-color: var(--blue);
  padding: 0;
}
input[type='color'] {
  padding: 3px;
  min-height: 44px;
  cursor: pointer;
}
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-right: 34px;
}
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  cursor: pointer;
}
.field-row {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}
.form-grid {
  display: grid;
  gap: 16px;
}
.form-error {
  color: #ffb3bb;
  font-size: 0.92rem;
  min-height: 1.3em;
}

/* ---------------------------------------------------------------- selos de status */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 650;
  background: rgba(135, 148, 179, 0.14);
  color: #c4cee6;
  border: 1px solid rgba(135, 148, 179, 0.25);
  white-space: nowrap;
}
.chip::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.chip.ok {
  color: var(--ok);
  background: rgba(53, 214, 160, 0.1);
  border-color: rgba(53, 214, 160, 0.3);
}
.chip.warn {
  color: var(--warn);
  background: rgba(255, 194, 75, 0.1);
  border-color: rgba(255, 194, 75, 0.3);
}
.chip.bad {
  color: var(--bad);
  background: rgba(255, 93, 108, 0.1);
  border-color: rgba(255, 93, 108, 0.3);
}
.chip.info {
  color: var(--cyan);
  background: rgba(111, 211, 255, 0.1);
  border-color: rgba(111, 211, 255, 0.3);
}
.tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: #b8c6ea;
}

/* ---------------------------------------------------------------- superfície com luz na borda */
.glow {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.glow::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: radial-gradient(280px circle at var(--px, -200px) var(--py, -200px), var(--cyan), rgba(45, 123, 255, 0.5) 40%, transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.glow:hover::before,
.glow:focus-within::before {
  opacity: 1;
}

/* ---------------------------------------------------------------- avisos (toasts) */
.toasts {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 200;
  display: grid;
  gap: 10px;
  width: min(380px, calc(100vw - 32px));
}
.toast {
  padding: 12px 16px;
  border-radius: 12px;
  background: #0d1838;
  border: 1px solid var(--line-2);
  box-shadow: 0 18px 50px -20px #000;
  font-weight: 550;
  animation: toast-in 0.25s ease both;
}
.toast.ok {
  border-color: rgba(53, 214, 160, 0.55);
}
.toast.bad {
  border-color: rgba(255, 93, 108, 0.6);
}
.toast.out {
  opacity: 0;
  transform: translateY(8px);
  transition: 0.25s;
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* ---------------------------------------------------------------- gaveta lateral */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(1, 3, 10, 0.72);
  backdrop-filter: blur(3px);
  opacity: 0;
  transition: opacity 0.25s ease;
}
.scrim.open {
  opacity: 1;
}
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 91;
  width: min(480px, 100vw);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-left: 1px solid var(--line-2);
  box-shadow: -30px 0 80px -30px #000;
  transform: translateX(104%);
  transition: transform 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.drawer.open {
  transform: none;
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}
.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
}
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.2rem;
  cursor: pointer;
}
.icon-btn:hover {
  border-color: var(--blue);
  background: rgba(45, 123, 255, 0.12);
}

/* ---------------------------------------------------------------- diálogo de confirmação */
dialog {
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  width: min(440px, calc(100vw - 32px));
  box-shadow: 0 40px 100px -20px #000;
}
dialog::backdrop {
  background: rgba(1, 3, 10, 0.75);
  backdrop-filter: blur(3px);
}
dialog .dlg-body {
  padding: 24px;
  display: grid;
  gap: 8px;
}
dialog .dlg-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 22px;
}

/* ---------------------------------------------------------------- vazio e carregando */
.empty {
  padding: 36px 20px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
}
.empty strong {
  display: block;
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.skeleton {
  border-radius: var(--radius);
  min-height: 72px;
  background: linear-gradient(100deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%);
  background-size: 300% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -150% 0;
  }
}

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