/* Portal de Transparencia HUTec - CSS moderno e acessivel */

:root {
  /* Paleta verde moderna (emerald) */
  --primary: #059669;          /* emerald-600 */
  --primary-dark: #047857;     /* emerald-700 */
  --primary-darker: #065f46;   /* emerald-800 */
  --primary-light: #10b981;    /* emerald-500 */
  --primary-lighter: #d1fae5;  /* emerald-100 */
  --primary-lightest: #ecfdf5; /* emerald-50 */

  /* Neutros */
  --ink: #0f172a;         /* slate-900 */
  --text: #1e293b;        /* slate-800 */
  --muted: #64748b;       /* slate-500 */
  --border: #e2e8f0;      /* slate-200 */
  --border-strong: #cbd5e1;
  --bg: #ffffff;
  --bg-alt: #f8fafc;      /* slate-50 */
  --bg-soft: #f1f5f9;     /* slate-100 */

  /* Estado */
  --danger: #dc2626;
  --warning: #d97706;
  --info: #0284c7;

  --radius: 8px;
  --radius-sm: 4px;
  --shadow: 0 1px 3px rgba(15,23,42,.08), 0 1px 2px rgba(15,23,42,.04);
  --shadow-md: 0 4px 6px -1px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.04);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-alt);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--primary-darker); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid var(--primary-light);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin-top: 0; }
h1 { font-size: clamp(1.75rem, 2.5vw, 2.25rem); margin-bottom: .5rem; }
h2 { font-size: 1.4rem; margin-top: 2.2rem; margin-bottom: .8rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 1rem; }
.lead { font-size: 1.125rem; color: var(--muted); max-width: 70ch; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mono { font-family: var(--font-mono); font-size: .9em; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; top: -40px; left: 0;
  background: var(--ink); color: #fff; padding: .5rem 1rem;
  text-decoration: none; z-index: 100;
}
.skip-link:focus { top: 0; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ====== Topbar ====== */
.topbar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar-inner {
  display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: 1rem 1.25rem; flex-wrap: wrap;
}
.brand {
  display: inline-flex; align-items: center; gap: .75rem;
  text-decoration: none; color: var(--ink);
}
.brand-logo { height: 48px; width: auto; }
.brand-text strong { display: block; font-size: 1.15rem; color: var(--primary-dark); }
.brand-text small { display: block; font-size: .8rem; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; }

.back-site {
  display: inline-block;
  padding: .5rem 1rem;
  background: var(--primary-lightest);
  color: var(--primary-darker);
  text-decoration: none;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: .9rem;
  border: 1px solid var(--primary-lighter);
  transition: background .15s;
}
.back-site:hover { background: var(--primary-lighter); }

/* ====== Mainnav ====== */
.mainnav {
  background: var(--primary);
  box-shadow: inset 0 -1px 0 rgba(0,0,0,.1);
}
.mainnav ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap;
}
.mainnav li { }
.mainnav a {
  display: block;
  padding: .85rem 1rem;
  color: #ecfdf5;
  text-decoration: none;
  font-weight: 500;
  font-size: .95rem;
  transition: background .15s;
  border-bottom: 3px solid transparent;
}
.mainnav a:hover { background: var(--primary-dark); color: #fff; }
.mainnav a[aria-current="page"] {
  background: var(--primary-dark);
  color: #fff;
  border-bottom-color: #fff;
}

/* ====== Main ====== */
.main {
  padding: 2rem 1.25rem 3rem;
  background: var(--bg);
  min-height: calc(100vh - 400px);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

/* ====== Breadcrumb ====== */
.crumbs ol {
  list-style: none; padding: 0; margin: 0 0 1.5rem;
  display: flex; flex-wrap: wrap; gap: .25rem .5rem;
  font-size: .875rem; color: var(--muted);
}
.crumbs li:not(:last-child)::after {
  content: "›"; margin-left: .5rem; color: var(--border-strong);
}
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--primary-dark); text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 500; }

/* ====== Hero ====== */
.hero {
  background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary) 100%);
  color: #fff;
  padding: 2.5rem 2rem;
  border-radius: var(--radius);
  margin-bottom: 2rem;
  box-shadow: var(--shadow-md);
}
.hero h1 { color: #fff; margin-bottom: 1rem; }
.hero-sub { color: #ecfdf5; font-size: 1.05rem; max-width: 70ch; margin-bottom: 1.5rem; }
.hero-sub strong { color: #fff; }
.hero-search {
  display: flex; gap: .5rem; max-width: 640px;
  background: #fff; padding: .4rem; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.hero-search input {
  flex: 1; border: 0; padding: .75rem 1rem; font-size: 1rem;
  background: transparent; color: var(--ink); outline: none;
}
.hero-search button {
  padding: .75rem 1.5rem; border: 0; background: var(--primary-dark);
  color: #fff; font-weight: 600; border-radius: var(--radius-sm);
  cursor: pointer; font-size: .95rem; transition: background .15s;
}
.hero-search button:hover { background: var(--primary-darker); }

/* ====== Stats ====== */
.stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.stat {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; text-align: center;
}
.stat-n { display: block; font-size: 1.75rem; font-weight: 700; color: var(--primary-dark); line-height: 1.2; }
.stat-l { display: block; font-size: .875rem; color: var(--muted); margin-top: .25rem; text-transform: uppercase; letter-spacing: .05em; }

/* ====== Cards ====== */
.cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem; margin-bottom: 2rem;
}
.card {
  display: flex; flex-direction: column; gap: .5rem;
  padding: 1.5rem;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); text-decoration: none; color: var(--ink);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}
.card-icon { font-size: 2rem; line-height: 1; }
.card-title { font-size: 1.05rem; color: var(--ink); }
.card-desc { font-size: .875rem; color: var(--muted); flex: 1; }
.card-count {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .05em;
  color: var(--primary-dark); font-weight: 600;
  padding-top: .5rem; border-top: 1px solid var(--border); margin-top: .5rem;
}

/* ====== Two-col ====== */
.two-col {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem; margin-top: 2rem;
}

/* ====== Tables ====== */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
}
.data-table {
  width: 100%; border-collapse: collapse; font-size: .9rem;
}
.data-table th, .data-table td {
  padding: .75rem 1rem; text-align: left;
  border-bottom: 1px solid var(--border);
}
.data-table th {
  background: var(--bg-soft); font-weight: 600;
  color: var(--ink); position: sticky; top: 0;
  border-bottom: 2px solid var(--border-strong);
}
.data-table tbody tr:hover { background: var(--primary-lightest); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table td.num, .data-table th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ====== Forms / Search ====== */
.search-form {
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.25rem; margin: 1.5rem 0;
}
.form-row { display: flex; gap: .5rem; flex-wrap: wrap; }
.form-row input[type=search], .form-row input[type=text] {
  flex: 1; min-width: 250px; padding: .65rem 1rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 1rem;
}
.form-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
}
.form-grid label { display: block; font-size: .85rem; font-weight: 500; color: var(--muted); margin-bottom: .3rem; }
.form-grid input {
  width: 100%; padding: .6rem .75rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: .95rem;
}
.form-row button, .form-grid button {
  padding: .65rem 1.5rem; background: var(--primary);
  color: #fff; border: 0; border-radius: var(--radius-sm);
  font-weight: 600; cursor: pointer; font-size: .95rem;
}
.form-row button:hover, .form-grid button:hover { background: var(--primary-dark); }
.radios { display: flex; gap: 1.25rem; margin-top: 1rem; font-size: .95rem; }
.radios label { cursor: pointer; }

