/* ==========================================================================
   Dinsos Pinrang - Kotak Pengaduan Terpadu Frontend & Risalah A4 Stylesheet
   Versi: 1.1.0
   Standar: Dokumen Kedinasan Resmi Pemerintah Kabupaten Pinrang (Fit Width A4)
   ========================================================================== */

/* 1. KARTU WRAPPER UTAMA DI BROWSER */
.dsp-receipt-screen-wrapper {
  margin-top: 1.5rem;
  animation: dspFadeUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes dspFadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Bilah Aksi Utama Atas (Screen Only) */
.dsp-screen-action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}

.dsp-screen-action-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.dsp-screen-action-info .icon-check {
  width: 38px;
  height: 38px;
  background: #16a34a;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dsp-screen-action-info h4 {
  margin: 0 0 2px;
  font-size: 1.05rem;
  color: #14532d;
  font-weight: 800;
}

.dsp-screen-action-info p {
  margin: 0;
  font-size: 0.85rem;
  color: #166534;
}

.dsp-screen-action-buttons {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.dsp-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.15rem;
  font-size: 0.88rem;
  font-weight: 750;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.dsp-btn--wa {
  background: #25d366;
  color: #ffffff !important;
}

.dsp-btn--wa:hover {
  background: #1eb854;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.25);
}

.dsp-btn--print {
  background: #064e3b;
  color: #ffffff !important;
}

.dsp-btn--print:hover {
  background: #04382a;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 78, 59, 0.25);
}

.dsp-btn--reset {
  background: #ffffff;
  color: #475569 !important;
  border: 1px solid #cbd5e1;
}

.dsp-btn--reset:hover {
  background: #f8fafc;
  color: #0f172a !important;
}

/* ==========================================================================
   2. DOKUMEN RISALAH PENGADUAN A4 (SURAT RESMI KEDINASAN)
   ========================================================================== */
.dsp-a4-document-wrapper {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 2.25rem 2.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  font-family: 'Times New Roman', Times, serif, Arial;
  color: #111827;
  line-height: 1.45;
  box-sizing: border-box;
}

/* KOP SURAT RESMI */
.dsp-doc-header {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-bottom: 0.75rem;
}

.dsp-doc-logo {
  width: 78px;
  height: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.dsp-doc-logo img {
  max-width: 100%;
  max-height: 90px;
  object-fit: contain;
}

.dsp-doc-header-text {
  flex: 1;
  text-align: center;
}

.dsp-doc-gov-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #111827;
}

.dsp-doc-agency-title {
  margin: 0.15rem 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #064e3b;
}

.dsp-doc-agency-address {
  margin: 0;
  font-size: 0.78rem;
  font-family: Arial, sans-serif;
  color: #374151;
  line-height: 1.35;
}

.dsp-doc-agency-contacts {
  margin: 0.15rem 0 0;
  font-size: 0.74rem;
  font-family: Arial, sans-serif;
  color: #4b5563;
}

/* GARIS GANDA KOP SURAT (GARIS RESMI KEDINASAN) */
.dsp-doc-divider {
  margin: 0.6rem 0 1.25rem;
  border-top: 2.5px solid #111827;
  border-bottom: 1px solid #111827;
  height: 4px;
}

/* JUDUL TANDA TERIMA & REGISTRASI */
.dsp-doc-title-block {
  text-align: center;
  margin-bottom: 1.25rem;
}

.dsp-doc-main-title {
  margin: 0 0 0.35rem;
  font-size: 1.15rem;
  font-weight: 800;
  text-decoration: underline;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #111827;
}

.dsp-doc-reg-subtitle {
  margin: 0;
  font-family: Arial, sans-serif;
  font-size: 0.85rem;
  color: #374151;
}

/* KOTAK STATUS & TIKET HIGHLIGHT */
.dsp-doc-ticket-card {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  font-family: Arial, sans-serif;
}

.dsp-doc-ticket-meta {
  display: flex;
  flex-direction: column;
}

.dsp-doc-ticket-meta .label {
  font-size: 0.74rem;
  text-transform: uppercase;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.dsp-doc-ticket-meta .number {
  font-size: 1.25rem;
  font-weight: 800;
  color: #064e3b;
  font-family: 'Courier New', Courier, monospace;
}

.dsp-doc-status-badge {
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* TABEL DATA PELAPOR & RINCIAN */
.dsp-doc-table-wrapper {
  margin-bottom: 1.25rem;
}

.dsp-doc-table {
  width: 100%;
  border-collapse: collapse;
  font-family: Arial, sans-serif;
  font-size: 0.86rem;
}

.dsp-doc-table td {
  padding: 0.55rem 0.65rem;
  border: 1px solid #e2e8f0;
  vertical-align: top;
}

.dsp-doc-table .td-label {
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
  width: 28%;
}

.dsp-doc-table .td-value {
  color: #0f172a;
  width: 72%;
}

.dsp-doc-rincian-box {
  background: #ffffff;
  padding: 0.5rem 0;
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  color: #1e293b;
}

/* SEKSI FOOTER: KARTU VERIFIKASI QR CODE TRACKING & STEMPEL ELEKTRONIK */
.dsp-doc-footer-grid {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed #cbd5e1;
  font-family: Arial, sans-serif;
  gap: 1.25rem;
}

/* Sisi Kiri: Kartu Verifikasi QR Code & Tautan */
.dsp-doc-verification-card {
  flex: 1;
  min-width: 0;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.dsp-doc-qr-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.dsp-doc-qr-container {
  width: 90px;
  height: 90px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dsp-doc-qr-container canvas,
.dsp-doc-qr-container img {
  max-width: 100% !important;
  max-height: 100% !important;
}

.dsp-doc-qr-details {
  flex: 1;
  min-width: 0;
}

.dsp-doc-badge-verified {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 800;
  background: #dcfce7;
  color: #15803d;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.dsp-doc-qr-heading {
  margin: 0 0 2px;
  font-size: 0.85rem;
  font-weight: 800;
  color: #064e3b;
  letter-spacing: 0.3px;
}

.dsp-doc-qr-instruction {
  margin: 0;
  font-size: 0.72rem;
  color: #475569;
  line-height: 1.35;
}

/* Kotak Tautan Pelacakan Mandiri yang Lapang dan Elegan */
.dsp-doc-link-container {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.72rem;
  overflow: hidden;
}

.dsp-doc-link-label {
  color: #64748b;
  font-weight: 800;
  flex-shrink: 0;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.dsp-doc-link-href {
  color: #1d4ed8;
  font-family: 'Consolas', 'Courier New', monospace;
  font-size: 0.72rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.dsp-doc-link-href:hover {
  text-decoration: underline;
  color: #0284c7;
}

/* Sisi Kanan: Stempel & Legalitas Dokumen */
.dsp-doc-stamp-block {
  text-align: center;
  min-width: 170px;
  flex-shrink: 0;
}

.dsp-doc-stamp-date {
  font-size: 0.78rem;
  color: #334155;
  margin-bottom: 0.4rem;
}

.dsp-doc-stamp-circle {
  width: 90px;
  height: 90px;
  border: 2px dashed #064e3b;
  border-radius: 50%;
  margin: 0.3rem auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  color: #064e3b;
  transform: rotate(-4deg);
  background: rgba(6, 78, 59, 0.03);
}

.dsp-doc-stamp-circle span.top {
  font-size: 0.58rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dsp-doc-stamp-circle span.mid {
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
  border-top: 1px solid #064e3b;
  border-bottom: 1px solid #064e3b;
  padding: 1px 0;
  margin: 2px 0;
  width: 90%;
}

.dsp-doc-stamp-circle span.bot {
  font-size: 0.55rem;
  font-weight: 700;
}

.dsp-doc-stamp-note {
  margin: 0.4rem 0 0;
  font-size: 0.66rem;
  color: #64748b;
  line-height: 1.25;
}

/* ==========================================================================
   3. WIDGET PELACAKAN PENGADUAN ONLINE (TRACKING TIMELINE)
   ========================================================================== */
.dsp-tracking-box {
  background: #ffffff;
  border: 1.5px solid #064e3b;
  border-radius: 12px;
  padding: 1.75rem;
  margin-bottom: 2rem;
  box-shadow: 0 8px 24px rgba(6, 78, 59, 0.1);
  animation: dspFadeUp 0.35s ease;
}

.dsp-tracking-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.dsp-tracking-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  color: #064e3b;
}

.dsp-tracking-ticket-badge {
  font-family: monospace;
  font-size: 1.05rem;
  font-weight: 800;
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 6px;
  color: #1e293b;
  border: 1px solid #cbd5e1;
}

/* Timeline Progres Penanganan */
.dsp-timeline {
  display: flex;
  justify-content: space-between;
  margin: 1.5rem 0;
  position: relative;
}

.dsp-timeline::before {
  content: '';
  position: absolute;
  top: 18px;
  left: 30px;
  right: 30px;
  height: 3px;
  background: #e2e8f0;
  z-index: 1;
}

.dsp-timeline-step {
  position: relative;
  z-index: 2;
  text-align: center;
  flex: 1;
}

.dsp-timeline-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid #cbd5e1;
  color: #64748b;
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  transition: all 0.2s ease;
}

.dsp-timeline-step.active .dsp-timeline-circle {
  background: #064e3b;
  border-color: #064e3b;
  color: #ffffff;
  box-shadow: 0 0 0 4px rgba(6, 78, 59, 0.15);
}

.dsp-timeline-step.completed .dsp-timeline-circle {
  background: #16a34a;
  border-color: #16a34a;
  color: #ffffff;
}

.dsp-timeline-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #475569;
}

.dsp-timeline-step.active .dsp-timeline-label {
  color: #064e3b;
  font-weight: 800;
}

.dsp-tracking-details-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1.25rem;
}

.dsp-tracking-details-box h5 {
  margin: 0 0 0.5rem;
  font-size: 0.88rem;
  color: #334155;
}

.dsp-tracking-details-box p {
  margin: 0;
  font-size: 0.85rem;
  color: #475569;
  line-height: 1.5;
}

/* ==========================================================================
   4. ATURAN CETAK PRESISI A4 FIT-WIDTH (@media print)
   ========================================================================== */
@page {
  size: A4 portrait;
  margin: 10mm 12mm 10mm 12mm;
}

@media print {
  /* Sembunyikan SEMUA elemen website selain dokumen tanda terima */
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 10pt !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body * {
    visibility: hidden !important;
  }

  /* Tampilkan hanya dokumen risalah A4 */
  .dsp-a4-document-wrapper,
  .dsp-a4-document-wrapper * {
    visibility: visible !important;
  }

  .dsp-screen-action-bar,
  .dsp-no-print {
    display: none !important;
  }

  .dsp-a4-document-wrapper {
    position: absolute !important;
    left: 0 !important;
    top: 0 !important;
    width: 100% !important;
    max-width: 185mm !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .dsp-doc-table,
  .dsp-doc-header,
  .dsp-doc-footer-grid,
  .dsp-doc-ticket-card {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .dsp-doc-agency-title {
    color: #064e3b !important;
  }

  .dsp-doc-ticket-card {
    background: #f8fafc !important;
    border-color: #94a3b8 !important;
  }

  .dsp-doc-table .td-label {
    background: #f1f5f9 !important;
  }

  .dsp-doc-stamp-circle {
    border-color: #064e3b !important;
    color: #064e3b !important;
  }
}

/* ==========================================================================
   5. RESPONSIVITAS MOBILE UNTUK SCREEN
   ========================================================================== */
@media screen and (max-width: 640px) {
  .dsp-a4-document-wrapper {
    padding: 1.25rem 1rem;
  }

  .dsp-doc-header {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .dsp-doc-logo {
    margin: 0 auto;
  }

  .dsp-doc-agency-title {
    font-size: 1.15rem;
  }

  .dsp-doc-ticket-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .dsp-doc-footer-grid {
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
  }

  .dsp-doc-qr-block {
    max-width: 100%;
    justify-content: center;
  }

  .dsp-timeline-label {
    font-size: 0.68rem;
  }
}

/* ==========================================================================
   6. KOTAK VERIFIKASI KEAMANAN ANTI-BOT (CAPTCHA & HONEYPOT)
   ========================================================================== */
.dsp-captcha-container {
  margin: 1.25rem 0;
  padding: 1rem 1.15rem;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.dsp-captcha-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px;
}

.dsp-captcha-label {
  font-size: 0.88rem;
  font-weight: 750;
  color: #1e293b;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.dsp-captcha-label .required {
  color: #dc2626;
}

.dsp-captcha-subtext {
  font-size: 0.76rem;
  color: #64748b;
  margin: 0;
}

.dsp-captcha-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dsp-captcha-canvas-wrap {
  position: relative;
  display: flex;
  align-items: center;
  background: #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.12);
  border: 1.5px solid #94a3b8;
}

.dsp-captcha-canvas {
  display: block;
  width: 124px;
  height: 40px;
  cursor: pointer;
}

.dsp-btn-refresh-captcha {
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #064e3b;
  cursor: pointer;
  transition: all 0.25s ease;
  flex-shrink: 0;
}

.dsp-btn-refresh-captcha:hover {
  background: #f1f5f9;
  color: #042f24;
  transform: rotate(90deg);
  border-color: #94a3b8;
}

.dsp-captcha-input {
  flex: 1;
  min-width: 130px;
  height: 40px;
  padding: 0.45rem 0.85rem;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #0f172a;
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.dsp-captcha-input:focus {
  border-color: #064e3b;
  outline: none;
  box-shadow: 0 0 0 3px rgba(6, 78, 59, 0.15);
}

/* Honeypot Trap (Tersembunyi Total dari Penglihatan Manusia) */
.dsp-hp-trap {
  display: none !important;
  visibility: hidden !important;
  position: absolute !important;
  left: -99999px !important;
  opacity: 0 !important;
  height: 0 !important;
  width: 0 !important;
  pointer-events: none !important;
}
