/* ============================================================
   Canal de Denúncias v2 — Frontend Styles
   Prefixo: .cd-  →  zero conflito com outros plugins/temas.
   Compatível com Oxygen Builder e temas WordPress padrão.
   ============================================================ */

/* ── Reset contextual ──────────────────────────────────────── */
.cd-wrap *,
.cd-wrap *::before,
.cd-wrap *::after,
.cd-modal *,
.cd-modal *::before,
.cd-modal *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Wrap ──────────────────────────────────────────────────── */
.cd-wrap {
  /* max-width: 700px; */
  margin: 0 auto;
  font-family: inherit;
  font-size: 16px;
  color: #1a1a2e;
  line-height: 1.5;
}

/* ── Privacy notice ────────────────────────────────────────── */
.cd-privacy-notice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #eef7f0;
  border: 1px solid #b7dfbe;
  border-left: 4px solid #28a745;
  border-radius: 8px;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 14px;
  color: #155724;
}

.cd-shield {
  font-size: 22px;
  flex-shrink: 0;
}

/* ── Alerts ────────────────────────────────────────────────── */
.cd-alert {
  padding: 13px 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
}

.cd-alert-error {
  background: #fff3f3;
  border: 1px solid #f5c2c7;
  border-left: 4px solid #dc3545;
  color: #842029;
}

/* ── Form card ─────────────────────────────────────────────── */
.cd-form {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 36px 40px;
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.07);
}

@media (max-width: 600px) {
  .cd-form {
    padding: 24px 18px;
  }
}

/* ── Field ─────────────────────────────────────────────────── */
.cd-field {
  margin-bottom: 22px;
}

.cd-label {
  display: block;
  font-weight: 600;
  margin-bottom: 8px;
  font-size: 15px;
  color: #1a1a2e;
}

.cd-req {
  color: #c0392b;
}

/* ── Inputs / textarea / select ────────────────────────────── */
.cd-input {
  display: block;
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #ccd0d5;
  border-radius: 8px;
  font-size: 15px;
  color: #1a1a2e;
  background: #fafbfc;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.5;
  font-family: inherit;
}

.cd-input:focus {
  border-color: #0073aa;
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.16);
  background: #fff;
}

.cd-input.is-invalid {
  border-color: #dc3545;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.12);
}

select.cd-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23555' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

textarea.cd-input {
  resize: vertical;
  min-height: 180px;
}

.cd-hint {
  font-size: 13px;
  color: #777;
  margin-top: 5px;
}

/* ── Radio cards ───────────────────────────────────────────── */
.cd-radio-group {
  border: none;
  padding: 0;
}

.cd-radio-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 480px) {
  .cd-radio-options {
    grid-template-columns: 1fr;
  }
}

.cd-radio-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s,
    box-shadow 0.2s;
  background: #fafbfc;
  position: relative;
}

.cd-radio-card:hover {
  border-color: #0073aa;
  background: #f0f7ff;
}

.cd-radio-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cd-radio-card:has(.cd-radio-input:checked) {
  border-color: #0073aa;
  background: #f0f7ff;
  box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.12);
}

.cd-radio-check {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid #ccd0d5;
  margin-top: 2px;
  transition:
    border-color 0.2s,
    background 0.2s;
  position: relative;
}

.cd-radio-card:has(.cd-radio-input:checked) .cd-radio-check {
  border-color: #0073aa;
  background: #0073aa;
}

.cd-radio-card:has(.cd-radio-input:checked) .cd-radio-check::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #fff;
}

.cd-radio-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 14px;
}

.cd-radio-text strong {
  font-size: 15px;
  color: #1a1a2e;
}
.cd-radio-text small {
  color: #777;
  font-size: 12px;
}

/* ── Identified fields reveal ──────────────────────────────── */
#cd-identified-fields {
  background: #f8faff;
  border: 1px solid #d0e4f7;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 22px;
  animation: cd-reveal 0.25s ease;
}

@keyframes cd-reveal {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#cd-identified-fields .cd-field:last-child {
  margin-bottom: 0;
}

/* ── Dropzone ──────────────────────────────────────────────── */
.cd-dropzone {
  border: 2px dashed #ccd0d5;
  border-radius: 10px;
  padding: 24px;
  text-align: center;
  background: #fafbfc;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.cd-dropzone.is-dragover {
  border-color: #0073aa;
  background: #f0f7ff;
}

