/* =========================================================
   MANIFESTAÇÃO
========================================================= */

.page-manifestacao {
  background: var(--bg);
}

/* =========================================================
   BLOCOS DO FORMULÁRIO
========================================================= */

.manifest-block {
  padding: 28px 0;
  border-top: 1px solid var(--line);
}

.manifest-block:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.manifest-block h3 {
  font-size: 18px;
  font-weight: 900;
  color: var(--text);
  letter-spacing: -.035em;
  margin-bottom: 18px;
}

/* =========================================================
   TIPO DE MANIFESTAÇÃO
========================================================= */

.manifest-type-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.manifest-type-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: .2s ease;
}

.manifest-type-card:hover {
  border-color: var(--teal);
  background: var(--teal-soft-2);
}

.manifest-type-card.selected,
.manifest-type-card:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px rgba(88, 191, 199, .12);
}

.manifest-type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.manifest-type-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.manifest-type-icon svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.manifest-type-icon.red {
  background: var(--red-soft);
  color: var(--red);
}

.manifest-type-icon.teal {
  background: var(--teal-soft);
  color: var(--teal-dk);
}

.manifest-type-icon.green {
  background: var(--green-soft);
  color: var(--green);
}

.manifest-type-icon.amber {
  background: var(--amber-soft);
  color: var(--amber);
}

.manifest-type-card strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 5px;
}

.manifest-type-card small {
  display: block;
  font-size: 12px;
  line-height: 1.55;
  color: var(--body);
}

/* =========================================================
   ANONIMATO E BOA FÉ
========================================================= */

.anonymous-card,
.good-faith-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  cursor: pointer;
  transition: .2s ease;
}

.anonymous-card:hover,
.good-faith-card:hover {
  border-color: var(--teal);
  background: var(--teal-soft-2);
}

.anonymous-card:has(input:checked),
.good-faith-card:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 3px rgba(39, 174, 96, .1);
}

.anonymous-card input,
.good-faith-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.anonymous-check,
.good-faith-check {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
  transition: .18s ease;
}

.anonymous-check svg,
.good-faith-check svg {
  width: 15px;
  height: 15px;
  stroke: #fff;
  fill: none;
  stroke-width: 3;
  opacity: 0;
  transition: .18s ease;
}

.anonymous-card input:checked + .anonymous-check,
.good-faith-card input:checked + .good-faith-check {
  background: var(--green);
  border-color: var(--green);
}

.anonymous-card input:checked + .anonymous-check svg,
.good-faith-card input:checked + .good-faith-check svg {
  opacity: 1;
}

.anonymous-card strong,
.good-faith-card strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 5px;
  line-height: 1.35;
}

.anonymous-card small,
.good-faith-card small {
  display: block;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--body);
}

.identity-block {
  margin-top: 22px;
}

.identity-block.is-hidden,
.identity-block[hidden] {
  display: none !important;
}

/* =========================================================
   CAMPOS ESPECÍFICOS
========================================================= */

#relato {
  min-height: 220px;
}

#envolvidos {
  min-height: 110px;
}
/* =========================================================
   CORREÇÃO DEFINITIVA DO UPLOAD
========================================================= */

.upload-zone {
  display: flex;
  width: 100%;
  min-height: 168px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  border: 2px dashed var(--line);
  border-radius: 16px;
  padding: 34px 24px;
  text-align: center;
  cursor: pointer;
  transition: .2s ease;
  position: relative;
  background: #fff;
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag {
  border-color: var(--teal);
  background: var(--teal-soft-2);
  box-shadow: 0 0 0 3px rgba(88, 191, 199, .12);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}

.upload-zone svg {
  width: 30px;
  height: 30px;
  stroke: var(--muted);
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  margin-bottom: 12px;
  position: relative;
  z-index: 2;
}

.upload-zone p {
  font-size: 14px;
  color: var(--body);
  font-weight: 900;
  margin: 0 0 6px;
  position: relative;
  z-index: 2;
}

.upload-zone span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  position: relative;
  z-index: 2;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
}

.file-item svg {
  width: 15px;
  height: 15px;
  stroke: var(--teal);
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

.file-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-item small {
  font-size: 11px;
  color: var(--muted);
  font-weight: 700;
  margin-left: auto;
  white-space: nowrap;
}

.file-remove {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
  margin-left: 6px;
  transition: .15s ease;
  flex-shrink: 0;
}

.file-remove:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* =========================================================
   AÇÕES
========================================================= */

.manifest-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}

/* =========================================================
   VALIDAÇÃO
========================================================= */

.manifest-block > .form-error {
  margin-top: 10px;
}

.manifest-type-grid + .form-error,
.good-faith-card + .form-error,
.anonymous-card + .form-error {
  display: none;
  font-size: 11px;
  color: var(--red);
  font-weight: 800;
  margin-top: 8px;
}

.manifest-type-grid + .form-error.show,
.good-faith-card + .form-error.show,
.anonymous-card + .form-error.show {
  display: block;
}

.manifest-type-grid.has-error .manifest-type-card,
.good-faith-card.has-error,
.anonymous-card.has-error {
  border-color: var(--red);
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: var(--red) !important;
  box-shadow: 0 0 0 3px rgba(231, 76, 60, .1);
}

/* =========================================================
   RESPONSIVO
========================================================= */

@media (max-width: 900px) {
  .manifest-type-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .manifest-block {
    padding: 24px 0;
  }

  .manifest-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .manifest-actions .btn {
    width: 100%;
  }

  .manifest-type-card,
  .anonymous-card,
  .good-faith-card {
    padding: 16px;
  }

  .file-item {
    align-items: flex-start;
  }

  .file-item small {
    display: none;
  }
}



