:root {
  --navy: #142A52;
  --navy-2: #1F3B70;
  --navy-deep: #0D1D3B;
  --gold: #F5A623;
  --gold-soft: #FFE1A6;
  --sage: #2F9E7B;
  --sage-soft: #DCF2EA;
  --rose: #E2574C;
  --rose-soft: #FBE3E1;
  --cream: #FAF7F0;
  --paper: #FFFFFF;
  --ink: #1B2333;
  --ink-soft: #566078;
  --line: #E7E2D6;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}
h1, h2, h3 {
  font-family: 'Space Grotesk', sans-serif;
  margin: 0;
  letter-spacing: -0.01em;
}
.mono {
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
button { font: inherit; }

/* ---------- MESH TEXTURE ---------- */
.mesh-divider {
  height: 34px;
  background-image:
    repeating-linear-gradient(45deg, var(--line) 0 1.5px, transparent 1.5px 18px),
    repeating-linear-gradient(-45deg, var(--line) 0 1.5px, transparent 1.5px 18px);
  background-color: var(--cream);
  opacity: 0.9;
  margin: 22px 0;
}

/* ---------- TOP BAR ---------- */
.topbar {
  background: var(--navy-deep);
  color: #fff;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
}
.topbar .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  margin-right: 8px;
  box-shadow: 0 0 0 3px rgba(47, 158, 123, 0.25);
}

/* ---------- HEADER / HERO ---------- */
header.hero {
  background: linear-gradient(160deg, var(--navy) 0%, var(--navy-2) 65%, var(--navy) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  padding: 56px 24px 90px;
}
header.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 30px),
    repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 30px);
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 85%);
}
.hero-inner {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
  text-align: center;
}
.brand-row {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 40px;
}
.brand-logo {
  height: auto;
  max-width: 180px;
  width: 100%;
  object-fit: contain;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--gold-soft);
  margin-bottom: 18px;
}
.eyebrow::before,
.eyebrow::after {
  content: "";
  width: 22px;
  height: 1px;
  background: rgba(255, 225, 166, 0.5);
}
h1.hero-title {
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 700;
  line-height: 1.08;
  margin-bottom: 18px;
}
h1.hero-title em {
  font-style: normal;
  color: var(--gold);
}
.hero-sub {
  font-size: 16.5px;
  color: #CBD6EC;
  max-width: 520px;
  margin: 0 auto 30px;
}
.trust-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.badge {
  display: flex;
  align-items: center;
  gap: 7px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  padding: 9px 16px;
  border-radius: 99px;
  font-size: 13.5px;
  font-weight: 500;
  backdrop-filter: blur(4px);
}
.badge svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ---------- MAIN ---------- */
main {
  max-width: 760px;
  margin: -52px auto 0;
  padding: 0 20px 80px;
  position: relative;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 36px;
  box-shadow: 0 20px 45px -25px rgba(20, 42, 82, 0.25);
}
.card + .card { margin-top: 22px; }

.intro-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 20px;
  align-items: flex-start;
}
.intro-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--sage-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.intro-icon svg {
  width: 26px;
  height: 26px;
  color: var(--sage);
}
.intro-card p {
  color: var(--ink-soft);
  font-size: 15px;
  margin: 6px 0 0;
}
.intro-card h3 {
  font-size: 18px;
  margin-bottom: 2px;
}

.confidential-strip {
  margin-top: 20px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--gold-soft);
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  padding: 14px 16px;
}
.confidential-strip svg {
  width: 20px;
  height: 20px;
  color: #8A5A00;
  flex-shrink: 0;
  margin-top: 1px;
}
.confidential-strip p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: #5C4300;
}

/* ---------- SECTION LABEL ---------- */
.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 38px 0 16px;
}
.section-label:first-child { margin-top: 0; }
.section-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: #fff;
  background: var(--navy);
  width: 24px;
  height: 24px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.section-label h2 { font-size: 19px; }
.section-hint {
  font-size: 13.5px;
  color: var(--ink-soft);
  margin: 2px 0 16px 34px;
}

/* ---------- CATEGORY GRID ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.cat-card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 18px 14px;
  text-align: center;
  cursor: pointer;
  transition: all .15s ease;
  font-family: inherit;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
}
.cat-card:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}
.cat-card.active {
  border-color: var(--gold);
  background: linear-gradient(180deg, #FFF9EE, #FFFFFF);
  box-shadow: 0 10px 24px -14px rgba(245, 166, 35, 0.55);
}
.cat-diamond {
  width: 38px;
  height: 38px;
  background: var(--navy);
  margin: 0 auto 12px;
  border-radius: 9px;
  transform: rotate(45deg);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.cat-card.active .cat-diamond { background: var(--gold); }
.cat-diamond svg {
  transform: rotate(-45deg);
  width: 18px;
  height: 18px;
  color: #fff;
}
.cat-card span {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  display: block;
}

/* ---------- FORM ---------- */
textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  font-family: 'Inter', sans-serif;
  font-size: 14.5px;
  color: var(--ink);
  resize: vertical;
  min-height: 130px;
  background: var(--cream);
  transition: border-color .15s ease, box-shadow .15s ease;
}
textarea:focus,
input:focus,
.switch input:focus + .track {
  outline: none;
  border-color: var(--navy-2);
  box-shadow: 0 0 0 4px rgba(31, 59, 112, 0.12);
}
textarea::placeholder { color: #A6ADBB; }
.char-count {
  text-align: right;
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
  font-family: 'JetBrains Mono', monospace;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 16px;
}
.field label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 7px;
}
.field input {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 13px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: var(--cream);
  color: var(--ink);
}