.cd-file-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.cd-dropzone-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.cd-dropzone-icon {
  font-size: 32px;
}

.cd-dropzone-text {
  font-size: 14px;
  color: #555;
  text-decoration: underline;
  text-decoration-style: dashed;
}

/* ── File list ─────────────────────────────────────────────── */
.cd-file-list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: left;
}

.cd-file-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 7px;
  padding: 8px 12px;
  font-size: 13px;
}

.cd-file-item-info {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #444;
}
.cd-file-item-size {
  color: #999;
  font-size: 12px;
  margin-left: 4px;
}

.cd-file-remove {
  background: none;
  border: none;
  color: #dc3545;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 4px;
  border-radius: 4px;
  transition: background 0.15s;
}

.cd-file-remove:hover {
  background: #fff3f3;
}

/* ── Alternative email notice ──────────────────────────────── */
.cd-alt-email {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff8e6;
  border: 1px solid #ffd97d;
  border-left: 4px solid #f0ad4e;
  border-radius: 8px;
  padding: 13px 16px;
  font-size: 14px;
  color: #664d03;
  margin-bottom: 22px;
}

/* ── Checkbox ──────────────────────────────────────────────── */
.cd-field-check {
  margin-top: 4px;
}

.cd-check-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 14px;
  color: #444;
}

.cd-checkbox {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  accent-color: #0073aa;
  cursor: pointer;
}

/* ── Actions ───────────────────────────────────────────────── */
.cd-actions {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  align-items: center;
}

/* ── Buttons ───────────────────────────────────────────────── */
.cd-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 28px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none !important;
  transition:
    background 0.18s,
    box-shadow 0.18s,
    transform 0.1s;
  line-height: 1;
  white-space: nowrap;
  font-family: inherit;
}

.cd-btn:active {
  transform: translateY(1px);
}

.cd-btn-primary {
  background: #0073aa;
  color: #fff !important;
  border-color: #0073aa;
}

.cd-btn-primary:hover {
  background: #005a87;
  border-color: #005a87;
  box-shadow: 0 4px 14px rgba(0, 115, 170, 0.28);
}

.cd-btn-outline {
  background: transparent;
  color: #0073aa !important;
  border-color: #0073aa;
}

.cd-btn-outline:hover {
  background: #f0f7ff;
}

.cd-btn-secondary {
  background: #f1f3f4;
  color: #444 !important;
  border-color: #d0d5dd;
}

.cd-btn-secondary:hover {
  background: #e8eaed;
  border-color: #bbb;
}

/* ── Success box ───────────────────────────────────────────── */
.cd-success-box {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 48px 40px;
  text-align: center;
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.07);
}

@media (max-width: 520px) {
  .cd-success-box {
    padding: 30px 18px;
  }
}

.cd-success-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 20px;
}

.cd-success-icon svg {
  width: 72px;
  height: 72px;
}