/* ====== Buttons ====== */
.btn {
  display: inline-block; padding: .5rem 1rem;
  background: var(--primary); color: #fff; border: 0;
  border-radius: var(--radius-sm); font-weight: 500;
  text-decoration: none; cursor: pointer; font-size: .9rem;
  transition: background .15s;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-sm { padding: .35rem .75rem; font-size: .8rem; }
.btn-ghost {
  background: transparent; color: var(--primary-dark);
  border: 1px solid var(--primary);
}
.btn-ghost:hover { background: var(--primary-lightest); color: var(--primary-darker); }

/* ====== Tags tipo pagamento ====== */
.tag {
  display: inline-block;
  padding: .15rem .6rem;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  white-space: nowrap;
}
.tag-rpa { background: #fef3c7; color: #854d0e; border: 1px solid #fde68a; }
.tag-nf  { background: var(--primary-lightest); color: var(--primary-darker); border: 1px solid var(--primary-lighter); }
.tag-generic { background: var(--bg-soft); color: var(--muted); border: 1px solid var(--border); }

/* ====== Doc list featured (3 itens principais do projeto) ====== */
.doc-list-featured li {
  background: var(--bg-alt);
  border-left: 4px solid var(--primary);
}
.doc-list-featured li.doc-empty {
  opacity: .55;
  background: var(--bg-soft);
  border-left-color: var(--border-strong);
}
.doc-list-featured li.doc-empty .doc-title,
.doc-list-featured li.doc-empty .doc-icon {
  text-decoration: line-through;
  text-decoration-style: wavy;
  text-decoration-color: var(--border-strong);
}
.doc-list-featured li.doc-empty {
  padding: .85rem 1rem;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .75rem;
  align-items: center;
}
.doc-details {
  margin-top: 1.5rem;
}
.doc-details summary {
  color: var(--muted);
  font-size: .9rem;
  padding: .5rem 0;
  border: 0;
}

/* ====== Doc list ====== */
.doc-list { list-style: none; padding: 0; margin: 1rem 0; }
.doc-list li {
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: .5rem; background: var(--bg); transition: border-color .15s, box-shadow .15s;
}
.doc-list li:hover {
  border-color: var(--primary-light); box-shadow: var(--shadow);
}
.doc-list a {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: .75rem; align-items: center;
  padding: .85rem 1rem; text-decoration: none; color: var(--ink);
}
.doc-list a:hover { color: var(--primary-darker); }
.doc-icon { font-size: 1.5rem; }
.doc-title { font-weight: 500; }
.doc-meta { font-size: .8rem; color: var(--muted); white-space: nowrap; }

/* ====== Link list ====== */
.link-list { list-style: none; padding: 0; margin: 1rem 0; }
.link-list li { padding: .5rem 0; border-bottom: 1px solid var(--border); }
.link-list li:last-child { border-bottom: 0; }
.link-list a { display: block; padding: .25rem 0; }

/* ====== Meta DL ====== */
.meta-dl {
  display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.25rem;
  background: var(--bg-alt); padding: 1rem 1.25rem;
  border-radius: var(--radius); margin: 1.5rem 0;
}
.meta-dl dt { font-weight: 600; color: var(--muted); font-size: .875rem; text-transform: uppercase; letter-spacing: .03em; }
.meta-dl dd { margin: 0; color: var(--ink); }

/* ====== Chip ====== */
.chip {
  display: inline-block; padding: .25rem .75rem;
  background: var(--primary-lightest); color: var(--primary-darker);
  border-radius: 999px; font-size: .75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .05em;
  border: 1px solid var(--primary-lighter); margin-bottom: .75rem;
}

/* ====== Projeto head ====== */
.projeto-head { margin-bottom: 1.5rem; }
.projeto-head h1 { margin-bottom: .25rem; }
.projeto-head .lead { margin-bottom: 0; }

/* ====== Alerts ====== */
.alert {
  padding: 1rem 1.25rem; border-radius: var(--radius);
  background: var(--bg-soft); border: 1px solid var(--border);
  margin: 1rem 0;
}
.alert-info {
  background: #eff6ff; border-color: #bfdbfe; color: #1e40af;
}
.alert-erro {
  background: #fef2f2; border-color: #fecaca; color: #991b1b;
}

/* ====== Notes ====== */
.note {
  font-size: .85rem; color: var(--muted);
  background: var(--bg-alt); border-left: 3px solid var(--primary-light);
  padding: .75rem 1rem; margin: 1rem 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.note strong { color: var(--ink); }

/* ====== Card info ====== */
.card-info {
  background: var(--primary-lightest); border: 1px solid var(--primary-lighter);
  padding: 1.5rem; border-radius: var(--radius); margin: 1.5rem 0;
}
.card-info h2 { margin-top: 0; color: var(--primary-darker); }

/* ====== Details/FAQ ====== */
details {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: .75rem 1rem; margin-bottom: .5rem;
  background: var(--bg);
}
details summary {
  cursor: pointer; font-weight: 500; padding: .25rem 0;
  color: var(--primary-dark);
}
details[open] summary { border-bottom: 1px solid var(--border); padding-bottom: .75rem; margin-bottom: .75rem; }

/* ====== Footer ====== */
.site-footer {
  background: var(--ink); color: #cbd5e1;
  padding: 3rem 0 1.5rem; margin-top: 3rem;
  font-size: .9rem;
}
.footer-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2rem;
}
.site-footer strong { color: #fff; display: block; margin-bottom: .75rem; font-size: 1rem; }
.footer-links { list-style: none; padding: 0; margin: 0; }
.footer-links li { margin-bottom: .4rem; }
.footer-links a { color: #cbd5e1; }
.footer-links a:hover { color: #fff; }
.site-footer p { margin: 0 0 .35rem; }
.site-footer a { color: #a7f3d0; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
  margin-top: 2rem; padding-top: 1.5rem;
  border-top: 1px solid #334155;
}
.footer-bottom .back-site {
  background: transparent; border-color: #334155; color: #a7f3d0;
}
.footer-bottom .back-site:hover { background: #334155; }

/* ====== Responsivo ====== */
@media (max-width: 720px) {
  .mainnav ul { flex-direction: column; }
  .mainnav li { border-top: 1px solid rgba(255,255,255,.1); }
  .hero { padding: 1.5rem 1.25rem; }
  .hero-search { flex-direction: column; }
  .hero-search button { width: 100%; }
  .topbar-inner { flex-direction: column; align-items: flex-start; }
  .form-row { flex-direction: column; }
  .form-row input, .form-row button { width: 100%; }
  .doc-list a { grid-template-columns: auto 1fr; }
  .doc-meta { grid-column: 2; }
  .data-table { font-size: .825rem; }
  .data-table th, .data-table td { padding: .5rem .625rem; }
  .main { margin-top: 0; border-radius: 0; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

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

/* Print */
@media print {
  .topbar, .mainnav, .site-footer, .btn { display: none; }
  body, .main { background: #fff; }
  a { color: #000; text-decoration: underline; }
}