.details-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--navy-2);
  font-weight: 600;
  font-size: 13.5px;
  padding: 14px 2px 0;
  font-family: 'Inter', sans-serif;
}
.details-toggle svg {
  width: 15px;
  height: 15px;
  transition: transform .2s ease;
}
.details-toggle.open svg { transform: rotate(45deg); }
.details-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height .25s ease;
}
.details-panel.open { max-height: 200px; }

/* ---------- ANON SWITCH ---------- */
.anon-row {
  margin-top: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--sage-soft);
  border-radius: 14px;
  padding: 16px 18px;
}
.anon-text strong {
  display: block;
  font-size: 14.5px;
  margin-bottom: 2px;
  color: #155C46;
}
.anon-text span {
  font-size: 12.5px;
  color: #2F6E5A;
}
.switch { position: relative; flex-shrink: 0; }
.switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
  z-index: 1;
}
.switch .track {
  display: block;
  width: 46px;
  height: 26px;
  background: #B9DED0;
  border-radius: 99px;
  position: relative;
  transition: background .2s ease;
}
.switch input:checked + .track { background: var(--sage); }
.switch .thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform .2s ease;
  pointer-events: none;
}
.switch input:checked ~ .thumb { transform: translateX(20px); }

.contact-fields {
  margin-top: 16px;
  padding-top: 4px;
}

.form-feedback {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
}
.form-feedback.success {
  background: var(--sage-soft);
  color: #155C46;
  border: 1px solid rgba(47, 158, 123, 0.35);
}
.form-feedback.error {
  background: var(--rose-soft);
  color: #8B2E26;
  border: 1px solid rgba(226, 87, 76, 0.3);
}

/* ---------- CHANNEL TABS ---------- */
.channel-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.channel-tab {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-soft);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600;
  font-size: 14px;
  padding: 12px 18px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.channel-tab:hover {
  border-color: var(--navy-2);
  color: var(--navy);
}
.channel-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}
.channel-panel[hidden] {
  display: none !important;
}

/* ---------- PROTOCOL SEARCH ---------- */
.protocol-search-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.protocol-input {
  flex: 1;
  min-width: 200px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 14px;
  background: var(--paper);
  color: var(--ink);
}
.protocol-input:focus {
  outline: none;
  border-color: var(--navy-2);
  box-shadow: 0 0 0 3px rgba(31, 59, 112, 0.12);
}
button.submit.protocol-submit {
  padding: 14px 22px;
}
.protocol-result {
  margin-top: 20px;
  padding: 18px;
  border-radius: 14px;
  background: var(--cream);
  border: 1px solid var(--line);
}
.protocol-message-box {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 100%);
  color: #fff;
  border-radius: 14px;
  padding: 22px 20px;
  margin-bottom: 18px;
}
.protocol-message-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 10px;
}
.protocol-message-text {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.45;
  margin: 0;
  transition: opacity 0.25s ease;
}
.protocol-message-text.updated {
  animation: messagePulse 0.6s ease;
}
@keyframes messagePulse {
  0% { opacity: 0.55; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.protocol-updated {
  font-size: 12.5px;
  color: var(--ink-soft);
  font-style: italic;
}
.protocol-refresh-link {
  margin-top: 16px;
  border: none;
  background: none;
  padding: 0;
  color: var(--navy-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.protocol-refresh-link:hover {
  color: var(--navy);
}
.protocol-result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.protocol-label {
  font-size: 11px;
  color: var(--ink-soft);
  margin: 0 0 4px;
}
.protocol-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  margin: 0;
}
.protocol-status {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.protocol-status.status-aberta {
  background: #FFF3D6;
  color: #8A5A00;
}
.protocol-status.status-em_analise {
  background: #E3EDFF;
  color: #1F3B70;
}
.protocol-status.status-resolvida {
  background: var(--sage-soft);
  color: #155C46;
}
.protocol-status.status-arquivada {
  background: #ECEFF4;
  color: var(--ink-soft);
}
.protocol-result-meta {
  font-size: 14px;
  color: var(--ink-soft);
}
.protocol-result-meta p {
  margin: 0 0 6px;
}
.protocol-result-meta strong {
  color: var(--ink);
}

/* ---------- SUBMIT ---------- */
.submit-row {
  margin-top: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.submit-note {
  font-size: 12.5px;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: 6px;
}
.submit-note svg {
  width: 14px;
  height: 14px;
}
button.submit {
  background: var(--gold);
  color: var(--navy-deep);
  border: none;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 15px;
  padding: 15px 28px;
  border-radius: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 12px 24px -10px rgba(245, 166, 35, 0.6);
  transition: transform .15s ease, box-shadow .15s ease;
}
button.submit:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 28px -10px rgba(245, 166, 35, 0.7);
}
button.submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}
button.submit svg.btn-arrow {
  width: 17px;
  height: 17px;
}
button.submit svg.btn-arrow[hidden] {
  display: none;
}

/* ---------- FOOTER ---------- */
footer {
  text-align: center;
  padding: 30px 20px 50px;
  color: var(--ink-soft);
  font-size: 12.5px;
}
footer .lock-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-bottom: 6px;
  color: var(--navy-2);
  font-weight: 600;
  font-size: 13px;
}
footer .lock-row svg {
  width: 14px;
  height: 14px;
}

@media (max-width: 600px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .card { padding: 24px; }
  header.hero { padding: 44px 16px 90px; }
  .submit-row {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  button.submit { justify-content: center; }
  .brand-logo { max-width: 150px; }
  .topbar {
    flex-direction: column;
    gap: 4px;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