.cd-check-circle {
  stroke: #28a745;
  stroke-width: 2;
  stroke-dasharray: 166;
  stroke-dashoffset: 166;
  animation: cd-stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.cd-check {
  stroke: #28a745;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  animation: cd-stroke 0.4s 0.5s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

@keyframes cd-stroke {
  to {
    stroke-dashoffset: 0;
  }
}

.cd-success-title {
  font-size: 24px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 10px;
}

.cd-success-msg {
  font-size: 16px;
  color: #555;
  margin-bottom: 28px;
}

/* ── Protocol code box ─────────────────────────────────────── */
.cd-code-box {
  background: #f4f7ff;
  border: 2px dashed #0073aa;
  border-radius: 10px;
  padding: 24px 28px;
  margin: 0 auto;
  /* max-width: 440px; */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.cd-code-box--alert {
  background: #fffbf0;
  border-color: #f0ad4e;
}

.cd-code-label {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #555;
}

.cd-code {
  font-family: inherit;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 3px;
  color: #0073aa;
}

.cd-code-box--alert .cd-code {
  color: #b45309;
}

.cd-code-hint {
  font-size: 13px;
  color: #777;
  text-align: center;
}

.cd-anon-warning {
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 7px;
  padding: 10px 14px;
  font-size: 13px;
  color: #664d03;
  text-align: center;
  line-height: 1.5;
}

/* ── Tracking form ─────────────────────────────────────────── */
.cd-track-form {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 28px 32px;
  box-shadow: 0 2px 18px rgba(0, 0, 0, 0.07);
  margin-bottom: 24px;
}

.cd-track-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

@media (max-width: 520px) {
  .cd-track-row {
    flex-direction: column;
    align-items: stretch;
  }
}

.cd-code-input {
  font-family: inherit;
  font-size: 18px;
  letter-spacing: 2px;
  text-transform: uppercase;
  flex: 1;
}

.cd-code-input::placeholder {
  text-transform: none;
}

/* ── Results table ─────────────────────────────────────────── */
.cd-results-wrap {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.cd-results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.cd-results-table thead {
  background: #f8f9fa;
}

.cd-results-table th,
.cd-results-table td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.cd-results-table th {
  font-weight: 600;
  font-size: 13px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cd-results-table tbody tr:last-child td {
  border-bottom: none;
}

.cd-results-table tbody tr:hover {
  background: #fafafa;
}

/* Protocol link */
.cd-proto-link {
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  color: #0073aa;
  text-decoration: none;
  letter-spacing: 0.5px;
  border-bottom: 2px dashed #0073aa;
}

.cd-proto-link:hover {
  color: #005a87;
  border-color: #005a87;
}

/* ── Status badges ─────────────────────────────────────────── */
.cd-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
}

.cd-badge-received {
  background: #cfe2ff;
  color: #084298;
}
.cd-badge-in_review {
  background: #fef3cd;
  color: #856404;
}
.cd-badge-concluded {
  background: #d1e7dd;
  color: #0a3622;
}

/* ── Modal ─────────────────────────────────────────────────── */
.cd-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.cd-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  cursor: pointer;
}

.cd-modal-box {
  position: relative;
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  animation: cd-modal-in 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes cd-modal-in {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.cd-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid #f0f0f0;
  flex-shrink: 0;
}

.cd-modal-heading {
  font-size: 20px;
  font-weight: 700;
  color: #1a1a2e;
  line-height: 1.3;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cd-modal-proto {
  font-family: inherit;
  font-size: 14px;
  font-weight: 400;
  color: #0073aa;
  letter-spacing: 1px;
}

.cd-modal-close {
  flex-shrink: 0;
  background: #f1f3f4;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition:
    background 0.15s,
    color 0.15s;
  margin-top: 2px;
}

.cd-modal-close:hover {
  background: #e0e0e0;
  color: #1a1a2e;
}

.cd-modal-body {
  overflow-y: auto;
  padding: 24px 28px 28px;
  flex: 1;
}

/* Info grid */
.cd-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

@media (max-width: 480px) {
  .cd-info-grid {
    grid-template-columns: 1fr;
  }
}

.cd-info-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #f8f9fa;
  border-radius: 8px;
  padding: 12px 14px;
}

.cd-info-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #888;
}

.cd-info-value {
  font-size: 14px;
  color: #1a1a2e;
  font-weight: 500;
}

.cd-info-value code {
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  color: #0073aa;
  letter-spacing: 0.5px;
}

/* Modal sections */
.cd-modal-section {
  margin-top: 22px;
  padding-top: 22px;
  border-top: 1px solid #f0f0f0;
}

.cd-section-title {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a2e;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

/* Description block */
.cd-description-block {
  background: #f8f9fa;
  border-left: 4px solid #0073aa;
  border-radius: 4px;
  padding: 14px 16px;
  font-size: 14px;
  color: #333;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Interactions */
.cd-interactions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cd-interaction-bubble {
  background: #f4f7ff;
  border: 1px solid #d0e4f7;
  border-left: 4px solid #0073aa;
  border-radius: 8px;
  padding: 14px 16px;
}

.cd-interaction-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cd-interaction-who {
  font-size: 12px;
  font-weight: 700;
  color: #0073aa;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.cd-interaction-when {
  font-size: 12px;
  color: #888;
}

.cd-interaction-msg {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  white-space: pre-wrap;
}

.cd-empty-msg {
  font-size: 14px;
  color: #888;
  font-style: italic;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 520px) {
  .cd-modal-box {
    border-radius: 10px;
  }
  .cd-modal-header {
    padding: 18px 18px 16px;
  }
  .cd-modal-body {
    padding: 18px 18px 22px;
  }
  .cd-code {
    font-size: 22px;
    letter-spacing: 2px;
  }
}


/* ── State utility ── */
.cd-state-hidden { display: none !important; }
