:root {
  --bg: #eef2f5;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #607080;
  --line: #cfd8e3;
  --focus: #176b87;
  --accent: #1f7a5c;
  --danger: #b42318;
  --warning: #9a6700;
  --field: #f8fafc;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.page-shell {
  width: min(100%, 960px);
  margin: 0 auto;
  padding: 32px 16px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 12px 32px rgb(15 23 42 / 0.08);
}

.panel-header {
  border-bottom: 1px solid var(--line);
  margin-bottom: 24px;
  padding-bottom: 18px;
}

.commitment-block,
.declaration-block {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfd;
  margin-bottom: 22px;
  padding: 16px;
}

.declaration-block {
  margin-bottom: 0;
}

.commitment-block h2,
.declaration-block h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.commitment-block p,
.declaration-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.commitment-block p + p,
.declaration-block p + p {
  margin-top: 10px;
}

.attachment-block {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fbfcfe;
  padding: 14px;
}

.attachment-block h2 {
  margin: 0 0 4px;
  font-size: 0.98rem;
  line-height: 1.35;
  letter-spacing: 0;
}

.attachment-block p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
}

.attachment-input {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--focus);
  cursor: pointer;
  font-weight: 700;
  padding: 0 12px;
}

.attachment-input input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.attachment-input span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: 0;
}

.subtitle {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.5;
}

.report-form {
  display: grid;
  gap: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.category-block {
  display: grid;
  gap: 12px;
}

.identification-block {
  display: grid;
  gap: 12px;
}

.category-group {
  border: 0;
  margin: 0;
  padding: 0;
}

.category-group legend {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.radio-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  padding: 11px 12px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.radio-option input {
  width: 17px;
  min-width: 17px;
  height: 17px;
  min-height: 17px;
  margin-top: 1px;
  accent-color: var(--accent);
}

.radio-option:has(input:checked) {
  border-color: var(--accent);
  background: #effaf5;
}

.other-category {
  display: none;
}

.identification-details {
  display: none;
  border-left: 3px solid var(--accent);
  padding-left: 14px;
}

.details-title {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.category-block:has(input[value="outro"]:checked) .other-category,
.other-category.is-visible {
  display: grid;
}

.identification-block:has(input[value="sim"]:checked) .identification-details,
.identification-details.is-visible {
  display: grid;
  gap: 12px;
}

.field span:first-child {
  font-size: 0.95rem;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-weight: 400;
  padding: 10px 12px;
}

textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
  outline: 3px solid rgb(23 107 135 / 0.16);
}

select:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  line-height: 1.45;
}

.check-row input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  min-height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 6px;
}

button,
.secondary-link {
  min-height: 44px;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
}

button {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  padding: 0 18px;
}

button:hover {
  background: #176747;
}

button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.security-block {
  margin-top: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.security-block h2 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.security-block p {
  color: var(--muted);
  line-height: 1.5;
}

.security-retry {
  min-height: 40px;
  height: auto;
  padding: 8px 12px;
}

.security-privacy {
  font-size: 0.85rem;
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 24px;
  border: 1px solid var(--line);
  color: var(--focus);
  padding: 0 16px;
  text-decoration: none;
}

.alert {
  border-radius: 6px;
  margin-bottom: 18px;
  padding: 12px 14px;
  font-weight: 700;
  line-height: 1.45;
}

.alert.error {
  background: #fff1f0;
  border: 1px solid #ffccc7;
  color: var(--danger);
}

.alert.success {
  background: #e9f7ef;
  border: 1px solid #b7e4ca;
  color: var(--accent);
}

.field-error {
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 700;
}

.has-error input,
.has-error select,
.has-error textarea,
.category-block.has-error .radio-option,
.identification-block.has-error .radio-option,
.attachment-block.has-error {
  border-color: var(--danger);
}

.hp-field {
  display: none;
}

.result-panel {
  max-width: 680px;
  margin: 64px auto;
}

@media (max-width: 720px) {
  .page-shell {
    padding: 16px;
  }

  .panel {
    padding: 20px;
  }

  .field-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .choice-row {
    grid-template-columns: 1fr;
  }

  .attachment-block {
    grid-template-columns: 1fr;
  }

  .attachment-input {
    max-width: none;
    width: 100%;
  }

  h1 {
    font-size: 1.6rem;
  }

  .actions {
    justify-content: stretch;
  }

  button {
    width: 100%;
  }
}
