/* उशिरा जन्म-मृत्यू नोंद : अंतिम आदेश व पत्र जनरेटर — pctool.in */

/* Sakal Bharati — upload the TTF to ./fonts/SakalBharati.ttf on the server.
   Only the regular weight is needed: bold is synthesized by the browser
   (font-synthesis), which html2canvas also preserves in the PDF output.
   Falls back to Noto Sans Devanagari (Google Fonts) if missing. */
@font-face{
  font-family:'Sakal Bharati';
  src:url('fonts/SakalBharati.ttf') format('truetype');
  font-weight:normal; font-style:normal; font-display:swap;
}

:root{
  --lr-primary:#7c3aed; --lr-primary-dark:#5b21b6;
  --lr-bg:#f4f5f7; --lr-panel:#ffffff; --lr-border:#e2e4ea;
  --lr-text:#1f2330; --lr-text-soft:#6b7280;
  --lr-accent-bg:#fef3c7; --lr-accent-border:#fbbf24;
}

* { box-sizing: border-box; }

.lr-app { font-family:'Noto Sans Devanagari','Noto Sans',sans-serif; background:var(--lr-bg); color:var(--lr-text); }
.app-shell { display:flex; height: calc(100vh - 56px); }
.lr-card--questions{ border:1.5px solid #c4b5fd; background:#f5f3ff; }
.lr-card--questions h3{ color:#5b21b6; border-color:#ddd6fe; }

/* ---------- Topbar ---------- */
.lr-topbar{ display:flex; align-items:center; justify-content:space-between; padding:8px 16px; background:var(--lr-panel); border-bottom:1px solid var(--lr-border); height:56px; gap:10px; flex-wrap:wrap; }
.lr-topbar h1{ font-size:14px; font-weight:700; margin:0; }
.lr-topbar .right{ display:flex; align-items:center; gap:8px; }
.lr-select{ padding:6px 8px; border:1px solid var(--lr-border); border-radius:8px; font-size:12px; background:#fff; }
.lr-btn{ padding:7px 12px; border:1px solid var(--lr-border); border-radius:8px; background:#fff; font-size:12px; font-weight:600; cursor:pointer; }
.lr-btn:hover{ background:#f8f8fb; }
.lr-btn--primary{ background:var(--lr-primary); border-color:var(--lr-primary); color:#fff; }
.lr-btn--primary:hover{ background:var(--lr-primary-dark); }
.lr-btn--ghost{ background:transparent; border-color:transparent; }

/* ---------- Left form panel ---------- */
.lr-form{ width:360px; flex-shrink:0; overflow-y:auto; padding:14px; border-right:1px solid var(--lr-border); background:#fff; }
.lr-card{ background:var(--lr-bg); border:1px solid var(--lr-border); border-radius:12px; padding:12px; margin-bottom:12px; }
.lr-card h3{ font-size:11px; text-transform:uppercase; letter-spacing:.4px; color:var(--lr-text-soft); margin:0 0 8px; padding-bottom:6px; border-bottom:1px solid var(--lr-border); }
.lr-row{ display:flex; gap:8px; margin-bottom:8px; }
.lr-row:last-child{ margin-bottom:0; }
.lr-col{ flex:1; display:flex; flex-direction:column; gap:3px; }
.lr-col label{ font-size:10px; font-weight:600; color:var(--lr-text-soft); }
.lr-col input, .lr-col select, .lr-col textarea{ padding:6px 8px; border:1.5px solid var(--lr-border); border-radius:8px; font-size:12.5px; font-family:inherit; background:#fff; }
.lr-col input:focus, .lr-col select:focus{ outline:none; border-color:var(--lr-primary); }

.chk-row{ display:flex; align-items:center; gap:6px; font-size:12px; padding:3px 0; }
.chk-row input{ width:14px; height:14px; }

.fam-row{ display:grid; grid-template-columns:1.4fr 1fr 1fr 1fr auto; gap:5px; margin-bottom:6px; }
.fam-row input{ padding:5px 6px; border:1.5px solid var(--lr-border); border-radius:6px; font-size:11px; }
.fam-del{ border:none; background:#fee2e2; color:#b91c1c; border-radius:6px; cursor:pointer; font-size:11px; padding:0 8px; }
.lr-btn--sm{ padding:5px 10px; font-size:11px; margin-top:4px; }

.lr-notice{ font-size:11px; padding:8px 10px; background:var(--lr-accent-bg); border:1px solid var(--lr-accent-border); border-radius:8px; color:#92400e; margin-bottom:12px; }

/* ---------- Preview area ---------- */
.lr-preview{ flex:1; overflow:auto; background:#dde1e8; padding:24px; display:flex; flex-direction:column; align-items:center; gap:32px; }
.doc-block{ width:100%; max-width:794px; }
.doc-block-label{ font-size:12px; font-weight:700; color:var(--lr-text-soft); margin-bottom:8px; display:flex; align-items:center; justify-content:space-between; }

.a4-page{
  width:794px; min-height:1123px; background:#fff; margin-bottom:18px;
  padding:50px 55px 48px; box-shadow:0 4px 18px rgba(0,0,0,.12);
  font-family:'Sakal Bharati','Noto Sans Devanagari',serif; font-size:14.5px; line-height:1.75; color:#000;
  font-synthesis: weight;
  text-shadow:0 0 0.3px currentColor;
  text-rendering:optimizeLegibility;
  position:relative;
  font-synthesis: weight style;
}
/* copy protection on preview (deters casual copy-paste; PDF remains the product) */
#doc-stages, #doc-stages *{ -webkit-user-select:none; -moz-user-select:none; user-select:none; }
/* fixed A4 pages produced by the PDF paginator */
.a4-page.a4-fixed{
  width:794px; height:1123px; margin:0; box-shadow:none; overflow:hidden;
}
.a4-fixed .a4-inner{ overflow:hidden; }
.section-break{ height:1px; }
.doc-section, .doc-caseheading, .doc-refs, .final-order li, .data-table tr, .fo-list li{ page-break-inside:avoid; }

.a4-page.pg-office{ padding-top:29px; } /* 0.3in — tehsil office letterhead pages only */
.lh-logo{ height:60px; width:auto; display:block; margin:0 auto 4px; }

/* Letterhead */
.lh{ text-align:center; margin-bottom:14px; }

.lh-title{ font-weight:700; font-size:15px; }
.lh-office{ font-weight:700; font-size:13.5px; }
.lh-contact{ display:flex; justify-content:space-between; font-size:10.5px; color:#000; margin-top:2px; }
.lh-rule{ border-top:1.5px solid #333; margin:6px 0 4px; }
.lh-jakr{ display:flex; justify-content:space-between; font-size:12px; font-weight:600; }

.doc-refs{ margin:14px 0; font-size:12px; }
.doc-refs-title{ font-weight:700; margin-bottom:4px; }
.doc-refs-list{ margin:0; padding-left:20px; }
.doc-refs-list li{ margin-bottom:3px; }

.doc-caseheading{ text-align:center; margin:16px 0; }
.doc-doctitle{ font-weight:700; font-size:14px; margin-bottom:6px; }
.doc-court{ font-weight:600; margin-bottom:10px; }
.doc-parties{ text-align:left; font-size:13px; margin-bottom:8px; }
.doc-parties .vs{ text-align:center; font-weight:700; margin:4px 0; }
.pl{ font-weight:700; }
.doc-subject{ text-align:left; font-size:13px; margin-top:6px; }

.doc-section{ margin:14px 0; }
.sec-h{ font-weight:700; margin-bottom:4px; font-size:13.5px; }
.just{ text-align:justify; margin:0 0 6px; }
.note-inline{ font-size:11.5px; color:#000; background:#fffbeb; border:1px dashed #b45309; padding:6px 8px; border-radius:6px; }

.ev-list{ list-style:none; padding:0; margin:0; font-size:12.5px; }
.ev-list li{ display:flex; justify-content:space-between; padding:3px 0; border-bottom:1px dotted #888; color:#000; }
.ev-list li .tag{ font-size:10px; font-weight:700; padding:1px 8px; border-radius:10px; }
.ev-list li.yes .tag{ background:#dcfce7; color:#166534; }
.ev-list li.no .tag{ background:#fee2e2; color:#991b1b; }
.ev-list li.na .tag{ background:#e5e7eb; color:#374151; }

/* unfilled = dashed pen-fill line; filled = blue bold, no line */
.v{ padding:0 3px; display:inline-block; min-width:90px; text-align:center; border-bottom:1.2px dashed #000; }
.v.filled{ min-width:0; font-weight:700; color:#0d2757; border-bottom:none; }

.final-order{ margin-top:18px; }
.fo-title{ text-align:center; font-weight:700; font-size:12.5px; margin-bottom:10px; }
.fo-list{ padding-left:20px; }
.fo-list li{ margin-bottom:8px; text-align:justify; }

.data-table{ width:100%; border-collapse:collapse; font-size:12px; margin:10px 0; }
.data-table th, .data-table td{ border:1px solid #333; padding:5px 6px; text-align:center; }
.data-table th{ background:#f2f2f2; }

.doc-sign-block{ margin-top:56px; margin-bottom:24px; display:flex; justify-content:flex-end; }
.sign-r{ text-align:center; font-weight:700; font-size:13px; }

.copy-list{ margin-top:28px; font-size:12px; }
.copy-list ol{ padding-left:20px; margin:4px 0 0; }

.doc-addressee{ margin-bottom:14px; font-size:13px; }
.doc-addressee .indent{ padding-left:20px; }

.page-foot{ position:absolute; bottom:8px; left:55px; right:55px; z-index:2; height:12px; line-height:12px; pointer-events:none; background:transparent; font-size:11px; color:#9A9A9A; text-shadow:none; display:flex; justify-content:space-between; }

/* ---------- Wizard modal ---------- */
.wiz-modal{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:1000; }
.wiz-modal.open{ display:flex; }
.wiz-overlay{ position:absolute; inset:0; background:rgba(20,20,30,.55); backdrop-filter:blur(3px); }
.wiz-box{ position:relative; background:#fff; border-radius:16px; width:92%; max-width:460px; padding:28px 26px; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.wiz-progress{ font-size:11px; font-weight:700; color:var(--lr-primary); text-transform:uppercase; letter-spacing:.5px; margin-bottom:8px; }
.wiz-question{ font-size:18px; font-weight:700; margin-bottom:20px; line-height:1.4; }
.wiz-options{ display:flex; flex-direction:column; gap:8px; }
.wiz-opt{ padding:12px 14px; border:1.5px solid var(--lr-border); border-radius:10px; background:#fff; text-align:right; font-size:14px; font-weight:600; cursor:pointer; transition:.15s; }
.wiz-opt:hover{ border-color:var(--lr-primary); background:#f5f3ff; }
.wiz-footer{ margin-top:18px; }

/* ---------- Settings modal ---------- */
.settings-modal{ position:fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:1000; }
.settings-modal.open{ display:flex; }
.settings-box{ position:relative; background:#fff; border-radius:14px; width:92%; max-width:520px; max-height:85vh; overflow-y:auto; box-shadow:0 20px 60px rgba(0,0,0,.3); }
.settings-head{ display:flex; justify-content:space-between; align-items:center; padding:14px 18px; border-bottom:1px solid var(--lr-border); }
.settings-head h3{ margin:0; font-size:15px; }
.settings-body{ padding:16px 18px; }
.settings-note{ font-size:11px; color:var(--lr-text-soft); margin-bottom:12px; }

@media (max-width: 900px){
  .app-shell{ flex-direction:column; height:auto; }
  .lr-form{ width:100%; border-right:none; border-bottom:1px solid var(--lr-border); max-height:60vh; }
  .a4-page{ width:100%; min-height:auto; padding:24px; }
  .lh-contact{ flex-direction:column; gap:2px; }
}

/* ============================================================
   PRINT — real multipage pagination via browser print engine
   ============================================================ */
@media print{
  @page{ size:A4 portrait; margin:14mm 15mm; }
  body *{ visibility:hidden; }
  .lr-topbar, .lr-form, .wiz-modal, .settings-modal, .doc-block-label{ display:none !important; }
  .lr-preview{ padding:0; gap:0; background:#fff; overflow:visible; display:block; }
  .doc-block{ max-width:none; }
  .a4-page{ box-shadow:none; margin:0; padding:0; width:auto; }
  #doc-stages, #doc-stages *{ visibility:visible; }
  #doc-stages{ position:relative; }
  .stage-head{ display:none !important; }
  .doc-block + .doc-block .doc-flow{ page-break-before:always; }
}

/* ---------- Stage sections & plain (applicant-side) documents ---------- */
.stage-head{ display:flex; align-items:center; justify-content:space-between; width:100%; max-width:794px; margin:10px 0 4px; padding:8px 12px; background:#ede9fe; border:1px solid #ddd6fe; border-radius:10px; font-weight:700; font-size:13px; color:#4c1d95; }
.pt-wrap{ text-align:center; margin-bottom:12px; }
.pt-title{ font-weight:700; font-size:15px; text-decoration:underline; text-underline-offset:4px; }
.pt-sub{ font-size:11.5px; color:#000; margin-top:2px; }
.ns-table td, .ns-table th{ font-size:11px; padding:4px 5px; }
.ns-table td:nth-child(2){ text-align:left; }
.ns-signs{ display:flex; justify-content:space-between; margin-top:34px; font-weight:700; font-size:12.5px; }

/* ---------- phase grouping in form + validation warning ---------- */
.form-phase{ font-size:11px; font-weight:800; letter-spacing:.5px; color:#5b21b6; background:#ede9fe; border:1px solid #ddd6fe; border-radius:8px; padding:6px 10px; margin:4px 0 2px; }
.lr-warning{ font-size:12px; padding:9px 11px; background:#fee2e2; border:1.5px solid #ef4444; border-radius:8px; color:#991b1b; font-weight:600; }
.doc-warning-box{ max-width:794px; width:100%; background:#fff7ed; border:1.5px solid #f97316; color:#9a3412; padding:20px; border-radius:12px; font-size:14px; font-weight:600; }

/* ---------- watermark (preview/print deterrent; stripped from paid PDF pages by paginator if desired) ---------- */
.wm-layer{
  position:absolute; inset:0; pointer-events:none; z-index:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='200'%3E%3Ctext x='30' y='110' font-size='26' font-family='Arial' fill='rgba(100,100,100,0.10)' transform='rotate(-25 150 100)'%3Epctool.in%3C/text%3E%3C/svg%3E");
  background-repeat:repeat;
}
.a4-page{ isolation:isolate; } /* self-contained stacking; watermark can never escape the page or cover site UI */
.doc-promo{
  position:absolute; bottom:8px; left:55px; right:55px; z-index:2;
  height:12px; line-height:12px; pointer-events:none;
  font-size:11px; color:#9A9A9A; text-align:center; letter-spacing:.2px;
  text-shadow:none; background:transparent;
}
.a4-fixed .doc-promo{ display:none; } /* paginator draws its own footer with promo + page no. */
.pf-promo{ font-weight:600; }

/* signature zone: comfortable fixed gap below content (not glued to page bottom) */
.sign-push{ margin-top:56px; }
.gap{ display:inline-block; width:22px; }
.vgap{ display:block; height:20px; }
.data-table td{ height:26px; }

/* ---------- roomy variant: sparse pages get larger type, wider lines, big sign areas ---------- */
.pg-roomy{ font-size:16px; line-height:2.0; }
.pg-roomy .pt-title{ font-size:17px; }
.pg-roomy .pt-wrap{ margin-bottom:28px; }
.pg-roomy .doc-section p{ margin:16px 0; }
.pg-roomy .v{ padding:0 6px; }
.pg-roomy .sign-push{ margin-top:140px; }
.pg-roomy .sign-r{ min-height:120px; }
.pg-roomy .data-table td{ height:38px; }
/* noting sheet officer signature cells */
.ns-signs{ gap:14px; }
.ns-sign{ flex:1; text-align:center; font-weight:700; font-size:12.5px; }
.ns-line{ border-bottom:1.2px dashed #000; margin-bottom:6px; }

/* ============================================================
   SITE-THEME OVERRIDE GUARD
   The live site's global stylesheet (header.php) contains direct
   element rules like  p { color:#4b5563; font-weight:400 }  which
   BEAT values inherited from .a4-page. These direct, scoped,
   !important rules guarantee document text renders black + bold
   regardless of any theme CSS loaded before or after this file.
   ============================================================ */
.a4-page :is(p, div, span, li, td, ol, ul, i){
  color:#000 !important;
  font-weight:400 !important;
  font-family:'Sakal Bharati','Noto Sans Devanagari',serif !important;
  text-shadow:0 0 .3px currentColor;
}
/* bold ONLY for headings, labels, emphasized content */
.a4-page :is(b, strong, th, .pt-title, .sec-h, .pl, .lh-title, .lh-office,
  .doc-doctitle, .doc-court, .fo-title, .vs, .v.filled, .sign-r, .sign-r div,
  .doc-sign-block div, .sign-push > div, .sign-push > div > div,
  .ns-sign div, .doc-subject .pl, .doc-refs-title){
  color:#000 !important;
  font-weight:700 !important;
  font-family:'Sakal Bharati','Noto Sans Devanagari',serif !important;
  text-shadow:0 0 .3px currentColor;
}
/* exceptions re-asserted AFTER the guard */
.a4-page .v.filled{ color:#0d2757 !important; }
.a4-page .ev-list li.yes .tag{ color:#166534 !important; font-weight:700 !important; }
.a4-page .ev-list li.no .tag{ color:#991b1b !important; }
.a4-page .ev-list li.na .tag{ color:#374151 !important; }
.a4-page .doc-promo, .a4-page .page-foot, .a4-page .page-foot span{
  color:#9A9A9A !important; font-weight:400 !important; text-shadow:none !important;
}
.a4-page .wm-layer{ text-shadow:none; }

/* ---------- handwriting-friendly sizing (per operator field review) ---------- */
.a4-page .v{ min-height:20px; }
.v-block{ display:block; border-bottom:1.2px dashed #000; height:28px; margin:8px 0 2px; }
.data-table.tall-rows td{ height:46px !important; }         /* panchnama witnesses, family, applicant tables */
.doc-sign-block.sig-xl{ margin-top:95px; }
.doc-sign-block.sig-xl .sign-r{ min-height:160px; }
.sign-push.sig-xl .sign-r{ min-height:160px; }
.pg-roomy .sign-r{ min-height:150px; }                       /* ≈38mm: signature + seal room on sparse pages */
.ns-line{ height:140px; }                                    /* officer sign+stamp ≈37mm each */
.sign-push.sig-md .sign-r{ min-height:130px; }

.ev-list .tag.tick{ background:#f3f4f6; color:#000 !important; border:1px dashed #666; font-weight:400 !important; }
.locked-field{ background:#f3f4f6 !important; color:#6b7280 !important; cursor:not-allowed; }

/* ---------- compact noting page: 17-point table + officer sign strip fit ONE page ---------- */
.pg-compact{ font-size:calc(13.5px * var(--fit, 1)); line-height:1.6; }
.pg-compact .lh-logo{ height:44px; }
.pg-compact .doc-section{ margin-bottom:6px; }
.pg-compact .doc-section p{ margin:6px 0; }
.pg-compact .doc-subject{ margin:6px 0; }
.pg-compact .ns-table th{ padding:calc(4px * var(--fit, 1)) 6px; font-size:calc(11.5px * var(--fit, 1)); line-height:1.4; }
.pg-compact .ns-table td{ padding:calc(3px * var(--fit, 1)) 6px !important; font-size:calc(11.5px * var(--fit, 1)); line-height:1.4; height:auto !important; }
.pg-compact .lh{ margin-bottom:6px; }
.pg-compact .lh-rule{ margin:4px 0; }
.pg-compact .ns-signs.sign-push{ margin-top:10px; }
.pg-compact .ns-line{ height:140px; }  /* full 37mm officer sign+seal space preserved */