/* ==========================================================================
   100% ACCURATE RAJASTHAN FORM NO. 6 ALIGNMENT & FULLY CUSTOMIZABLE STYLESHEET
   ========================================================================== */

:root {
  --primary-color: #1d4ed8;
  --primary-hover: #1e40af;
  --bg-color: #f1f5f9;
  --panel-bg: #ffffff;
  --border-color: #cbd5e1;
  --text-main: #0f172a;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  font-family: 'Noto Sans Devanagari', 'Hind', 'Roboto', Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
}

body {
  display: flex;
  flex-direction: column;
}

/* APP HEADER */
.app-header {
  height: 52px;
  flex-shrink: 0;
  background-color: #0f172a;
  color: #ffffff;
  padding: 0 16px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  position: relative;
  z-index: 100;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.header-content {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap !important;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand svg {
  color: #38bdf8;
  flex-shrink: 0;
}

.brand h1 {
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}

.brand p {
  font-size: 0.72rem;
  color: #94a3b8;
  white-space: nowrap;
  line-height: 1.1;
}

@media (max-width: 1400px) {
  .brand p {
    display: none;
  }
}

/* HEADER NAVIGATION TABS (SWITCH BETWEEN BIRTH AND DEATH) */
.header-nav-tabs {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #1e293b;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid #334155;
  flex-shrink: 0;
}

.header-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 5px;
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: #94a3b8;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.header-nav-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.08);
}

.header-nav-link.active {
  background-color: var(--primary-color);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* BUTTONS */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  height: 32px;
}

.btn-icon {
  width: 32px;
  min-width: 32px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn:disabled,
.format-btn:disabled {
  opacity: 0.42 !important;
  cursor: not-allowed !important;
  pointer-events: none !important;
}

.btn-primary {
  background-color: var(--primary-color);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-outline {
  background-color: transparent;
  border-color: #475569;
  color: #f1f5f9;
}

.btn-outline:hover {
  background-color: #1e293b;
}

.btn-secondary {
  background-color: #334155;
  color: #ffffff;
}

.btn-secondary:hover {
  background-color: #475569;
}

.btn-text {
  background: none;
  border: none;
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  text-decoration: underline;
  text-align: left;
}

/* APP LAYOUT */
.app-layout {
  display: flex;
  flex: 1;
  max-width: 1650px;
  width: 100%;
  margin: 0 auto;
  gap: 16px;
  padding: 10px 16px;
  height: calc(100vh - 60px);
  max-height: calc(100vh - 60px);
  overflow: hidden;
}

/* LEFT FORM PANEL */
.form-panel, .sidebar {
  width: 440px;
  min-width: 380px;
  height: 100%;
  max-height: 100%;
  background-color: var(--panel-bg);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  min-height: 0;
}

.panel-header {
  padding: 12px 18px;
  background-color: #f8fafc;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

.panel-header h2 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
}

.badge {
  background-color: #dbeafe;
  color: #1e40af;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

#certForm, #gazetteForm {
  padding: 14px;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: #94a3b8 #f1f5f9;
}

#certForm::-webkit-scrollbar,
#gazetteForm::-webkit-scrollbar {
  width: 8px;
}

#certForm::-webkit-scrollbar-track,
#gazetteForm::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

#certForm::-webkit-scrollbar-thumb,
#gazetteForm::-webkit-scrollbar-thumb {
  background-color: #94a3b8;
  border-radius: 4px;
  border: 2px solid #f1f5f9;
}

#certForm::-webkit-scrollbar-thumb:hover,
#gazetteForm::-webkit-scrollbar-thumb:hover {
  background-color: #64748b;
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

.pulse-highlight {
  animation: pulseGlow 1.2s ease;
  border-color: #2563eb !important;
}

.form-section {
  background-color: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 12px;
}

.highlight-section {
  background-color: #f0f9ff;
  border-color: #bae6fd;
}

.highlight-section-green {
  background-color: #f0fdf4;
  border-color: #bbf7d0;
}

.highlight-section-yellow {
  background-color: #fefce8;
  border-color: #fef08a;
}

.highlight-section-purple {
  background-color: #faf5ff;
  border-color: #e9d5ff;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e2e8f0;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
}

.section-title h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #0f172a;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.label-val-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.slider-val-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #166534;
  background-color: #dcfce7;
  padding: 1px 6px;
  border-radius: 4px;
}

