/* ===========================================================================
   shared.css — fundação visual compartilhada
   (reset, tokens, header, navegação, footer, botões, tipografia, cards,
    formulários, utilitários de layout)
   =========================================================================== */

/* ---------- Design tokens ---------- */
/* Tokens base do Pratikobr. V1 da Revisão Visual Ampla (2026-04-17) absorveu
   a "variante A" do material do Claude Design: preserva paleta oficial (azul
   #2453FF, verde #16C784, navy footer #0F172A) e adiciona tokens granulares
   que faltavam (accent-glow, surface-2, text-subtle, border-strong, hero-grad-*).
   Ver docs/visual-review/collision-map.md para o mapeamento completo. */
:root {
  color-scheme: light;
  --bg: #F7F9FC;
  --surface: #FFFFFF;
  --surface-2: #FAFBFE;
  --text: #0F172A;
  --text-muted: #64748B;
  --text-subtle: #94A3B8;
  --accent: #2453FF;
  --accent-hover: #1A3FD4;
  --accent-light: rgba(36, 83, 255, 0.08);
  --accent-glow: rgba(36, 83, 255, 0.22);
  --accent-contrast: #FFFFFF;
  --green: #16C784;
  --green-light: rgba(22, 199, 132, 0.10);
  --border: #E5EAF2;
  --border-strong: #D4DCE8;
  --border-hover: #C8D1DE;
  --footer-bg: #0F172A;
  --hero-grad-1: #F7F9FC;
  --hero-grad-2: #EEF2FF;
  --hero-grad-3: #F7F9FC;
  --max-width: 1200px;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 2px 8px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08), 0 1px 4px rgba(15, 23, 42, 0.04);
  --font:
    "Inter Tight", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* ---------- Tema escuro ---------- */
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0B0F1A;
  --surface: #141B2D;
  --surface-2: #0F1626;
  --text: #E2E8F0;
  --text-muted: #8896AB;
  --text-subtle: #64748B;
  --accent: #4B7BFF;
  --accent-hover: #6B93FF;
  --accent-light: rgba(75, 123, 255, 0.14);
  --accent-glow: rgba(75, 123, 255, 0.28);
  --green: #1FD68D;
  --green-light: rgba(31, 214, 141, 0.14);
  --border: #1E293B;
  --border-strong: #273449;
  --border-hover: #334155;
  --footer-bg: #060911;
  --hero-grad-1: #0B0F1A;
  --hero-grad-2: #0D1326;
  --hero-grad-3: #0B0F1A;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35), 0 1px 4px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .site-header {
  background: rgba(11, 15, 26, 0.88);
  border-bottom-color: rgba(30, 41, 59, 0.6);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .site-footer {
  border-top: 1px solid var(--border);
}

[data-theme="dark"] .form-error {
  color: #f87171;
}

[data-theme="dark"] .form-input:focus {
  box-shadow: 0 0 0 3px rgba(75, 123, 255, 0.2);
}

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

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1;
}

a {
  color: inherit;
}

/* ---------- Acessibilidade ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: white;
  padding: 10px 14px;
  border-radius: 0 0 var(--radius) 0;
  z-index: 100;
  text-decoration: none;
}
.skip-link:focus {
  left: 0;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Header ---------- */
.site-header {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border-bottom: 1px solid rgba(229, 234, 242, 0.6);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #5b7aff);
  box-shadow: 0 2px 8px rgba(36, 83, 255, 0.25);
}

.brand-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-nav {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.nav-item {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  transition: color 160ms ease, background 160ms ease;
}
.nav-item:hover {
  color: var(--text);
  background: var(--accent-light);
}
.nav-item--active {
  color: var(--accent);
  font-weight: 500;
  background: var(--accent-light);
}
.nav-item--cta {
  background: var(--accent);
  color: white;
  font-weight: 500;
  padding: 7px 18px;
  border-radius: 8px;
  margin-left: 4px;
  transition: background 160ms ease, box-shadow 160ms ease, transform 80ms ease;
}
.nav-item--cta:hover {
  background: var(--accent-hover);
  color: white;
  box-shadow: 0 2px 8px rgba(36, 83, 255, 0.3);
  transform: translateY(-1px);
}

.nav-logout {
  display: contents;
}
button.nav-item {
  background: none;
  border: none;
  padding: 6px 12px;
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--footer-bg);
  padding: 36px 0;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  font-weight: 700;
  font-size: 1.05rem;
  margin: 0;
  color: #ffffff;
}

.footer-note {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-link {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 160ms ease;
}

.footer-link:hover {
  color: #ffffff;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 80ms ease;
}
.btn:disabled,
.btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.65;
}
.btn--primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 2px 8px rgba(36, 83, 255, 0.25);
}
.btn--primary:not(:disabled):hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 12px rgba(36, 83, 255, 0.35);
  transform: translateY(-1px);
}
.btn--ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border);
}
.btn--ghost:not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.btn--block {
  width: 100%;
}

.btn--danger {
  background: #dc2626;
  color: #fff;
  border-color: #dc2626;
  box-shadow: 0 1px 2px rgba(220, 38, 38, 0.18);
}
.btn--danger:not(:disabled):hover {
  background: #b91c1c;
  border-color: #b91c1c;
}
[data-theme="dark"] .btn--danger {
  background: #ef4444;
  border-color: #ef4444;
}
[data-theme="dark"] .btn--danger:not(:disabled):hover {
  background: #dc2626;
  border-color: #dc2626;
}

.btn-badge {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
}
.btn--ghost .btn-badge {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ---------- Linha de CTAs (grupo de botões inline) ---------- */
.btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ---------- Tipografia utilitária ---------- */
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-light);
  padding: 6px 14px;
  border-radius: 999px;
  margin: 0 0 24px;
}

