/**
 * Canal de Relato e Denúncia — Peso Exato Solutions
 * css/style.css
 */
:root {
  --clr-bg: #f5f7fa;
  --clr-surface: #ffffff;
  --clr-primary: #1a4d7c;
  --clr-primary-lt: #2b6cb0;
  --clr-accent: #2e7d52;
  --clr-accent-lt: #38a169;
  --clr-warn: #c05621;
  --clr-danger: #c53030;
  --clr-text: #1a202c;
  --clr-muted: #4a5568;
  --clr-border: #cbd5e0;
  --clr-border-focus: #2b6cb0;
  --clr-success-bg: #f0fff4;
  --clr-success-border: #276749;

  --radius-sm: 4px;
  --radius: 8px;
  --radius-lg: 14px;

  --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-focus: 0 0 0 3px rgba(43, 108, 176, 0.35);

  --font-display: "Merriweather", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", monospace;

  --transition: 180ms ease;
  --max-w: 720px;
}

/* --- RESET / BASE ------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--clr-text);
  background: var(--clr-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--clr-primary-lt);
}
a:focus-visible {
  outline: 3px solid var(--clr-border-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

img,
svg {
  display: block;
  max-width: 100%;
}

fieldset {
  border: none;
  padding: 0;
  margin: 0;
}

/* --- SKIP LINK --------------------------------------------- */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1rem;
  background: var(--clr-primary);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 9999;
  transition: top 0.15s;
}
.skip-link:focus {
  top: 1rem;
}

/* --- HEADER ------------------------------------------------- */
.site-header {
  background: var(--clr-primary);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.site-header__logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.site-header__icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.site-header__icon svg {
  width: 22px;
  height: 22px;
  stroke: #fff;
  fill: none;
}
.site-header__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}
.site-header__sub {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 400;
  margin-top: 1px;
}

/* --- HERO BANNER -------------------------------------------- */
.hero {
  background: linear-gradient(135deg, var(--clr-primary) 0%, #153e6a 100%);
  color: #fff;
  padding: 3rem 1.5rem 2.5rem;
  text-align: center;
}
.hero__eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.65);
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2.25rem);
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 1rem;
}
.hero__desc {
  max-width: 560px;
  margin: 0 auto 1.5rem;
  font-size: 0.975rem;
  color: rgba(255, 255, 255, 0.85);
}
.hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.hero__badge {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 100px;
  letter-spacing: 0.03em;
}

/* --- INTRO NOTICE ------------------------------------------- */
.intro-notice {
  max-width: var(--max-w);
  margin: 2rem auto 0;
  padding: 0 1rem;
}
.notice-card {
  background: var(--clr-surface);
  border-left: 4px solid var(--clr-accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
}
.notice-card__title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--clr-accent);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.notice-card p {
  font-size: 0.9rem;
  color: var(--clr-muted);
  line-height: 1.7;
}
.notice-card p + p {
  margin-top: 0.5rem;
}

/* --- MAIN / LAYOUT ------------------------------------------ */
.main-content {
  max-width: var(--max-w);
  margin: 2rem auto 3rem;
  padding: 0 1rem;
}

/* --- PROGRESS BAR ------------------------------------------- */
.progress-bar-wrap {
  margin-bottom: 2rem;
}
.progress-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--clr-muted);
  margin-bottom: 0.4rem;
}
.progress-bar-labels span.active {
  color: var(--clr-primary);
}
.progress-bar-track {
  height: 5px;
  background: var(--clr-border);
  border-radius: 100px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--clr-accent), var(--clr-primary-lt));
  border-radius: 100px;
  transition: width 0.4s ease;
  width: 0%;
}

/* --- FORM CARD --------------------------------------------- */
.form-card {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 2rem;
}

/* --- SECTION HEADERS --------------------------------------- */
.section-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--clr-bg);
}
.section-header__num {
  width: 30px;
  height: 30px;
  background: var(--clr-primary);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.section-header__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-primary);
}
.section-header__subtitle {
  font-size: 0.8rem;
  color: var(--clr-muted);
  margin-top: 1px;
}