.input-group label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #334155;
}

.input-group input[type="text"],
.input-group select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  font-size: 0.85rem;
  color: #0f172a;
  font-family: inherit;
}

.input-group input[type="range"] {
  width: 100%;
  accent-color: var(--primary-color);
  cursor: pointer;
}

.input-group input[type="file"] {
  font-size: 0.8rem;
  color: #334155;
}

.input-group input:focus,
.input-group select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* RIGHT PREVIEW PANEL */
.preview-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
  height: 100%;
  max-height: 100%;
}

.preview-toolbar {
  background-color: #ffffff;
  padding: 5px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: #475569;
  flex-shrink: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: thin;
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Toolbar Mode Switcher */
.toolbar-mode-group {
  display: inline-flex;
  background-color: #f1f5f9;
  padding: 2px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.mode-btn {
  border: none;
  background: transparent;
  padding: 3px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  color: #475569;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.mode-btn.active {
  background-color: #2563eb;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(37,99,235,0.25);
}

/* Toolbar Text Formatting Tools */
.toolbar-format-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background-color: #f8fafc;
  padding: 2px 6px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
}

.format-btn {
  background-color: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  min-width: 25px;
  height: 25px;
  padding: 0 5px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  transition: all 0.12s ease;
  user-select: none;
}

.format-btn:hover {
  background-color: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

.format-btn.active {
  background-color: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
}

.format-divider {
  width: 1px;
  height: 16px;
  background-color: #cbd5e1;
  margin: 0 2px;
}

.format-font-val {
  font-weight: 700;
  font-size: 0.78rem;
  color: #1e293b;
  min-width: 38px;
  text-align: center;
}

.format-font-select {
  font-size: 0.76rem;
  padding: 2px 4px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background-color: #ffffff;
  color: #334155;
  cursor: pointer;
}

.toolbar-zoom-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.zoom-btn {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  width: 26px;
  height: 26px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #334155;
  transition: all 0.15s ease;
  user-select: none;
}

.zoom-btn:hover {
  background-color: #e2e8f0;
  color: #0f172a;
}

.zoom-val {
  font-weight: 700;
  font-size: 0.8rem;
  color: #1e293b;
  min-width: 44px;
  text-align: center;
}

.zoom-btn-text {
  background-color: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: #334155;
  transition: all 0.15s ease;
}

.zoom-btn-text:hover {
  background-color: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
}

.drag-hint {
  font-size: 0.78rem;
  color: #2563eb;
  font-weight: 600;
}

.certificate-wrapper {
  flex: 1;
  overflow: auto;
  overscroll-behavior: contain;
  background-color: #cbd5e1;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

/* ==========================================================================
   100% ACCURATE RAJASTHAN FORM NO. 6 DEATH CERTIFICATE (A4 SIZE)
   ========================================================================== */

.certificate-paper {
  --page-margin-top: 8mm;
  --page-margin-bottom: 16.5mm;
  --page-margin-left: 6mm;
  --page-margin-right: 5.5mm;
  width: 210mm;
  min-height: 297mm;
  background-color: #ffffff;
  padding-top: var(--page-margin-top, 8mm);
  padding-bottom: var(--page-margin-bottom, 16.5mm);
  padding-left: var(--page-margin-left, 6mm);
  padding-right: var(--page-margin-right, 5.5mm);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  color: #000000;
  font-family: 'Noto Sans Devanagari', 'Hind', Arial, sans-serif;
  line-height: 1.2;
  position: relative;
  margin: 0 auto;
  transform-origin: top center;
  transition: transform 0.12s ease;
  box-sizing: border-box;
}

/* Outer Border Box */
.cert-outer-box {
  border: 2.5px solid #000000;
  padding: 10px;
  min-height: calc(297mm - (var(--page-margin-top, 8mm) + var(--page-margin-bottom, 16.5mm)));
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  background-color: #ffffff;
  box-sizing: border-box;
}

/* BACKGROUND WATERMARK (AUTHENTIC PEHCHAN WATERMARK - STRICTLY IN BACKGROUND) */
.cert-watermark {
  position: absolute;
  top: 55%;
  left: 51%;
  transform: translate(-50%, -50%);
  width: 600px;
  max-width: 95%;
  pointer-events: none !important;
  z-index: 0 !important;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
}

.cert-watermark img {
  width: 100%;
  height: auto;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0.95;
  pointer-events: none !important;
  transition: opacity 0.1s ease;
}

/* Ensure all cert elements sit strictly above the watermark */
.cert-header,
.rules-header-block,
.declaration-block,
.cert-grid-layout,
.addresses-layout,
.reg-remarks-layout,
.signature-qr-row,
.issuing-authority-block,
.birth-sign-row,
.birth-bottom-auth-layout,
.cert-note-block,
.circular-disclaimer-box,
.cert-bottom-credits {
  position: relative;
  z-index: 2;
}

/* Interactive In-place Editable styling */
body.edit-mode [contenteditable="true"] {
  cursor: text;
  transition: background-color 0.12s ease, outline 0.12s ease;
}

body.edit-mode [contenteditable="true"]:hover {
  outline: 1px dashed #6366f1;
  outline-offset: 1px;
}

body.edit-mode [contenteditable="true"]:focus {
  outline: 2px solid #2563eb !important;
  outline-offset: 2px;
  background-color: rgba(239, 246, 255, 0.5) !important;
}

body.move-mode [contenteditable="true"] {
  cursor: grab;
  user-select: none;
}

/* HEADER SECTION */
.cert-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0px;
  position: relative;
}

/* BORDER-FREE DYNAMIC SCALABLE QR CODE BOXES */
.top-qr-box.border-free-qr {
  width: 76px;
  height: 76px;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
}

.bottom-qr-box.border-free-qr {
  width: 72px;
  height: 72px;
  border: none !important;
  padding: 0 !important;
  background: transparent !important;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: visible;
}

/* Hide duplicate internal canvas generated by qrcode.js so only a single crisp img is shown */
.top-qr-box canvas,
.bottom-qr-box canvas {
  display: none !important;
}

.top-qr-box img,
.bottom-qr-box img {
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block !important;
}

.header-center {
  flex: 1;
  text-align: center;
  padding: 0 10px;
}

.emblem-container {
  margin-bottom: 2px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.text-form-no-hi {
  font-size: 11px;
  font-weight: 700;
  margin-top: 1px;
}

.text-form-no-en {
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.text-govt-hi {
  font-size: 13px;
  font-weight: 700;
  margin-top: 1px;
}

.text-govt-en {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.text-dept-hi {
  font-size: 13px;
  font-weight: 700;
  margin-top: 1px;
}

.text-dept-en {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.text-registrar-hi {
  font-size: 12px;
  font-weight: 700;
  margin-top: 2px;
}

.text-registrar-en {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.text-cert-title-hi {
  font-size: 11.5px;
  font-weight: 700;
  margin-top: 2px;
}

.text-cert-title-en {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.5px;
}

.pehchan-logo-box {
  width: 70px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.official-logo {
  object-fit: contain;
  max-width: 65px;
  max-height: 65px;
}

/* RULES HEADER SUBTITLE (EXACT PDF MATCH - UNBOLD & COMPACT) */
.rules-header-block {
  text-align: center;
  font-size: 9.5px;
  margin: 3px auto 4px auto;
  line-height: 1.28;
}

.rules-line-hi {
  font-weight: 400;
  margin-bottom: 2px;
}

.rules-line-en {
  font-weight: 400;
  font-size: 8.5px;
  letter-spacing: 0.1px;
}

.horizontal-line {
  border: none;
  border-top: 2.5px solid #000000;
  margin: 3px auto 4px auto;
  width: 114%;
  position: relative;
  cursor: pointer;
  transition: opacity 0.15s ease, border-width 0.15s ease, width 0.15s ease;
}

.horizontal-line:hover {
  outline: 1px dashed #3b82f6;
  outline-offset: 2px;
}

.horizontal-line.is-selected {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* User Inserted Horizontal Lines */
.user-inserted-line {
  position: relative;
  width: 100%;
  margin: 6px 0;
  padding: 4px 0;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  user-select: none;
  z-index: 5;
}

.user-inserted-line .line-bar {
  width: 100%;
  border-top: 1.5px solid #000000;
  margin: 0 auto;
  pointer-events: none;
  transition: border-color 0.15s ease, border-width 0.15s ease, width 0.15s ease;
}

.user-inserted-line:hover {
  background-color: rgba(37, 99, 235, 0.04);
  outline: 1px dashed #3b82f6;
  border-radius: 2px;
}

.user-inserted-line.is-selected {
  background-color: rgba(37, 99, 235, 0.08);
  outline: 2px solid #2563eb;
  border-radius: 2px;
}

.user-inserted-line .line-del-btn {
  display: none;
  position: absolute;
  right: -24px;
  top: 50%;
  transform: translateY(-50%);
  background-color: #ef4444;
  color: #ffffff;
  border: none;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  z-index: 25;
}

.user-inserted-line:hover .line-del-btn,
.user-inserted-line.is-selected .line-del-btn {
  display: flex;
}

.user-inserted-line .line-del-btn:hover {
  background-color: #dc2626;
  transform: translateY(-50%) scale(1.15);
}

/* User Inserted Vertical Lines */
.user-inserted-line.is-vertical {
  width: 18px !important;
  height: 140px;
  min-height: 20px;
  margin: 0;
  padding: 0;
  position: absolute;
  top: 250px;
  left: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: move;
  z-index: 15;
}

.user-inserted-line.is-vertical .line-bar {
  width: 0 !important;
  height: 100%;
  border-top: none !important;
  border-left: 1.5px solid #000000;
  margin: 0 auto;
  pointer-events: none;
  transition: border-color 0.15s ease, border-width 0.15s ease, height 0.15s ease;
}

.user-inserted-line.is-vertical .line-del-btn {
  top: -10px;
  right: -10px;
  transform: none;
}

/* DECLARATION PARAGRAPH */
.declaration-block {
  font-size: 11px;
  line-height: 1.35;
  margin-bottom: 10px;
  text-align: justify;
}

.decl-hi, .decl-en {
  margin-bottom: 3px;
}

/* GRID LAYOUT */
.cert-grid-layout {
  display: flex;
  width: 100%;
  gap: 16px;
  margin-bottom: 8px;
}

.grid-left-col {
  width: 58%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.grid-right-col {
  width: 42%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-row {
  font-size: 11.5px;
  line-height: 1.25;
}

.lbl-text {
  font-weight: 500;
  margin-right: 4px;
  color: #000000;
}

.val-bold {
  font-weight: 700;
  color: #000000;
}

.field-block-group {
  margin-top: 2px;
}

.place-lines,
.addr-val-lines {
  font-weight: 700;
  line-height: 1.3;
  margin-top: 3px;
  font-size: 11px;
}

/* ADDRESSES SECTION */
.addresses-layout {
  display: flex;
  width: 100%;
  gap: 16px;
  margin-top: 6px;
  margin-bottom: 8px;
}

.addr-left-col {
  width: 50%;
}

.addr-right-col {
  width: 50%;
}

.lbl-block {
  font-weight: 500;
  font-size: 11.5px;
  color: #000000;
}

.lbl-sub {
  font-weight: 500;
  font-size: 11px;
  color: #000000;
}

/* REGISTRATION & REMARKS */
.reg-remarks-layout {
  display: flex;
  width: 100%;
  gap: 16px;
  margin-top: 4px;
  margin-bottom: 8px;
}

.reg-left-col {
  width: 58%;
}

.reg-right-col {
  width: 42%;
}

.margin-top-8 {
  margin-top: 8px;
}

/* DIGITAL SIGNATURE & QR CODE ROW */
.signature-qr-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 30px;
  margin-top: 10px;
  padding-right: 10px;
  position: relative;
}

/* Digital Signature Seal Container */
.digital-sign-box {
  min-width: 240px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  transform: scale(0.85);
  transform-origin: bottom right;
}

/* VERIFIED SIGNATURE SEAL (EXACT GREEN TICK OVERLAY MATCHING USER PHOTO) */
.verified-sign-container {
  position: relative;
  padding: 4px 8px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 11.5px;
  color: #111827;
  line-height: 1.5;
  background: transparent;
}

.green-tick-mark {
  position: absolute;
  top: 50%;
  left: 45%;
  transform: translate(-50%, -55%);
  opacity: 0.95;
  pointer-events: none;
  z-index: 10;
}

.green-tick-mark svg {
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}

.green-tick-img {
  position: absolute;
  top: 48%;
  left: 44%;
  transform: translate(-50%, -50%);
  width: 41px;
  height: 41px;
  object-fit: contain;
  mix-blend-mode: multiply;
  opacity: 0.92;
  cursor: grab;
  user-select: none;
  z-index: 10;
  transition: opacity 0.12s ease;
}

.green-tick-img:hover {
  outline: 2px dashed #16a34a !important;
  outline-offset: 2px;
}

.green-tick-img.is-dragging {
  cursor: grabbing !important;
  outline: 2px solid #16a34a !important;
  z-index: 999 !important;
}

.verified-sign-text {
  position: relative;
  z-index: 2;
  font-weight: 500;
}

.verified-sign-text div {
  white-space: nowrap;
}

.verified-sign-text span {
  font-weight: 600;
  color: #000000;
}

/* Default Yellow Seal Style */
.sign-status-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  color: #047857;
  border-bottom: 1px dashed #10b981;
  padding-bottom: 3px;
  margin-bottom: 3px;
}

.yellow-question-badge {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: #facc15;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 13px;
  position: relative;
}

.yellow-question-badge .badge-num {
  position: absolute;
  bottom: -2px;
  right: -2px;
  font-size: 9px;
  color: #000;
}

.sign-meta-body {
  line-height: 1.3;
  color: #064e3b;
  font-size: 9.5px;
}

.sign-meta-body span {
  font-weight: 700;
}

/* MOUSE DRAGGABLE VISUAL FEEDBACK */
.draggable-item {
  cursor: grab;
  user-select: none;
  transition: box-shadow 0.15s ease, outline 0.15s ease, background-color 0.15s ease;
  z-index: 10;
  border-radius: 2px;
}

body.edit-mode .draggable-item {
  user-select: auto;
}

body.edit-mode .draggable-item [contenteditable="true"] {
  cursor: text;
  user-select: text;
}

body.edit-mode .draggable-item:hover {
  outline: 1.5px dashed rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

body.move-mode .draggable-item,
body.move-mode .draggable-item * {
  cursor: grab !important;
  user-select: none !important;
}

body.move-mode .draggable-item:hover {
  outline: 2px dashed #2563eb !important;
  outline-offset: 2px;
  background-color: rgba(37, 99, 235, 0.05);
}

.draggable-item.is-dragging,
body.move-mode .draggable-item.is-dragging,
body.move-mode .draggable-item.is-dragging * {
  cursor: grabbing !important;
  outline: 2px solid #2563eb !important;
  box-shadow: 0 8px 16px rgba(37, 99, 235, 0.25) !important;
  z-index: 999 !important;
}

.header-text-block {
  text-align: center;
}

/* KEYBOARD ARROW SELECTION & ACTIVE FOCUS */
.draggable-item.is-selected-draggable {
  outline: 2px solid #2563eb !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 3.5px rgba(37, 99, 235, 0.25) !important;
  z-index: 100 !important;
}

body.move-mode .draggable-item.is-selected-draggable {
  outline: 2px solid #2563eb !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4.5px rgba(37, 99, 235, 0.3) !important;
}

/* ISSUING AUTHORITY ROW (FORM 6 DEATH CERTIFICATE) */
.issuing-authority-block {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-top: 10px;
  font-size: 11px;
}

.auth-left-col {
  font-size: 11px;
}

.auth-right-col {
  text-align: right;
  font-weight: 700;
  font-size: 10.5px;
}

/* SIGNATURE STAND ROW (RIGHT ALIGNED) */
.signature-stand-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
  margin-bottom: 2px;
  padding-right: 6px;
  position: relative;
  z-index: 1;
}

/* BIRTH CERTIFICATE SIGNATURE & ISSUANCE ROW (MATCHING PDF) */
.birth-sign-row,
.birth-bottom-auth-layout {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 8px;
  margin-bottom: 2px;
  position: relative;
  z-index: 2;
}

.birth-issue-col,
.birth-issue-box {
  font-size: 11px;
  font-weight: 700;
  padding-bottom: 2px;
}

.birth-right-auth-col,
.birth-sign-col,
.birth-auth-sign-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 4px;
}

.birth-auth-title-box {
  text-align: right;
  position: relative;
  z-index: 2;
}

.birth-authority-lbl {
  font-size: 10.5px;
  font-weight: 700;
  margin-top: 2px;
  text-align: right;
  color: #000000;
  white-space: nowrap;
}

/* BIRTH CERTIFICATE NOTE 01/01/2007 BLOCK (EXACT IMAGE 1 MATCH) */
.cert-note-block {
  font-size: 8px;
  line-height: 1.25;
  margin-top: 3px;
  margin-bottom: 2px;
  text-align: justify;
  position: relative;
  z-index: 1;
}

.cert-note-block .note-hi {
  font-weight: 700;
  margin-bottom: 1px;
}

.cert-note-block .note-en {
  font-weight: 400;
}

/* CIRCULAR NOTICE DISCLAIMER (EXACT IMAGE 1 MATCH) */
.circular-disclaimer-box {
  font-size: 8px;
  line-height: 1.25;
  margin-top: 2px;
  margin-bottom: 2px;
  text-align: justify;
}

.disc-hi {
  margin-bottom: 1px;
}

/* FOOTER CREDITS (EXACT IMAGE 1 MATCH) */
.cert-bottom-credits {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 8.5px;
  font-weight: 800;
  margin-top: 2px;
  line-height: 1.2;
}

.cert-bottom-credits a {
  color: #000000;
  text-decoration: none;
}

/* ==========================================================================
   RAJASTHAN GAZETTE (राजस्थान राज-पत्र) STYLES
   ========================================================================== */

.gazette-paper {
  --page-margin-top: 14mm;
  --page-margin-bottom: 14mm;
  --page-margin-left: 14mm;
  --page-margin-right: 14mm;
  font-family: 'Noto Sans Devanagari', 'Hind', Arial, sans-serif;
  color: #000000;
  line-height: 1.45;
}

.gazette-outer-box {
  width: 100%;
  min-height: calc(297mm - (var(--page-margin-top, 14mm) + var(--page-margin-bottom, 14mm)));
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  background-color: #ffffff;
  box-sizing: border-box;
}

/* Header Container - Official Table */
.gz-table-wrap {
  width: 100%;
  margin-bottom: 12px;
}

.gz-official-table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1.5px solid #000000;
  border-bottom: 1.5px solid #000000;
  border-left: hidden !important;
  border-right: hidden !important;
  box-sizing: border-box;
}

.gz-tbl-emblem-cell {
  width: 95px;
  min-width: 90px;
  max-width: 105px;
  border-left: hidden !important;
  border-right: 1.5px solid #000000;
  text-align: center;
  vertical-align: middle;
  padding: 6px 4px;
  box-sizing: border-box;
}

.gz-tbl-emblem-img {
  max-height: 85px;
  width: auto;
  display: block;
  margin: 0 auto;
  object-fit: contain;
}

.gz-tbl-title-hi {
  width: 50%;
  border-right: 1.5px solid #000000;
  border-bottom: 1.5px solid #000000;
  text-align: center;
  padding: 4px 6px;
  box-sizing: border-box;
}

.gz-tbl-title-en {
  width: 50%;
  border-right: hidden !important;
  border-bottom: 1.5px solid #000000;
  text-align: center;
  padding: 4px 6px;
  box-sizing: border-box;
}

.gz-title-hi {
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.2;
}

.gz-subtitle-hi {
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}

.gz-title-en {
  font-family: 'Times New Roman', Times, serif;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.5px;
}

.gz-subtitle-en {
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.2;
}

.gz-tbl-pub-hi {
  border-right: 1.5px solid #000000;
  border-bottom: 1.5px solid #000000;
  text-align: center;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 6px;
  box-sizing: border-box;
}

.gz-tbl-pub-en {
  border-right: hidden !important;
  border-bottom: 1.5px solid #000000;
  text-align: center;
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 3px 6px;
  box-sizing: border-box;
}

.gz-tbl-dates-cell {
  border-left: hidden !important;
  border-right: hidden !important;
  text-align: center;
  padding: 4px 8px;
  box-sizing: border-box;
}

.gz-tbl-date-hi {
  font-size: var(--gz-date-font-size, 12px);
  font-weight: 500;
  line-height: 1.35;
  outline: none;
}

.gz-tbl-date-en {
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  font-size: calc(var(--gz-date-font-size, 12px) * 0.98);
  line-height: 1.35;
  outline: none;
}

/* Section Part & Description */
.gz-part-block {
  text-align: center;
  margin: 8px 0 12px 0;
  padding: 0;
}

.gz-part-heading {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 3px;
}

.gz-part-subheading {
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
  max-width: 90%;
  margin: 0 auto;
}

/* Document Title */
.gz-doc-title {
  text-align: center;
  font-size: 1.08rem;
  font-weight: 700;
  margin: 12px 0 10px 0;
  letter-spacing: 0.5px;
}

/* Affidavit Body Text */
.gz-opening-p {
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: justify;
  text-indent: 24px;
  margin-bottom: 8px;
}

.gz-points-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px 0;
}

.gz-point-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: justify;
  margin-bottom: 8px;
}

.gz-point-idx {
  flex-shrink: 0;
  font-weight: 600;
  min-width: 18px;
}

.gz-point-content {
  flex: 1;
  text-align: justify;
}

/* Signatures */
.gz-sign-wrap {
  display: flex;
  justify-content: flex-end;
  margin: 12px 0 16px 0;
}

.gz-sign-box {
  text-align: center;
  min-width: 130px;
}

.gz-sign-name {
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1.3;
}

.gz-sign-role {
  font-size: 0.82rem;
  font-weight: 500;
}

/* Verification (तसदीक) */
.gz-tasdeeq-block {
  margin-top: 12px;
}

.gz-tasdeeq-title {
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.gz-tasdeeq-p {
  font-size: 0.85rem;
  line-height: 1.55;
  text-align: justify;
  text-indent: 24px;
  margin-bottom: 12px;
}

.gz-tasdeeq-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.gz-place-date {
  font-size: 0.85rem;
  line-height: 1.5;
  font-weight: 600;
}

/* Notary Stamp / Attestation */
.gz-notary-wrap {
  text-align: center;
  margin: 16px auto;
  font-family: Arial, sans-serif;
  line-height: 1.35;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gz-notary-stamp {
  border: 1px dashed transparent;
  padding: 4px 12px;
  display: inline-block;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.gz-notary-stamp:hover {
  border-color: #94a3b8;
}

.gz-notary-attested {
  font-size: 0.9rem;
  font-weight: 900;
  letter-spacing: 1px;
}

.gz-notary-name {
  font-size: 0.86rem;
  font-weight: 800;
}

.gz-notary-date {
  font-size: 0.82rem;
  font-weight: 700;
}

.gz-notary-title {
  font-size: 0.82rem;
  font-weight: 700;
}

.gz-notary-jur {
  font-size: 0.82rem;
  font-weight: 700;
}

.gz-notary-reg {
  font-size: 0.82rem;
  font-weight: 800;
}

/* Bottom Press - Text Only (No line, No box) */
.gz-press-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 24px;
  padding-bottom: 6px;
}

.gz-press-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: #000000;
  text-align: center;
  letter-spacing: 0.3px;
}

/* PRINT CSS */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  body {
    background-color: #ffffff !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .no-print {
    display: none !important;
  }

  .draggable-item,
  .draggable-item:hover,
  .draggable-item.is-dragging,
  .draggable-item.is-selected-draggable {
    outline: none !important;
    box-shadow: none !important;
  }

  .user-inserted-line {
    outline: none !important;
    background: none !important;
    margin: 4px 0 !important;
    padding: 0 !important;
  }

  .horizontal-line {
    outline: none !important;
  }

  .user-inserted-line .line-del-btn {
    display: none !important;
  }

  .app-layout {
    padding: 0 !important;
    margin: 0 !important;
    height: auto !important;
  }

  .preview-panel {
    width: 100% !important;
  }

  .certificate-wrapper {
    background: transparent !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .certificate-paper,
  .gazette-paper {
    box-shadow: none !important;
    width: 210mm !important;
    min-height: 297mm !important;
    height: 297mm !important;
    max-height: 297mm !important;
    padding-top: var(--page-margin-top, 8mm) !important;
    padding-bottom: var(--page-margin-bottom, 8mm) !important;
    padding-left: var(--page-margin-left, 10mm) !important;
    padding-right: var(--page-margin-right, 10mm) !important;
    transform: none !important;
    margin: 0 auto !important;
    box-sizing: border-box !important;
    page-break-after: avoid !important;
    page-break-inside: avoid !important;
  }

  .cert-outer-box,
  .gazette-outer-box {
    box-sizing: border-box !important;
    min-height: calc(297mm - (var(--page-margin-top, 8mm) + var(--page-margin-bottom, 8mm))) !important;
    height: calc(297mm - (var(--page-margin-top, 8mm) + var(--page-margin-bottom, 8mm))) !important;
    max-height: calc(297mm - (var(--page-margin-top, 8mm) + var(--page-margin-bottom, 8mm))) !important;
  }

  @page {
    size: A4 portrait;
    margin: 0mm;
  }
}
