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

/* ── Tema Light (padrão) ─────────────────────────────────────────────────── */
:root {
  --bg:           #f8f9fa;
  --surface:      #ffffff;
  --border:       #e0e0e0;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --accent:       #2563eb;
  --accent-hover: #1d4ed8;
  --pre-bg:       #f1f5f9;
  --code-bg:      #1e293b;
  --code-text:    #e2e8f0;
  --badge-ok-bg:  #dcfce7;
  --badge-ok-fg:  #166534;
  --badge-err-bg: #fee2e2;
  --badge-err-fg: #991b1b;
  --shadow:       rgba(0,0,0,.06);
  --radius: 8px;
  --font: 'Segoe UI', system-ui, sans-serif;
  --mono: 'Courier New', monospace;
}

/* ── Tema Dark ────────────────────────────────────────────────────────────── */
[data-theme="dark"] {
  --bg:           #0f172a;
  --surface:      #1e293b;
  --border:       #334155;
  --text:         #f1f5f9;
  --text-muted:   #94a3b8;
  --accent:       #3b82f6;
  --accent-hover: #2563eb;
  --pre-bg:       #0f172a;
  --code-bg:      #020617;
  --code-text:    #e2e8f0;
  --badge-ok-bg:  #14532d;
  --badge-ok-fg:  #86efac;
  --badge-err-bg: #450a0a;
  --badge-err-fg: #fca5a5;
  --shadow:       rgba(0,0,0,.3);
}

/* ── Transição suave (só após carregamento) ──────────────────────────────── */
body.theme-ready, body.theme-ready * {
  transition: background-color .2s, border-color .2s, color .2s;
}

/* ── Base ─────────────────────────────────────────────────────────────────── */
body { font-family: var(--font); background: var(--bg); color: var(--text); font-size: 15px; line-height: 1.6; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 0; }
.site-header .container { display: flex; align-items: center; gap: 24px; }
.logo { font-size: 18px; font-weight: 700; color: var(--text); text-decoration: none; white-space: nowrap; }
.main-nav { display: flex; gap: 4px; flex: 1; }

/* Toggle dark/light */
.theme-toggle {
  margin-left: auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--text); background: var(--surface); }
.theme-toggle .icon { font-size: 16px; }

/* Nav dropdown */
.nav-dropdown { position: relative; padding: 6px 10px; cursor: pointer; border-radius: var(--radius); font-size: 14px; color: var(--text); }
.nav-dropdown:hover { background: var(--bg); }
.nav-dropdown:hover .dropdown-menu { display: block; }
.dropdown-menu { display: none; position: absolute; top: 100%; left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); min-width: 200px; z-index: 100; box-shadow: 0 4px 16px var(--shadow); }
.dropdown-menu a { display: block; padding: 8px 14px; text-decoration: none; color: var(--text); font-size: 14px; }
.dropdown-menu a:hover { background: var(--bg); }

/* ── Main / Ads ──────────────────────────────────────────────────────────── */
.main-content { padding: 32px 20px; }
.ad-banner { margin: 12px auto; min-height: 90px; }

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.hero { margin-bottom: 36px; }
.hero h1 { font-size: 28px; margin-bottom: 6px; }
.hero p { color: var(--text-muted); font-size: 16px; }

/* ── Grid de ferramentas ──────────────────────────────────────────────────── */
.category-section { margin-bottom: 32px; }
.category-section h2 { font-size: 18px; margin-bottom: 14px; padding-bottom: 6px; border-bottom: 2px solid var(--accent); display: inline-block; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.tool-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 4px; transition: border-color .15s; }
.tool-card:hover { border-color: var(--accent); }
.tool-name { font-weight: 600; font-size: 14px; }
.tool-desc { font-size: 12px; color: var(--text-muted); }

/* ── Tool box ─────────────────────────────────────────────────────────────── */
.tool-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin: 20px 0; }
.form-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.form-row label { min-width: 180px; font-size: 14px; color: var(--text-muted); }

