:root {
  --bg: #070912;
  --bg2: #0e1222;
  --card: #141a30;
  --card2: #1b2240;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f4f6ff;
  --muted: #9aa3c7;
  --red: #e3262f;
  --green: #119c3f;
  --yellow: #ffd400;
  --purple: #8b5cf6;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
  --radius: 18px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Rubik', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  background:
    radial-gradient(1000px 500px at 0% -10%, rgba(227, 38, 47, 0.22), transparent 60%),
    radial-gradient(1000px 500px at 100% -10%, rgba(17, 156, 63, 0.22), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

a {
  color: var(--yellow);
}

.display {
  font-family: 'Bungee', Impact, sans-serif;
  font-weight: 400;
  letter-spacing: 0.5px;
}

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- botões e campos ---------- */
.btn {
  appearance: none;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font: 800 15px 'Rubik', sans-serif;
  color: #111;
  background: var(--yellow);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  transition: transform 0.08s ease, filter 0.15s ease, background 0.15s;
  white-space: nowrap;
}
.btn:hover {
  filter: brightness(1.08);
}
.btn:active {
  transform: scale(0.97);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.red {
  background: var(--red);
  color: #fff;
}
.btn.green {
  background: var(--green);
  color: #fff;
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--line);
}
.btn.dark {
  background: #000;
  color: #fff;
}
.btn.sm {
  padding: 8px 12px;
  font-size: 13px;
  border-radius: 11px;
}
.btn.block {
  width: 100%;
}

input,
select,
textarea {
  width: 100%;
  background: #0b0f20;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
  font: 500 15px 'Rubik', sans-serif;
  outline: none;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--yellow);
  box-shadow: 0 0 0 3px rgba(255, 212, 0, 0.15);
}
input[type='color'] {
  padding: 4px;
  height: 46px;
}
input[type='checkbox'] {
  width: 22px;
  height: 22px;
  accent-color: var(--yellow);
}
input[type='range'] {
  padding: 0;
  accent-color: var(--yellow);
}
label.f {
  display: block;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  margin: 12px 0 6px;
}

.row {
  display: flex;
  gap: 10px;
  align-items: center;
}
.row.wrap-row {
  flex-wrap: wrap;
}
.grow {
  flex: 1;
  min-width: 0;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
@media (max-width: 640px) {
  .grid2 {
    grid-template-columns: 1fr;
  }
  .grid3 {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  background: linear-gradient(180deg, var(--card), var(--bg2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card h2,
.card h3 {
  margin: 0 0 10px;
}
.card + .card {
  margin-top: 14px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 13px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 800;
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--muted);
  display: inline-block;
}
.dot.on {
  background: #ff2d55;
  box-shadow: 0 0 0 4px rgba(255, 45, 85, 0.25);
  animation: pulse 1.2s infinite;
}
.dot.wait {
  background: var(--warn);
}
.dot.bad {
  background: var(--bad);
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 8px rgba(255, 45, 85, 0.05);
  }
}

.copy {
  display: flex;
  gap: 8px;
}
.copy input {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px;
}

.toast-box {
  position: fixed;
  left: 50%;
  bottom: 90px;
  transform: translateX(-50%);
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: min(92vw, 420px);
}
.toast {
  background: #000;
  border: 1px solid var(--line);
  border-left: 5px solid var(--yellow);
  padding: 12px 14px;
  border-radius: 12px;
  font-weight: 700;
  box-shadow: var(--shadow);
  animation: tin 0.2s ease;
}
.toast.err {
  border-left-color: var(--bad);
}
@keyframes tin {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
}

.hidden {
  display: none !important;
}

/* ícones */
.ico {
  display: inline-block;
  vertical-align: -0.18em;
  flex: none;
}
.btn .ico {
  vertical-align: middle;
}
h2 .ico,
h3 .ico {
  color: var(--yellow);
  margin-right: 4px;
}
.tdot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: 0.05em;
}
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  vertical-align: middle;
  box-shadow: 0 6px 18px rgba(255, 212, 0, 0.25);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* aviso do site (topo) */
.aviso-bar,
.aviso-preview {
  background: linear-gradient(90deg, #1e3a8a, #2563eb);
  color: #fff;
}
.aviso-bar.k-promo,
.aviso-preview.k-promo {
  background: linear-gradient(90deg, #b45309, #ffd400);
  color: #111;
}
.aviso-bar.k-alerta,
.aviso-preview.k-alerta {
  background: linear-gradient(90deg, #991b1b, #ef4444);
  color: #fff;
}
.aviso-bar {
  position: relative;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 46px;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  animation: avisoIn 0.45s cubic-bezier(0.2, 1, 0.3, 1);
}
.aviso-bar button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
  cursor: pointer;
  display: grid;
  place-items: center;
}
@keyframes avisoIn {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
}

/* ===== janelas próprias (confirmar / avisar) ===== */
.dlg-back {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(4, 6, 14, 0.72);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.18s ease;
}
.dlg-back.on {
  opacity: 1;
}
.dlg {
  width: min(400px, 100%);
  padding: 26px 22px 20px;
  border-radius: 22px;
  text-align: center;
  background: linear-gradient(180deg, var(--card2), var(--card));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  transform: translateY(14px) scale(0.96);
  transition: transform 0.22s cubic-bezier(0.2, 1.3, 0.4, 1);
}
.dlg-back.on .dlg {
  transform: none;
}
.dlg-ic {
  width: 62px;
  height: 62px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: var(--yellow);
  background: rgba(255, 212, 0, 0.12);
}
.dlg.tone-danger .dlg-ic {
  color: #f87171;
  background: rgba(239, 68, 68, 0.14);
}
.dlg.tone-ok .dlg-ic {
  color: #4ade80;
  background: rgba(34, 197, 94, 0.14);
}
.dlg h3 {
  margin: 0 0 6px;
  font-size: 20px;
}
.dlg p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}
.dlg-in {
  width: 100%;
  margin-top: 14px;
}
.dlg-btns {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.dlg-btns .btn {
  flex: 1;
  justify-content: center;
}
