/* Copyright 2026 TrioVia Soluções, Consultoria, Assessoria e Gestão Inovadoras Ltda. */
/* Licensed under the Apache License, Version 2.0 (the "License"). */

/* Paleta Swiss-Mineral TrioVia — contraste >= 7:1 em todos os pares texto/fundo (eMAG / WCAG 2.2 AAA) */
:root {
  --bg: #ffffff;
  --surface: #f2f6f6;
  --surface-strong: #e3ecee;
  --text: #07191c;
  --text-muted: #243b40;
  --accent: #073840;
  --accent-hover: #04252b;
  --accent-contrast: #ffffff;
  --border: #07191c;
  --border-light: #243b40;
  --kw-bg: #e2f0eb;
  --kw-hover: #d4e8e1;
  --kw-text: #0f4533;
  --urgent-bg: #7f1d1d;
  --urgent-text: #ffffff;
  --warn-bg: #7d3208;
  --warn-text: #ffffff;
  --ok-bg: #14543f;
  --ok-text: #ffffff;
  --queue-bg: #07191c;
  --queue-text: #ffffff;
  --focus-ring: #07191c;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.55;
  font-size: 16px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.75rem 1rem;
  font-weight: 700;
  z-index: 100;
  text-decoration: none;
  border: 2px solid var(--bg);
}

.skip-link:focus {
  left: 0.75rem;
  top: 0.75rem;
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--bg);
}

:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--bg);
}

.app-shell {
  max-width: 54rem;
  margin: 0 auto;
  padding: 1rem 1rem 3rem;
}

.site-header {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 0.25rem;
  padding: 1rem 1.25rem;
  margin-bottom: 1rem;
}

.header-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.badge-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--accent);
  color: var(--accent-contrast);
  padding: 0.25rem 0.65rem;
  border-radius: 0.25rem;
  font-weight: 700;
  font-size: 0.875rem;
}

.badge-online {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.badge-offline {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.badge-queue {
  background: var(--queue-bg);
  color: var(--queue-text);
}

h1 {
  margin: 0.25rem 0 0.35rem;
  color: var(--accent);
  font-size: 1.75rem;
  line-height: 1.2;
}

h2 {
  margin: 0 0 0.75rem;
  color: var(--accent);
  font-size: 1.35rem;
  line-height: 1.3;
}

h2:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 4px;
}

h3 {
  margin: 0 0 0.5rem;
  color: var(--text);
  font-size: 1.125rem;
  line-height: 1.35;
}

h4 {
  margin: 0.75rem 0 0.4rem;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.35;
}

.lead {
  margin: 0 0 0.5rem;
  color: var(--text);
}

.infra-status {
  margin: 0.5rem 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
}

.tts-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface-strong);
  border: 2px solid var(--accent);
  border-radius: 0.25rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
}

.tts-bar[hidden] {
  display: none;
}

.tts-bar-text {
  flex: 1 1 16rem;
  font-size: 0.9375rem;
  color: var(--text);
}

.nav-steps {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .nav-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.nav-btn {
  min-height: 48px;
  padding: 0.65rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 0.25rem;
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  text-align: center;
}

.nav-btn:hover {
  background: var(--surface);
}

.nav-btn[aria-current="page"] {
  background: var(--accent);
  color: var(--accent-contrast);
  border-color: var(--accent);
}

.panel {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 0.25rem;
  padding: 1.25rem;
}

.panel[hidden] {
  display: none;
}

.card {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: 0.25rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.card:last-child {
  margin-bottom: 0;
}

.form-group {
  margin-bottom: 1rem;
}

label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.hint {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
  width: 100%;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 2px solid var(--border);
  border-radius: 0.25rem;
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

textarea {
  min-height: 5.5rem;
  resize: vertical;
}

.row-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 600px) {
  .row-grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .row-grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.6rem 1rem;
  border: 2px solid var(--accent);
  border-radius: 0.25rem;
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  font-size: 0.9375rem;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover:not(:disabled) {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn-secondary {
  background: var(--bg);
  color: var(--accent);
  border-color: var(--accent);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-strong);
}

.btn-small {
  min-height: 44px;
  padding: 0.45rem 0.8rem;
  font-size: 0.875rem;
}

.btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.5rem 0;
}

.keyword-chip {
  display: inline-block;
  background: var(--kw-bg);
  color: var(--kw-text);
  border: 1.5px solid var(--kw-text);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.875rem;
  font-weight: 700;
}

.chip-btn {
  min-height: 44px;
  background: var(--kw-bg);
  color: var(--kw-text);
  border: 1.5px solid var(--kw-text);
  border-radius: 0.25rem;
  padding: 0.45rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 700;
  cursor: pointer;
}

.chip-btn:hover {
  background: var(--kw-hover);
}

.pill {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 0.25rem;
  font-size: 0.8125rem;
  font-weight: 700;
}

.pill-urgent {
  background: var(--urgent-bg);
  color: var(--urgent-text);
}

.pill-attention {
  background: var(--warn-bg);
  color: var(--warn-text);
}

.pill-info {
  background: var(--accent);
  color: var(--accent-contrast);
}

.pill-ok {
  background: var(--ok-bg);
  color: var(--ok-text);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.metric-box {
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: 0.25rem;
  padding: 0.65rem 0.75rem;
}

.metric-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-muted);
}

.metric-value {
  display: block;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
}

.steps-list {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.35rem;
}

.steps-list li {
  margin-bottom: 0.35rem;
}

.check-item {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--border-light);
  border-radius: 0.25rem;
  margin-bottom: 0.5rem;
  background: var(--surface);
}

.check-item input[type="checkbox"] {
  width: 24px;
  height: 24px;
  margin: 0.05rem 0 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.check-item label {
  margin: 0;
  font-weight: 600;
  cursor: pointer;
}

.mono-hash {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  background: var(--surface);
  border: 1.5px solid var(--border-light);
  border-radius: 0.25rem;
  padding: 0.4rem 0.55rem;
  word-break: break-all;
  color: var(--text);
}

.alert-box {
  border: 2px solid var(--border);
  border-radius: 0.25rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  background: var(--surface-strong);
  color: var(--text);
  font-weight: 600;
}

.alert-box[hidden] {
  display: none;
}

.alert-urgent {
  border-color: var(--urgent-bg);
  background: #fef2f2;
  color: #7f1d1d;
}

.site-footer {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 2px solid var(--border-light);
  font-size: 0.875rem;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
