/* ==========================================================================
   Central de Ajuda Usadosbr — Design system
   Paleta extraída do site institucional usadosbr.com:
   navy #0a2741 (cor primária oficial da marca), lime #99f639 / #a5ec70,
   verde de sucesso #00c85f, tons neutros de cinza claro, fonte Ubuntu.
   ========================================================================== */

:root {
  --navy-900: #0a2741;
  --navy-800: #082742;
  --navy-700: #213d55;
  --navy-600: #274259;
  --navy-500: #305674;
  --lime-500: #99f639;
  --lime-400: #a5ec70;
  --lime-100: #eefee0;
  --green-600: #00c85f;
  --gray-50: #f8f9fa;
  --gray-100: #f1f5f9;
  --gray-200: #e9ecef;
  --gray-300: #cdd5de;
  --gray-500: #4f5b67;
  --white: #ffffff;
  --text: #0a2741;
  --text-muted: #4f5b67;
  --danger: #d64545;
  --radius-full: 999px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 8px rgba(10, 39, 65, 0.06);
  --shadow-md: 0 12px 28px rgba(10, 39, 65, 0.12);
  --font: 'Ubuntu', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --container-width: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 { font-weight: 700; line-height: 1.25; margin: 0 0 16px; color: var(--navy-900); }
h1 { font-size: clamp(28px, 4vw, 42px); }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 20px; }
p { margin: 0 0 16px; color: var(--text-muted); }

/* Marca / logo -------------------------------------------------------- */

.brand-mark {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  width: 20px;
}
.brand-mark::before,
.brand-mark::after {
  content: '';
  display: block;
  height: 6px;
  border-radius: var(--radius-full);
  background: var(--lime-500);
}
.brand-mark::before { width: 100%; }
.brand-mark::after { width: 62%; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}
.brand-name {
  font-size: 19px;
  color: var(--white);
  letter-spacing: -0.02em;
}
.brand-name strong { font-weight: 700; }
.brand-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--lime-400);
  border-left: 1px solid rgba(255,255,255,0.3);
  margin-left: 6px;
  padding-left: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* Header ---------------------------------------------------------------- */

.site-header {
  background: var(--navy-900);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-top: 18px;
  padding-bottom: 18px;
}
.site-nav {
  display: flex;
  gap: 28px;
  flex: 1;
  justify-content: center;
}
.nav-link {
  color: rgba(255,255,255,0.82);
  font-size: 15px;
  font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.nav-link:hover { color: var(--white); }
.nav-link.is-active { color: var(--white); border-color: var(--lime-500); }
.header-cta { white-space: nowrap; }

@media (max-width: 760px) {
  .site-nav { display: none; }
  .header-cta { display: none; }
}

/* Botões ------------------------------------------------------------------ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease, color .12s ease;
  line-height: 1;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--lime-500); color: var(--navy-900); }
.btn-primary:hover { background: var(--lime-400); }
.btn-dark { background: var(--navy-900); color: var(--white); }
.btn-dark:hover { background: var(--navy-700); }
.btn-outline { background: transparent; color: var(--navy-900); border-color: var(--gray-300); }
.btn-outline:hover { border-color: var(--navy-900); }
.btn-ghost-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.35); }
.btn-ghost-light:hover { border-color: var(--white); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-danger { background: var(--danger); color: var(--white); }
.btn-sm { padding: 8px 16px; font-size: 13px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }

/* Hero --------------------------------------------------------------- */

.hero {
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 100%);
  color: var(--white);
  padding: 64px 0 96px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute;
  right: -80px;
  top: -80px;
  width: 320px;
  height: 320px;
  background: radial-gradient(circle, rgba(153,246,57,0.18) 0%, rgba(153,246,57,0) 70%);
}
.hero-inner { position: relative; text-align: center; }
.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--lime-400);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.hero h1 { color: var(--white); max-width: 720px; margin-left: auto; margin-right: auto; }
.hero p.lead { color: rgba(255,255,255,0.78); font-size: 18px; max-width: 560px; margin: 0 auto 32px; }

.search-box {
  max-width: 640px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-full);
  padding: 6px;
  display: flex;
  gap: 6px;
  box-shadow: var(--shadow-md);
}
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  padding: 12px 20px;
  font-family: var(--font);
  font-size: 15px;
  color: var(--text);
}
.search-box button {
  border: none;
}

/* Seções e cards de produto ------------------------------------------- */

.section { padding: 56px 0; }
.section-alt { background: var(--gray-50); }
.section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.section-heading .brand-mark::before,
.section-heading .brand-mark::after { background: var(--lime-500); }
.section-heading .brand-mark { width: 16px; }
.section-heading .brand-mark::before,.section-heading .brand-mark::after{ background: var(--navy-900); }
.section-heading h2 { margin: 0; }

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: transparent; }
.card-icon {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--lime-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  margin-bottom: 6px;
}
.card h3 { margin: 0; font-size: 18px; }
.card p { margin: 0; font-size: 14px; }
.card-link { margin-top: auto; font-weight: 700; color: var(--navy-900); font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.card-link::after { content: '→'; transition: transform .15s ease; }
.card:hover .card-link::after { transform: translateX(3px); }

.product-card { border-top: 4px solid var(--lime-500); }

/* Artigos em lista ------------------------------------------------------- */

.article-list { display: flex; flex-direction: column; gap: 12px; }
.article-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  background: var(--white);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.article-row:hover { border-color: var(--lime-500); box-shadow: var(--shadow-sm); }
.article-row .doc-icon { font-size: 20px; margin-top: 2px; }
.article-row h4 { margin: 0 0 4px; font-size: 16px; color: var(--navy-900); }
.article-row p { margin: 0; font-size: 14px; }

/* Breadcrumb ------------------------------------------------------------- */

.breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 24px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--navy-900); text-decoration: underline; }
.breadcrumb .crumb-sep { color: var(--gray-300); }

