/* AIFAESA CTR 2026 — institutional stylesheet
   Pure CSS, no dependencies. UTF-8. */

:root {
  --primary: #7a1f1f;
  --primary-dark: #5c1616;
  --accent: #c9a227;
  --ink: #23272b;
  --muted: #6b7075;
  --bg: #f6f5f2;
  --card: #ffffff;
  --line: #ddd9d2;
  --ok: #2e7d32;
  --warn: #b26a00;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

/* ---- Language toggle ---- */
body[data-lang="tet"] .pt { display: none !important; }
body[data-lang="pt"] .tet { display: none !important; }

/* ---- Header ---- */
.site-header {
  background: var(--primary);
  color: #fff;
  padding: 0.9rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  border-bottom: 4px solid var(--accent);
}

.brand-title {
  font-size: 1.05rem;
  font-weight: bold;
  letter-spacing: 0.02em;
}

.brand-sub {
  font-size: 0.85rem;
  opacity: 0.9;
}

.lang-toggle button {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.35rem 0.85rem;
  border: 1px solid rgba(255,255,255,0.6);
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.lang-toggle button.active {
  background: #fff;
  color: var(--primary);
  font-weight: bold;
}

.lang-toggle button:first-child { border-radius: 4px 0 0 4px; }
.lang-toggle button:last-child { border-radius: 0 4px 4px 0; border-left: none; }

/* ---- Navigation ---- */
.site-nav {
  background: var(--primary-dark);
  display: flex;
  flex-wrap: wrap;
  padding: 0 0.6rem;
}

.site-nav a {
  color: #f2e9e9;
  text-decoration: none;
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.78rem;
  padding: 0.65rem 0.8rem;
  white-space: nowrap;
}

.site-nav a:hover { background: rgba(255,255,255,0.12); }

.site-nav a.active {
  background: var(--bg);
  color: var(--primary);
  font-weight: bold;
}

/* ---- Layout ---- */
main {
  max-width: 960px;
  margin: 0 auto;
  padding: 1.4rem 1.2rem 3rem;
}

h1 { color: var(--primary); font-size: 1.55rem; margin: 0.8rem 0 0.4rem; }
h2 { color: var(--primary-dark); font-size: 1.2rem; margin-top: 1.8rem; border-bottom: 2px solid var(--line); padding-bottom: 0.25rem; }
h3 { font-size: 1.02rem; margin-top: 1.3rem; }

.lead { font-size: 1.02rem; color: var(--muted); margin-top: 0; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.1rem 1.3rem;
  margin: 1rem 0;
}

.note {
  border-left: 4px solid var(--accent);
  background: #fdf9ee;
  padding: 0.7rem 1rem;
  font-size: 0.9rem;
  margin: 1rem 0;
}

.badge {
  display: inline-block;
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: bold;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: var(--primary);
  border-radius: 3px;
  padding: 0.15rem 0.5rem;
  vertical-align: middle;
}

.badge.gold { background: var(--accent); color: #3d2f00; }

/* ---- Tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  font-size: 0.9rem;
  margin: 0.8rem 0;
}

th, td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--primary);
  color: #fff;
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.75rem;
}

tr:nth-child(even) td { background: #faf9f6; }

.table-wrap { overflow-x: auto; }

/* ---- Timeline (index) ---- */
.timeline {
  list-style: none;
  margin: 1.5rem 0;
  padding: 0 0 0 1.6rem;
  border-left: 3px solid var(--primary);
}

.timeline li {
  position: relative;
  margin: 0 0 1.3rem;
  padding: 0 0 0 1rem;
}

.timeline li::before {
  content: attr(data-step);
  position: absolute;
  left: -2.55rem;
  top: 0;
  width: 1.8rem;
  height: 1.8rem;
  line-height: 1.8rem;
  text-align: center;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: bold;
}

.timeline .tl-date {
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
}

.timeline .tl-title { font-weight: bold; }

.timeline a { color: var(--primary); }

/* ---- Stage pages ---- */
.stage-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.8rem;
  margin: 1rem 0;
}

.stage-meta .card { margin: 0; }

.stage-meta .label {
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  display: block;
}

.pager {
  display: flex;
  justify-content: space-between;
  margin-top: 2rem;
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.85rem;
}

.pager a {
  color: var(--primary);
  text-decoration: none;
  border: 1px solid var(--line);
  background: var(--card);
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
}

.pager a:hover { border-color: var(--primary); }

/* ---- Lists ---- */
ul.docs li, ol.docs li { margin-bottom: 0.35rem; }

/* ---- Buttons ---- */
.btn {
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}

.btn.secondary {
  background: var(--card);
  color: var(--primary);
}

.btn.danger {
  background: var(--card);
  color: #a02020;
  border-color: #a02020;
}

.btn:hover { opacity: 0.88; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

/* ---- Checklist ---- */
#checklist-table td.cell {
  text-align: center;
  cursor: pointer;
  user-select: none;
  font-size: 1rem;
  min-width: 2.2rem;
}

#checklist-table td.cell.v { color: var(--ok); font-weight: bold; }
#checklist-table td.cell.na { color: var(--muted); }

#checklist-table td.status-ok { color: var(--ok); font-weight: bold; }
#checklist-table td.status-no { color: var(--warn); }

#checklist-table input, #checklist-table select {
  font-family: inherit;
  font-size: 0.85rem;
  border: 1px solid var(--line);
  padding: 0.25rem;
  width: 100%;
  min-width: 9rem;
}

#checklist-table select { min-width: 7rem; }

.legend { font-size: 0.8rem; color: var(--muted); }

/* ---- Forms ---- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem 1.2rem;
}

.field { display: flex; flex-direction: column; }
.field-wide { grid-column: 1 / -1; }

.flabel {
  font-family: Verdana, Arial, sans-serif;
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="date"],
.field input[type="file"],
.field select {
  font-family: inherit;
  font-size: 0.92rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  width: 100%;
}

.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(122,31,31,0.12);
}

.field.checkbox {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
}

.field.checkbox input { margin-top: 0.2rem; }

@media (max-width: 620px) {
  .form-grid { grid-template-columns: 1fr; }
}

/* ---- Footer ---- */
.site-footer {
  border-top: 4px solid var(--accent);
  background: var(--primary);
  color: #f0e7e7;
  font-size: 0.8rem;
  text-align: center;
  padding: 1rem;
}

/* ---- Downloads ---- */
.doc-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.doc-item .btn { text-decoration: none; display: inline-block; }

/* ---- Print ---- */
@media print {
  .site-header, .site-nav, .toolbar, .pager, .lang-toggle, .no-print, .site-footer {
    display: none !important;
  }
  body { background: #fff; }
  main { max-width: 100%; padding: 0; }
  table { font-size: 0.75rem; }
  th { background: #eee !important; color: #000 !important; }
  .print-header { display: block !important; }
}

.print-header { display: none; text-align: center; margin-bottom: 1rem; }

/* ---- Responsive ---- */
@media (max-width: 620px) {
  .site-nav { justify-content: flex-start; }
  h1 { font-size: 1.3rem; }
  main { padding: 1rem 0.8rem 2.5rem; }
}