/* --- FORM SECTIONS ----------------------------------------- */
.form-section {
  display: none;
}
.form-section.active {
  display: block;
  animation: fadeIn 0.25s ease;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- FORM GROUPS ------------------------------------------- */
.form-group {
  margin-bottom: 1.25rem;
}
.form-group:last-child {
  margin-bottom: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 540px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* --- LABELS & HELPERS -------------------------------------- */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-text);
  margin-bottom: 0.35rem;
}
.form-label .req {
  color: var(--clr-danger);
  margin-left: 2px;
  font-weight: 700;
}
.form-label .opt {
  color: var(--clr-muted);
  font-size: 0.75rem;
  font-weight: 400;
  margin-left: 4px;
}
.form-hint {
  font-size: 0.78rem;
  color: var(--clr-muted);
  margin-top: 0.3rem;
  line-height: 1.5;
}
.form-hint--warn {
  color: var(--clr-warn);
  display: flex;
  align-items: flex-start;
  gap: 0.3rem;
}
.form-hint--warn svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- INPUTS ------------------------------------------------ */
.form-control {
  width: 100%;
  padding: 0.6rem 0.85rem;
  font-size: 0.9rem;
  font-family: var(--font-body);
  color: var(--clr-text);
  background: var(--clr-surface);
  border: 1.5px solid var(--clr-border);
  border-radius: var(--radius);
  transition:
    border-color var(--transition),
    box-shadow var(--transition);
  line-height: 1.5;
  -webkit-appearance: none;
  appearance: none;
}
.form-control:focus {
  outline: none;
  border-color: var(--clr-border-focus);
  box-shadow: var(--shadow-focus);
}
.form-control::placeholder {
  color: #a0aec0;
}
.form-control:disabled {
  background: #edf2f7;
  cursor: not-allowed;
  opacity: 0.7;
}

textarea.form-control {
  resize: vertical;
  min-height: 100px;
}

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234A5568' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.2rem;
}

/* --- RADIO / CHECKBOX CUSTOM ------------------------------- */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.radio-group.horizontal {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
}
.radio-item input[type="radio"],
.checkbox-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--clr-primary);
  cursor: pointer;
  flex-shrink: 0;
  margin: 0;
}
.radio-item label,
.checkbox-item label {
  font-size: 0.875rem;
  color: var(--clr-text);
  cursor: pointer;
}

/* card-style radio */
.radio-card {
  border: 2px solid var(--clr-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition);
}
.radio-card input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--clr-primary);
  cursor: pointer;
  flex-shrink: 0;
}
.radio-card:has(input:checked) {
  border-color: var(--clr-primary);
  background: #ebf4ff;
}
.radio-card__label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--clr-text);
}
.radio-card__desc {
  font-size: 0.78rem;
  color: var(--clr-muted);
  margin-top: 1px;
}

/* --- UPLOAD ZONE ------------------------------------------- */
.upload-zone {
  border: 2px dashed var(--clr-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  transition:
    border-color var(--transition),
    background var(--transition);
  position: relative;
}
.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--clr-primary-lt);
  background: #ebf4ff;
}
.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-zone__icon {
  font-size: 2rem;
  margin-bottom: 0.4rem;
}
.upload-zone__text {
  font-size: 0.875rem;
  color: var(--clr-muted);
}
.upload-zone__text strong {
  color: var(--clr-primary);
}

.file-list {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.file-item {
  background: var(--clr-bg);
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.8rem;
  color: var(--clr-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.file-item__name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-item__remove {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-danger);
  font-size: 1rem;
  line-height: 1;
  padding: 0 0.2rem;
  flex-shrink: 0;
}
.upload-loading {
  font-size: 0.8rem;
  color: var(--clr-muted);
  margin-top: 0.4rem;
  text-align: center;
}

/* --- TOGGLE SECTION ---------------------------------------- */
.toggle-section {
  display: none;
  margin-top: 0.75rem;
  padding: 0.75rem;
  background: var(--clr-bg);
  border-radius: var(--radius);
  border: 1px solid var(--clr-border);
}
.toggle-section.visible {
  display: block;
}

/* --- DECLARATION BOX --------------------------------------- */
.declaration-box {
  background: #fffbeb;
  border: 1.5px solid #f6e05e;
  border-radius: var(--radius);
  padding: 1.1rem 1.25rem;
  font-size: 0.875rem;
  color: #744210;
  line-height: 1.65;
}
.declaration-check {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  margin-top: 0.75rem;
  cursor: pointer;
}
.declaration-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--clr-primary);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 2px;
}
.declaration-check label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--clr-text);
  cursor: pointer;
}