/* Conteúdo de artigo ------------------------------------------------------ */

.article-header { padding: 40px 0 8px; }
.article-meta { color: var(--text-muted); font-size: 13px; margin-bottom: 8px; }
.article-body {
  max-width: 760px;
  font-size: 16px;
}
.article-body h2 { margin-top: 32px; }
.article-body h3 { margin-top: 24px; }
.article-body ul, .article-body ol { padding-left: 22px; color: var(--text-muted); }
.article-body li { margin-bottom: 6px; }
.article-body blockquote {
  margin: 20px 0;
  padding: 14px 20px;
  background: var(--lime-100);
  border-left: 4px solid var(--lime-500);
  border-radius: var(--radius-sm);
  color: var(--navy-900);
}
.article-body code {
  background: var(--gray-100);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}
.article-body a { color: var(--navy-900); text-decoration: underline; text-decoration-color: var(--lime-500); }
.article-body hr { border: none; border-top: 1px solid var(--gray-200); margin: 28px 0; }

.category-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: var(--navy-900);
  color: var(--white);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  width: fit-content;
  margin-bottom: 18px;
}

/* Empty state / sem resultados ------------------------------------------- */

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--text-muted);
}
.empty-state .emoji { font-size: 40px; display: block; margin-bottom: 12px; }

/* Fale conosco ------------------------------------------------------------ */

.contact-grid { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: 32px; }

/* Footer ------------------------------------------------------------------ */

.site-footer { background: var(--navy-900); color: rgba(255,255,255,0.7); padding: 36px 0; margin-top: 40px; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 18px; }
.footer-copy { margin: 8px 0 0; font-size: 13px; color: rgba(255,255,255,0.55); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.footer-links a { font-size: 13px; color: rgba(255,255,255,0.75); }
.footer-links a:hover { color: var(--white); }

/* ==========================================================================
   Painel administrativo
   ========================================================================== */

.admin-body { background: var(--gray-50); }

.admin-header { background: var(--navy-900); }
.admin-header-inner {
  max-width: 100%;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.admin-header-right { display: flex; align-items: center; gap: 14px; }
.admin-user { color: var(--white); font-size: 14px; }
.admin-header .btn-ghost { color: rgba(255,255,255,0.75); }
.admin-header .btn-ghost:hover { color: var(--white); }

.admin-shell { display: flex; min-height: calc(100vh - 64px); }
.admin-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid var(--gray-200);
  padding: 24px 12px;
}
.admin-nav-link {
  display: block;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
}
.admin-nav-link:hover { background: var(--gray-100); color: var(--navy-900); }
.admin-nav-link.is-active { background: var(--navy-900); color: var(--white); }

.admin-main { flex: 1; padding: 32px 0; min-width: 0; }

@media (max-width: 760px) {
  .admin-shell { flex-direction: column; }
  .admin-sidebar { width: 100%; display: flex; overflow-x: auto; gap: 4px; padding: 12px; }
  .admin-nav-link { white-space: nowrap; margin-bottom: 0; }
}

.admin-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.admin-page-head h1 { margin: 0; font-size: 24px; }

.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin-bottom: 32px; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 20px;
  border: 1px solid var(--gray-200);
}
.stat-card .stat-value { font-size: 30px; font-weight: 700; color: var(--navy-900); }
.stat-card .stat-label { font-size: 13px; color: var(--text-muted); }

.panel {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
}

table.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  text-align: left;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 10px 14px;
  border-bottom: 2px solid var(--gray-200);
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--gray-100); vertical-align: middle; }
.data-table tr:hover td { background: var(--gray-50); }
.data-table .row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.data-table .muted { color: var(--text-muted); font-size: 13px; }

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 700;
}
.badge-published { background: rgba(0,200,95,0.12); color: #0a8a44; }
.badge-draft { background: var(--gray-100); color: var(--text-muted); }
.badge-role-admin { background: rgba(153,246,57,0.18); color: #5a8a12; }
.badge-role-editor { background: #e8f2fb; color: #0a4a80; }
.admin-header .admin-user .badge { vertical-align: middle; margin-left: 4px; }

.alert { padding: 14px 18px; border-radius: var(--radius-md); margin-bottom: 20px; font-size: 14px; }
.alert-info { background: #e8f2fb; color: #0a4a80; }
.alert-success { background: rgba(0,200,95,0.12); color: #0a8a44; }
.alert-error { background: rgba(214,69,69,0.1); color: var(--danger); }

/* Formulários -------------------------------------------------------------- */

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-weight: 500; font-size: 14px; margin-bottom: 6px; color: var(--navy-900); }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.form-row { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  font-family: var(--font);
  font-size: 14px;
  padding: 11px 14px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--navy-900);
  box-shadow: 0 0 0 3px rgba(10,39,65,0.1);
}
textarea { resize: vertical; min-height: 120px; font-family: 'Menlo', 'Consolas', monospace; font-size: 13px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.checkbox-row input { width: auto; }

.form-actions { display: flex; gap: 12px; margin-top: 24px; }

.editor-grid { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 900px) { .editor-grid { grid-template-columns: 1fr; } }
.preview-panel { position: sticky; top: 20px; }
.preview-panel .article-body { font-size: 14px; }

/* Login / setup ------------------------------------------------------------ */

.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 100%);
  padding: 24px;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.auth-card .brand-mark { margin-bottom: 16px; }
.auth-card .brand-mark::before, .auth-card .brand-mark::after { background: var(--navy-900); }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card p.lead { font-size: 14px; margin-bottom: 28px; }