/* =========================================================
   BLOCOS DINÂMICOS POR TIPO
========================================================= */

.manifest-dynamic-block {
  display: none;
}

.manifest-dynamic-block.is-active {
  display: block;
  animation: manifestFadeIn .22s ease both;
}

@keyframes manifestFadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================
   UPLOAD COM PROGRESSO
========================================================= */

.file-item.is-uploading {
  background: #fff;
  border-color: rgba(88, 191, 199, .45);
}

.file-item.is-done {
  border-color: rgba(39, 174, 96, .25);
  background: var(--green-soft);
}

.file-item.is-error {
  border-color: rgba(231, 76, 60, .28);
  background: var(--red-soft);
}

.file-info {
  min-width: 0;
  flex: 1;
}

.file-info strong {
  display: block;
  font-size: 12px;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-info span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.file-progress {
  width: 120px;
  height: 6px;
  border-radius: var(--pill);
  background: var(--line);
  overflow: hidden;
  flex-shrink: 0;
}

.file-progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
  transition: width .18s ease;
}

.file-status {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  white-space: nowrap;
}

.file-status.ok {
  color: var(--green);
}

.file-status.error {
  color: var(--red);
}

.file-hidden-inputs {
  display: none;
}

@media (max-width: 700px) {
  .file-item {
    display: grid;
    grid-template-columns: 15px 1fr 24px;
    align-items: start;
  }

  .file-progress {
    grid-column: 2 / 4;
    width: 100%;
    margin-top: 6px;
  }

  .file-status {
    grid-column: 2 / 4;
  }
}

/* =========================================================
   CONFIRMAÇÃO REVERSÍVEL DO TERMO
========================================================= */

.term-confirm-box {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  background: linear-gradient(180deg, #fff 0%, #FBFFFC 100%);
  border: 1.5px solid rgba(39, 174, 96, .28);
  border-radius: 18px;
  padding: 20px;
  margin: 22px 0 28px;
  cursor: pointer;
  transition: .2s ease;
}

.term-confirm-box:hover {
  border-color: rgba(39, 174, 96, .5);
  box-shadow: 0 0 0 3px rgba(39, 174, 96, .08);
}

.term-confirm-box input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.term-confirm-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--green-soft);
  border: 1px solid rgba(39, 174, 96, .24);
  border-radius: var(--pill);
  padding: 7px 10px 7px 7px;
  flex-shrink: 0;
}

.term-confirm-check {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: grid;
  place-items: center;
  transition: .18s ease;
}

.term-confirm-check svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.term-confirm-label {
  font-size: 10px;
  font-weight: 900;
  color: var(--green);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.term-confirm-content {
  display: block;
  min-width: 0;
  flex: 1;
}

.term-confirm-content strong {
  display: block;
  font-size: 14px;
  font-weight: 900;
  color: var(--text);
  margin-bottom: 5px;
}

.term-confirm-text {
  display: block;
  font-size: 13px;
  line-height: 1.65;
  color: var(--body);
}

.term-confirm-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.term-confirm-meta span {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
}

.term-confirm-meta a {
  font-size: 11px;
  font-weight: 900;
  color: var(--teal-dk);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.term-confirm-meta a:hover {
  color: var(--navy);
}

.term-confirm-warning {
  display: block;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 800;
  color: var(--red);
}

.term-confirm-box.is-unchecked {
  border-color: rgba(231, 76, 60, .32);
  background: #fff;
}

.term-confirm-box.is-unchecked .term-confirm-badge {
  background: var(--red-soft);
  border-color: rgba(231, 76, 60, .28);
}

.term-confirm-box.is-unchecked .term-confirm-check {
  background: #fff;
  color: transparent;
  border: 2px solid var(--red);
}

.term-confirm-box.is-unchecked .term-confirm-label {
  color: var(--red);
}

.term-confirm-box.is-unchecked .term-confirm-label::before {
  content: 'Não ';
}

@media (max-width: 700px) {
  .term-confirm-box {
    flex-direction: column;
    padding: 18px;
  }

  .term-confirm-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}


.manifest-actions .btn:disabled,
.manifest-actions button:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.term-confirm-box.is-unchecked {
  border-color: rgba(231, 76, 60, .32);
  background: #fff;
}

.term-confirm-box.is-unchecked .term-confirm-badge {
  background: var(--red-soft);
  border-color: rgba(231, 76, 60, .28);
}

.term-confirm-box.is-unchecked .term-confirm-check {
  background: #fff;
  color: transparent;
  border: 2px solid var(--red);
}

.term-confirm-box.is-unchecked .term-confirm-label {
  color: var(--red);
}

.term-confirm-box.is-unchecked .term-confirm-label::before {
  content: 'Não ';
}
/* =========================================================
   SUGESTÃO DE UNIDADE
========================================================= */

.unit-suggest-group {
  position: relative;
}

.unit-suggest-list {
  position: absolute;
  z-index: 30;
  left: 0;
  right: 0;
  top: calc(100% - 2px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-soft);
  padding: 8px;
  display: grid;
  gap: 4px;
}

.unit-suggest-list[hidden] {
  display: none;
}

.unit-suggest-item {
  width: 100%;
  display: grid;
  gap: 3px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: .18s ease;
}

.unit-suggest-item:hover,
.unit-suggest-item.active {
  background: var(--teal-soft);
}

.unit-suggest-item strong {
  font-size: 13px;
  font-weight: 900;
  color: var(--text);
  line-height: 1.25;
}

.unit-suggest-item span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--body);
  line-height: 1.35;
}

.unit-suggest-item small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}