:root {
  --bg: #0b0d12;
  --panel: #121722;
  --muted: #8aa0b5;
  --text: #e4e8ee;
  --brand: #48a0ff;
  --brand-2: #7dd3fc;
  --ok: #22c55e;
  --warn: #f59e0b;
  --danger: #ef4444;
  --border: #223041;
  --shadow: 0 6px 30px rgba(0,0,0,.35);
}

html, body {
  background: var(--bg);
  color: var(--text);
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

nav {
  background: linear-gradient(90deg, #0f172a 0%, #101827 100%);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
nav a { color: #cbd5e1; margin-right: 12px; }
nav a:hover { color: #fff; }

.container {
  max-width: 980px;
  margin: 24px auto;
  padding: 0 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 18px;
}

h1, h2, h3 { letter-spacing: .3px; }

button, .btn {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: linear-gradient(180deg, #1a2231 0%, #141a26 100%);
  color: var(--text);
  cursor: pointer;
  transition: transform .05s ease, filter .2s ease;
}
button:hover, .btn:hover { filter: brightness(1.1); }
button:active, .btn:active { transform: translateY(1px); }

.btn-danger { border-color: #5e1e1e; color: #ffdada; background: linear-gradient(180deg,#2b0c0c,#1d0a0a); }
.btn-ok { border-color: #1e5e33; color: #dbffe7; background: linear-gradient(180deg,#0c2b16,#0a1d12); }

input[type="text"], input[type="password"], textarea {
  width: 100%;
  background: #0b1220;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
input:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(72,160,255,.15); }

.flash {
  background: #102032;
  border: 1px solid #1b3751;
  border-radius: 10px;
  padding: 10px 12px;
  color: #cfe8ff;
}

.site-footer {
  margin-top: 40px;
  border-top: 1px solid var(--border);
  padding: 18px 0;
  color: var(--muted);
}

/* Blocos recolhíveis para códigos */
details.code-fold {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  margin: 12px 0;
}

details.code-fold > summary {
  cursor: pointer;
  user-select: none;
  padding: 10px 12px;
  list-style: none; /* remove marcador padrão em alguns browsers */
  outline: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

details.code-fold > summary .hint {
  color: var(--muted);
  font-size: 12px;
  margin-left: auto;
}

details.code-fold[open] > .code-body {
  border-top: 1px solid var(--border);
}

details.code-fold .code-body {
  padding: 10px 12px;
}

details.code-fold pre {
  background: #0b1220;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  overflow: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12.5px;
  line-height: 1.5;
  max-height: 320px; /* evita blocos gigantes */
}

/* Barra de filtro */
.filter-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 12px;
}

/* Wrapper p/ desenhar a setinha custom */
.select-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Select dark estilizado */
.select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background: linear-gradient(180deg, #0b1220 0%, #0a0f1a 100%);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 36px 10px 12px; /* espaço p/ ícone à direita */
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.select:hover { filter: brightness(1.05); }
.select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(72,160,255,.15);
}

/* Setinha (caret) */
.select-wrapper::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
  opacity: .9;
}

/* Remove a setinha nativa no IE/Edge antigo */
select.select::-ms-expand { display: none; }

/* Botão link à direita na barra */
.filter-bar .spacer { margin-left: auto; }

/* Ajuste visual do input de busca pra combinar */
.filter-bar input[type="text"] {
  height: 40px;
}
.filter-bar button {
  height: 40px;
  padding: 0 14px;
}