/* --- PRIVACY NOTICE ---------------------------------------- */
.privacy-notice {
  background: var(--clr-bg);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-size: 0.8rem;
  color: var(--clr-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  border: 1px solid var(--clr-border);
}
.privacy-notice a {
  color: var(--clr-primary-lt);
}

/* --- NAV BUTTONS ------------------------------------------- */
.form-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--clr-border);
  gap: 1rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.65rem 1.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--transition),
    transform var(--transition),
    opacity var(--transition);
  line-height: 1.4;
  font-family: var(--font-body);
}
.btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}
.btn:focus-visible {
  outline: 3px solid var(--clr-border-focus);
  outline-offset: 2px;
}
.btn:active {
  transform: translateY(1px);
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.btn--primary {
  background: var(--clr-primary);
  color: #fff;
}
.btn--primary:hover {
  background: #153e6a;
}

.btn--success {
  background: var(--clr-accent);
  color: #fff;
}
.btn--success:hover {
  background: #276749;
}

.btn--ghost {
  background: transparent;
  color: var(--clr-muted);
  border: 1.5px solid var(--clr-border);
}
.btn--ghost:hover {
  background: var(--clr-bg);
  color: var(--clr-text);
}

/* --- ERROR MESSAGES ---------------------------------------- */
.field-error {
  font-size: 0.78rem;
  color: var(--clr-danger);
  margin-top: 0.3rem;
  display: none;
  align-items: center;
  gap: 0.25rem;
}
.field-error.visible {
  display: flex;
}
.form-control.error {
  border-color: var(--clr-danger);
}

/* --- SUCCESS SCREEN ---------------------------------------- */
.success-screen {
  display: none;
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.success-screen.visible {
  display: block;
}
.success-screen__icon {
  width: 72px;
  height: 72px;
  background: var(--clr-success-bg);
  border: 3px solid var(--clr-success-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
}
.success-screen__icon svg {
  width: 36px;
  height: 36px;
  stroke: var(--clr-success-border);
  fill: none;
  stroke-width: 2.5;
}
.success-screen h2 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--clr-primary);
  margin-bottom: 0.75rem;
}
.success-screen p {
  color: var(--clr-muted);
  font-size: 0.9rem;
  max-width: 440px;
  margin: 0 auto 0.75rem;
}
.protocol-box {
  background: var(--clr-bg);
  border: 2px solid var(--clr-primary);
  border-radius: var(--radius);
  padding: 1rem 1.5rem;
  margin: 1.25rem auto;
  max-width: 340px;
}
.protocol-box__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--clr-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.protocol-box__code {
  font-family: var(--font-mono);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--clr-primary);
  letter-spacing: 0.05em;
}
.protocol-box__copy {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-primary-lt);
  font-size: 0.8rem;
  margin-top: 0.35rem;
  text-decoration: underline;
  font-family: var(--font-body);
}
.success-alert {
  background: var(--clr-success-bg);
  border: 1px solid var(--clr-success-border);
  border-radius: var(--radius);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  color: #276749;
  margin-top: 0.5rem;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}

/* --- FOOTER ------------------------------------------------- */
.site-footer {
  background: var(--clr-primary);
  color: rgba(255, 255, 255, 0.6);
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
}
.site-footer strong {
  color: rgba(255, 255, 255, 0.9);
}
.site-footer a {
  color: rgba(255, 255, 255, 0.7);
}

/* --- LOADING OVERLAY --------------------------------------- */
.loading-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.85);
  z-index: 999;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 1rem;
}
.loading-overlay.visible {
  display: flex;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid var(--clr-border);
  border-top-color: var(--clr-primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.loading-overlay p {
  font-size: 0.9rem;
  color: var(--clr-muted);
  font-weight: 600;
}

/* --- RESPONSIVE -------------------------------------------- */
@media (max-width: 600px) {
  .form-card {
    padding: 1.25rem;
    border-radius: var(--radius);
  }
  .hero {
    padding: 2rem 1rem 2rem;
  }
  .form-nav {
    flex-direction: column;
  }
  .form-nav .btn {
    width: 100%;
    justify-content: center;
  }
  .form-nav .btn--ghost {
    order: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- HONEYPOT (anti-bot) ----------------------------------- */
.hp-field {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* --- FOOTER LINK BUTTON -------------------------------------- */
.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: underline;
  cursor: pointer;
}
.footer-link-btn:hover {
  color: #fff;
}
.footer-link-btn:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* --- MODAL — AVISO DE PRIVACIDADE ----------------------------- */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 32, 44, 0.55);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}
.modal-overlay.visible {
  display: flex;
}
.modal-box {
  background: var(--clr-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: modalIn 0.2s ease;
}
@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.modal-box__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--clr-border);
  flex-shrink: 0;
}
.modal-box__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--clr-primary);
}
.modal-box__close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  color: var(--clr-muted);
  line-height: 1;
  padding: 0.3rem;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.modal-box__close:hover {
  background: var(--clr-bg);
  color: var(--clr-text);
}
.modal-box__close:focus-visible {
  outline: 3px solid var(--clr-border-focus);
  outline-offset: 2px;
}
.modal-box__body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  font-size: 0.875rem;
  color: var(--clr-muted);
  line-height: 1.7;
}
.modal-box__footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--clr-border);
  display: flex;
  justify-content: flex-end;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .modal-box {
    animation: none;
  }
}
