:root {
  --accent: #319795;
  --accent-dark: #1f6f6d;
  --bg: #eef3f5;
  --card: #ffffff;
  --text: #19324a;
  --muted: #66788a;
  --border: #c7d3dd;
  --danger: #cc4b4b;
  --danger-soft: #fff1f1;
  --success: #2f855a;
  --success-soft: #eefbf3;
  --shadow: 0 14px 40px rgba(16, 44, 62, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #f5f8fa 0%, var(--bg) 100%);
  color: var(--text);
}

body {
  min-height: 100vh;
}

.public-page {
  width: 100%;
  padding: 20px;
  display: flex;
  justify-content: center;
}

.public-card {
  width: 100%;
  max-width: 980px;
  background: rgba(255,255,255,0.96);
  border: 1px solid #dce5ea;
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e3eaef;
}

.brand-block img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #dbe5ea;
  padding: 6px;
}

.brand-copy h1,
.brand-copy p {
  margin: 0;
}

.brand-copy h1 {
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 6px;
}

.brand-copy p {
  color: var(--muted);
  font-size: 0.98rem;
}

.message {
  display: none;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid #dce5ea;
  font-size: 0.95rem;
}

.message.error,
.message.success {
  display: block;
}

.message.error {
  background: #fff1f1;
  border-color: #f2b7b7;
  color: #a02b2b;
}

.message.success {
  background: #edf9f1;
  border-color: #bae1c7;
  color: #246b45;
}

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

#solicitacaoPublicaForm {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.form-section {
  background: #fbfdfe;
  border: 1px solid #dce6ec;
  border-radius: var(--radius);
  padding: 18px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e5edf2;
}

.section-header h2 {
  margin: 0 0 4px 0;
  font-size: 1.15rem;
}

.section-header p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
  font-size: 0.94rem;
}

.section-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  border: 1px solid transparent;
}

.required-badge {
  background: #fff2f2;
  color: #b74242;
  border-color: #f0c1c1;
}

.optional-badge {
  background: #eef8fb;
  color: #2f7d95;
  border-color: #cbe7ef;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.priority-grid,
.secondary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  padding: 0;
  border-radius: 14px;
}

.form-group.full,
.info-inline {
  grid-column: 1 / -1;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #28445e;
}

.req {
  color: #d14b4b;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 0.98rem;
  padding: 12px 14px;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(49, 151, 149, 0.15);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

input[type="date"] {
  min-height: 46px;
}

.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.info-inline {
  margin-top: -2px;
}

.contact-helper-card,
.optional-note {
  background: #f3fafb;
  border: 1px solid #d7ecee;
  border-radius: 14px;
  padding: 12px 14px;
}

.contact-helper-card strong {
  display: block;
  margin-bottom: 4px;
  color: #225966;
}

.contact-helper-card p,
.optional-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.optional-details {
  padding: 0;
  overflow: hidden;
}

.optional-summary {
  list-style: none;
  cursor: pointer;
  margin: 0;
  padding: 18px;
  border: 0;
}

.optional-summary::-webkit-details-marker {
  display: none;
}

.optional-summary-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.summary-toggle-text {
  color: var(--accent-dark);
  font-weight: 700;
  font-size: 0.9rem;
  position: relative;
  padding-right: 16px;
}

.summary-toggle-text::after {
  content: "▾";
  position: absolute;
  right: 0;
  top: -1px;
  transition: transform .18s ease;
}

.optional-details[open] .summary-toggle-text::after {
  transform: rotate(180deg);
}

.optional-details[open] .summary-toggle-text {
  color: #245f5c;
}

.optional-details[open] .summary-toggle-text::before {
  content: "Ocultar";
}

.optional-details:not([open]) .summary-toggle-text::before {
  content: "Mostrar";
}

.optional-details .details-body {
  padding: 0 18px 18px 18px;
  border-top: 1px solid #e5edf2;
}

.consent-section .section-header {
  margin-bottom: 12px;
}

.consent-master {
  margin-bottom: 12px;
  padding: 12px 14px;
  background: #f8fbfc;
  border: 1px dashed #d3e2e8;
  border-radius: 14px;
}

.lgpd-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fffdfd;
  border: 1px solid #f0d7d7;
  border-radius: 14px;
  padding: 14px;
}

.check-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 12px;
}

.check-line input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.check-line span {
  color: #3d4f62;
  font-size: 0.93rem;
  line-height: 1.45;
}

.check-line a {
  color: var(--accent-dark);
  font-weight: 700;
}

.check-line.required-check {
  background: #fff8f8;
}

.check-line.master-check {
  background: transparent;
  padding: 0;
}

.required-consent-box {
  background: #fff9f9;
}

.form-group.required-empty input,
.form-group.required-empty select,
.form-group.required-empty textarea,
.check-line.required-empty {
  border-color: #e59d9d;
  background: #fff9f9;
}

.form-group.required-filled input,
.form-group.required-filled select,
.form-group.required-filled textarea,
.check-line.required-filled {
  border-color: #9fd4c3;
  background: #f7fffb;
}

.contact-required-alert input {
  border-color: #e59d9d;
  background: #fff9f9;
}

.field-invalid input,
.field-invalid select,
.field-invalid textarea,
.check-line.field-invalid {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(204, 75, 75, 0.12);
}

.field-error {
  margin-top: 2px;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 700;
}

.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 6px;
}

.submit-note {
  flex: 1;
}

.submit-note p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.btn-primary {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #3ca8a1);
  color: #fff;
  min-height: 48px;
  padding: 0 20px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(49, 151, 149, 0.22);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(49, 151, 149, 0.28);
}

.btn-primary:disabled {
  cursor: wait;
  opacity: 0.75;
  transform: none;
}

@media (max-width: 860px) {
  .public-page {
    padding: 14px;
  }

  .public-card {
    padding: 18px;
    border-radius: 20px;
  }

  .brand-block {
    align-items: flex-start;
  }

  .brand-copy h1 {
    font-size: 1.7rem;
  }

  .priority-grid,
  .secondary-grid {
    grid-template-columns: 1fr;
  }

  .section-header,
  .optional-summary {
    flex-direction: column;
    align-items: stretch;
  }

  .optional-summary-right {
    justify-content: space-between;
  }

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

  .btn-primary {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .public-page {
    padding: 10px;
  }

  .public-card {
    padding: 14px;
    border-radius: 18px;
  }

  .brand-block img {
    width: 48px;
    height: 48px;
  }

  .brand-copy h1 {
    font-size: 1.45rem;
  }

  .brand-copy p,
  .section-header p,
  .check-line span,
  .submit-note p {
    font-size: 0.9rem;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .form-section {
    padding: 14px;
  }

  .optional-summary {
    padding: 14px;
  }

  .optional-details .details-body {
    padding: 0 14px 14px 14px;
  }
}