.section-title {
  font-size: 1.625rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 36px;
  color: var(--text);
}

/* ---------- Hero genérico de páginas internas ---------- */
.page-hero {
  padding: 80px 0 48px;
  background: linear-gradient(180deg, var(--accent-light), transparent);
}
.page-hero-inner {
  max-width: 760px;
}
.page-title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 18px;
  font-weight: 700;
}
.page-subtitle {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 620px;
  line-height: 1.7;
}

/* ---------- Seção genérica ---------- */
.section {
  padding: 72px 0;
}
.section--surface {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* ---------- Prose (blocos de texto longo) ---------- */
.prose {
  max-width: 720px;
}
.prose p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.75;
}
.prose p:last-child {
  margin-bottom: 0;
}
.prose strong {
  color: var(--text);
  font-weight: 600;
}
.prose h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 32px 0 12px;
}
.prose h2:first-child {
  margin-top: 0;
}
.prose ul {
  margin: 0 0 16px;
  padding-left: 20px;
  color: var(--text-muted);
  font-size: 1.0625rem;
  line-height: 1.75;
}
.prose li {
  margin-bottom: 8px;
}
.prose li:last-child {
  margin-bottom: 0;
}

/* ---------- Card genérico ---------- */
.card-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs);
  transition: box-shadow 200ms ease, transform 200ms ease, border-color 200ms ease;
}
.card:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.card-title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.card-text {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
}
.card-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  transition: color 160ms ease;
}
.card-link:hover {
  color: var(--accent-hover);
}

/* ---------- Formulário ---------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
}
.form-input {
  font-family: inherit;
  font-size: 0.95rem;
  color: var(--text);
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px rgba(36, 83, 255, 0.1);
}
.form-hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0;
}
.form-error {
  font-size: 0.8125rem;
  color: #dc2626;
  margin: 0;
}
.form-notice {
  font-size: 0.875rem;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  margin: 0;
}

.flash-banner {
  padding-top: 16px;
}

/* ---------- Filtro/busca ---------- */
.filter-form {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 28px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.filter-form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 220px;
  min-width: 180px;
}
.filter-form-field:has(select) {
  flex: 0 1 180px;
}
.filter-form-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}
.filter-form-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ---------- Paginação ---------- */
.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.pagination-link {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  transition: border-color 160ms ease, background 160ms ease;
}

.pagination-link:hover {
  border-color: var(--accent);
  background: var(--bg);
}

.pagination-link--disabled {
  color: var(--text-muted);
  background: transparent;
  border-color: var(--border);
  cursor: not-allowed;
}

.pagination-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.pagination-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  font-size: 0.875rem;
  color: var(--text-muted);
  border-radius: 8px;
  border: 1px solid transparent;
}

.pagination-page a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--text);
  text-decoration: none;
  border-radius: 8px;
  padding: 0 10px;
  transition: background 160ms ease;
}

.pagination-page a:hover {
  background: var(--surface);
}

.pagination-page--current {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.pagination-page--ellipsis {
  color: var(--text-muted);
  cursor: default;
}

/* ---------- Announcement bar ---------- */
.announcement-bar {
  border-bottom: 1px solid var(--border);
  padding: 10px 0;
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
}

.announcement-bar--info {
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  border-bottom-color: color-mix(in srgb, var(--accent) 25%, var(--border));
}

.announcement-bar--warning {
  background: #fef3c7;
  color: #78350f;
  border-bottom-color: #fcd34d;
}

.announcement-bar--success {
  background: color-mix(in srgb, var(--green) 15%, var(--surface));
  border-bottom-color: color-mix(in srgb, var(--green) 30%, var(--border));
}

[data-theme="dark"] .announcement-bar--warning {
  background: #78350f;
  color: #fef3c7;
  border-bottom-color: #b45309;
}

.announcement-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.announcement-bar-message {
  margin: 0;
  line-height: 1.5;
}

.announcement-bar-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  background: transparent;
  color: currentColor;
  border-radius: 6px;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity 160ms ease, background 160ms ease;
}

.announcement-bar-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .announcement-bar-close:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Chip inline usado no admin/index */
.announcement-variant {
  display: inline-block;
  padding: 2px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.announcement-variant--info {
  background: color-mix(in srgb, var(--accent) 18%, var(--surface));
  color: var(--accent);
}

.announcement-variant--warning {
  background: #fef3c7;
  color: #78350f;
}

.announcement-variant--success {
  background: color-mix(in srgb, var(--green) 22%, var(--surface));
  color: var(--green);
}

[data-theme="dark"] .announcement-variant--warning {
  background: #78350f;
  color: #fef3c7;
}

/* ---------- Responsivo ---------- */
@media (max-width: 720px) {
  .header-inner {
    flex-wrap: wrap;
    padding: 12px 0;
    min-height: 0;
  }
  .site-nav {
    gap: 4px;
    width: 100%;
  }
  .page-hero {
    padding: 56px 0 28px;
  }
  .section {
    padding: 48px 0;
  }
}

@media (max-width: 480px) {
  .site-nav {
    gap: 4px;
    font-size: 0.9rem;
  }
  .nav-item {
    font-size: 0.85rem;
    padding: 5px 10px;
  }
  .nav-item--cta {
    padding: 6px 14px;
    font-size: 0.85rem;
  }
}

/* ---------- Toggle de tema ---------- */
.theme-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
  margin-left: 4px;
}
.theme-toggle:hover {
  color: var(--text);
  border-color: var(--border-hover);
  background: var(--accent-light);
}
.theme-icon--sun {
  display: none;
}
[data-theme="dark"] .theme-icon--moon {
  display: none;
}
[data-theme="dark"] .theme-icon--sun {
  display: inline-block;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