input[type="number"],
input[type="text"],
input[type="date"],
textarea,
select {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 14px;
  font-family: var(--font);
  background: var(--surface);
  color: var(--text);
}
input[type="number"]:focus,
input[type="text"]:focus,
textarea:focus,
select:focus { outline: 2px solid var(--accent); border-color: var(--accent); }
textarea { width: 100%; resize: vertical; }

button { background: var(--accent); color: #fff; border: none; border-radius: 6px; padding: 8px 18px; font-size: 14px; cursor: pointer; font-family: var(--font); }
button:hover { background: var(--accent-hover); }

/* ── Resultados ──────────────────────────────────────────────────────────── */
.result-box { margin-top: 16px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.result-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--border); background: var(--surface); }
.result-item:last-child { border-bottom: none; }
.mono { font-family: var(--mono); font-size: 14px; }
.result-item button { background: none; color: var(--accent); border: 1px solid var(--accent); padding: 4px 10px; font-size: 12px; }
.result-item button:hover { background: var(--accent); color: #fff; }

.badge-ok  { background: var(--badge-ok-bg);  color: var(--badge-ok-fg);  border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 600; }
.badge-err { background: var(--badge-err-bg); color: var(--badge-err-fg); border-radius: 99px; padding: 2px 10px; font-size: 13px; font-weight: 600; }

/* ── Seção de info / código ───────────────────────────────────────────────── */
.info-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; margin-top: 24px; }
.info-section h2 { font-size: 17px; margin-bottom: 10px; }
.info-section h3 { font-size: 15px; margin: 16px 0 8px; }
.info-section p { margin-bottom: 10px; color: var(--text-muted); }
pre { background: var(--pre-bg); border-radius: 6px; padding: 14px; overflow-x: auto; font-size: 13px; border: 1px solid var(--border); }
pre code { color: var(--text); }

/* Blocos de código dark (curl examples) */
pre[style*="#1e293b"], pre[style*="background:#1e293b"] { background: var(--code-bg) !important; }

/* ── Stats ────────────────────────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 14px; }
.stat-card { background: var(--bg); border-radius: var(--radius); padding: 14px; text-align: center; border: 1px solid var(--border); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--accent); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 20px 0; text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 40px; }
.site-footer a { color: var(--accent); text-decoration: none; }

/* ── Responsivo ───────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
  .main-nav { display: none; }
  .tools-grid { grid-template-columns: 1fr 1fr; }
  .theme-toggle span.label { display: none; }
}

/* ── Logo inline SVG ─────────────────────────────────────────────────────── */
.logo { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.logo svg { display: block; }

/* ── Header refinado ─────────────────────────────────────────────────────── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  position: sticky;
  top: 0;
  z-index: 200;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
[data-theme="dark"] .site-header {
  background: rgba(30, 41, 59, 0.95);
}

/* ── Footer refinado ──────────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 28px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 48px;
}
.footer-logo { display: flex; justify-content: center; align-items: center; }
.site-footer a { color: var(--accent); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* ── Hero melhorado ───────────────────────────────────────────────────────── */
.hero {
  margin-bottom: 36px;
  padding: 32px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, #2563eb, #7c3aed, #2563eb);
  background-size: 200%;
  animation: gradientShift 4s linear infinite;
}
@keyframes gradientShift { 0%{background-position:0%} 100%{background-position:200%} }
.hero h1 { font-size: 26px; margin-bottom: 6px; font-weight: 700; }
.hero p { color: var(--text-muted); font-size: 15px; max-width: 560px; }

/* ── Category header ──────────────────────────────────────────────────────── */
.category-section h2 {
  font-size: 17px;
  margin-bottom: 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
  color: var(--text);
}

/* ── Tool card melhorado ──────────────────────────────────────────────────── */
.tool-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 14px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color .15s, transform .15s;
}
.tool-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.tool-name { font-weight: 600; font-size: 14px; }
.tool-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }
