/*
 * RBI Foreign Currency Settlement Workbench
 * Design Language: Government of India Official Standard
 * Per: Central Secretariat Manual of Office Procedure (CSMOP)
 *      National Informatics Centre (NIC) Web Portal Guidelines
 *      Ministry of Electronics and IT (MeitY) UI Standards
 * Palette: GoI Navy #003366 | National Saffron #FF9933 | India Green #138808
 * Typography: Times New Roman (documents) | Segoe UI / system-ui (UI shell)
 * Updated: 3 April 2026
 */

/* ── 1. CSS Custom Properties ─────────────────────────────────────────────── */
:root {
  /* National Identity */
  --goi-saffron:     #FF9933;
  --goi-white:       #FFFFFF;
  --goi-green:       #138808;
  --goi-navy:        #003366;
  --goi-dark-navy:   #001F54;
  --goi-gold:        #B8860B;
  --goi-gold-light:  #D4AF37;

  /* App Shell */
  --app-bg:          #EEF1F5;
  --app-panel:       #FFFFFF;
  --app-border:      #C8D0DC;
  --app-text:        #1A2332;
  --app-text-muted:  #526070;
  --app-accent:      #003366;
  --app-btn-hover:   #004380;

  /* Document Theme Defaults (overridden by JS per authority) */
  --gov-accent:      #003366;
  --gov-accent-soft: rgba(0, 51, 102, 0.08);
  --gov-panel:       #F2F6FB;
  --gov-border:      #B8C4D0;
  --gov-note:        #003366;
  --doc-watermark-opacity: 0.06;

  /* Typography */
  --doc-font: "Times New Roman", "Georgia", "Noto Serif", serif;
  --ui-font:  "Segoe UI", "Noto Sans", system-ui, -apple-system, sans-serif;
}

/* ── 2. Reset ─────────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

/* ── 3. Base ──────────────────────────────────────────────────────────────── */
body {
  margin: 0;
  font-family: var(--ui-font);
  background: var(--app-bg);
  color: var(--app-text);
  font-size: 14px;
  line-height: 1.55;
}

/* ── 4. GoI Flag-Stripe (top of every page) ──────────────────────────────── */
body::before {
  content: "";
  display: block;
  width: 100%;
  height: 7px;
  background: linear-gradient(
    to right,
    var(--goi-saffron) 0% 33.33%,
    #FFFFFF            33.33% 66.67%,
    var(--goi-green)   66.67% 100%
  );
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── 5. App Hero / Portal Header ─────────────────────────────────────────── */
.hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 18px 30px;
  background: linear-gradient(140deg,
    var(--goi-dark-navy, #001F54) 0%,
    var(--goi-navy, #003366) 65%,
    #004A8B 100%);
  color: #FFFFFF;
  border-bottom: 3px solid var(--goi-gold, #B8860B);
  position: relative;
}

/* Saffron bar below gold stripe */
.hero::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--goi-saffron);
}

.hero-emblem {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-emblem-svg {
  width: 54px;
  height: 66px;
  flex-shrink: 0;
  filter: brightness(0) invert(1) opacity(0.88);
}

.hero-title-block {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.60);
}

.hero h1 {
  margin: 0 0 4px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #FFFFFF;
  line-height: 1.25;
}

.hero-gov-line {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--goi-gold-light, #D4AF37);
  font-weight: 600;
}

.subtitle {
  margin: 0;
  max-width: 680px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
}

.signing-api-live-badge {
  align-self: center;
  padding: 5px 13px;
  border-radius: 3px;
  font-size: 11.5px;
  font-weight: 600;
  border: 1px solid transparent;
  letter-spacing: 0.04em;
}
.signing-api-live-badge.online  { color: #BBFFCC; background: rgba(15,100,40,0.45); border-color: rgba(80,220,120,0.5); }
.signing-api-live-badge.offline { color: #FFCCCC; background: rgba(90,15,15,0.48); border-color: rgba(220,80,80,0.5); }

.hero-actions     { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.preview-actions,
.actions          { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.preview-actions .pack-profile-control { min-width: 180px; max-width: 240px; }
.preview-actions .pack-profile-control select { width: 100%; }

/* ── 6. Layout Grid ───────────────────────────────────────────────────────── */
.layout {
  display: grid;
  grid-template-columns: minmax(340px, 490px) minmax(500px, 1fr);
  gap: 20px;
  padding: 22px 24px;
}

/* ── 7. Panel ─────────────────────────────────────────────────────────────── */
.panel {
  background: var(--app-panel, #FFFFFF);
  border: 1px solid var(--app-border, #C8D0DC);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 30, 80, 0.07);
  padding: 20px;
}

.panel h2 {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--goi-navy, #003366);
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--goi-saffron, #FF9933);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── 8. Accordion / Details ───────────────────────────────────────────────── */
details {
  border: 1px solid #C5CBD8;
  border-radius: 5px;
  padding: 11px 14px;
  background: #FAFBFD;
  margin-bottom: 14px;
}

summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 12.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--goi-navy, #003366);
}

/* ── 9. Grid Helpers ──────────────────────────────────────────────────────── */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.grid          { display: grid; gap: 12px; margin-top: 12px; }
.two-up        { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.auto-fit-grid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.auto-fit-grid .full-width,
.two-up .full-width { grid-column: 1 / -1; }

/* ── 10. Form Controls (App UI) ───────────────────────────────────────────── */
label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 13px;
  color: var(--app-text);
  font-weight: 500;
}
input, textarea, select, button { font: inherit; }
input, textarea, select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 4px;
  border: 1px solid #B2BCC8;
  background: #FFFFFF;
  color: #1A2332;
  font-size: 13.5px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--goi-navy, #003366);
  box-shadow: 0 0 0 2px rgba(0, 51, 102, 0.14);
}
button {
  border: none;
  border-radius: 4px;
  padding: 10px 20px;
  background: var(--goi-navy, #003366);
  color: #FFFFFF;
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: background 0.13s;
}
button:hover:not(:disabled) { background: var(--app-btn-hover, #004380); }
button.secondary {
  background: #EDF1F7;
  color: var(--goi-navy, #003366);
  border: 1px solid #B2BCC8;
}
button.secondary:hover:not(:disabled) { background: #DDEAF4; }
button:disabled { opacity: 0.50; cursor: not-allowed; }

/* ── 11. Pack / Preview / Compliance Controls ─────────────────────────────── */
.pack-profile-control { min-width: 220px; max-width: 280px; }
.pack-profile-hint    { margin: 8px 0 0; font-size: 12px; color: var(--app-text-muted); line-height: 1.5; }

.preview-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.preview {
  min-height: 760px;
  border: 1px solid #C0CAD6;
  border-radius: 5px;
  background: #E8EAEE;
  padding: 20px;
  overflow: auto;
}
.preview.empty-state {
  display: grid;
  place-items: center;
  color: #6A7A8A;
}

.pack-preview-section  { margin: 0; }
.pack-preview-divider  { margin: 16px 0 22px; border-top: 2px dashed #B0BCC8; text-align: center; }
.pack-preview-divider span {
  display: inline-block;
  margin-top: -12px;
  background: #E8EAEE;
  color: #5A6A7A;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 10px;
}

.compliance-banner { margin: 8px 0 0; padding: 7px 12px; border-radius: 4px; font-size: 12px; line-height: 1.4; border: 1px solid transparent; }
.compliance-banner.pass { background: #EBF6EE; border-color: #78C492; color: #165A2A; }
.compliance-banner.fail { background: #FFF0F0; border-color: #CC9090; color: #841A1A; }

/* ── 12. Signing Panel ────────────────────────────────────────────────────── */
.signing-settings { margin-top: 10px; border: 1px solid #C0CAD6; border-radius: 5px; background: #FAFBFD; }
.signing-settings > summary { font-size: 13px; }
.signing-settings-grid { margin-top: 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.signing-checkbox { display: flex; flex-direction: row; align-items: center; gap: 8px; font-size: 12.5px; }
.signing-checkbox input[type="checkbox"] { width: auto; }
.signing-settings-actions { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.signing-trust-help { margin: 10px 0 0; font-size: 11.5px; line-height: 1.45; color: #4A5C70; }
.signing-settings-status { margin: 10px 0 0; font-size: 12px; color: var(--app-text-muted); }
.signing-profile-overrides { margin-top: 12px; border-top: 1px solid #D8E0E8; padding-top: 10px; }
.signing-profile-overrides-title { margin: 0 0 8px; font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--app-text-muted); }
.signing-profile-override-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.signing-profile-override-row { display: grid; grid-template-columns: 1fr; gap: 4px; }
.signing-profile-override-row label { font-size: 12px; color: #3C4C5C; }

/* ── 13. Extra / Hidden Helpers ───────────────────────────────────────────── */
.extra-fields-panel { display: none; padding-top: 14px; border-top: 1px solid #D8E0E8; margin-top: 14px; }
.uppercase-input    { text-transform: uppercase; }
.hidden-control     { display: none !important; }

/* ── 14. Official Document Base ───────────────────────────────────────────── */
.official-document {
  font-family: var(--doc-font);
  color: #0C1A26;
  line-height: 1.65;
  max-width: 860px;
  margin: 0 auto;
  font-size: 11.5pt;
}
.official-document h1 { display: none; }
.official-document h2 {
  margin: 18px 0 10px;
  font-size: 12.5pt;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-family: var(--doc-font);
  border-bottom: 1px solid var(--gov-border, #B8C4D0);
  padding-bottom: 4px;
}
.meta-list { padding-left: 20px; }

/* Tables */
.official-document table { width: 100%; border-collapse: collapse; margin-top: 12px; table-layout: fixed; }
.official-document th,
.official-document td   { border: 1px solid #8A9AAA; padding: 7px 9px; vertical-align: top; }
.official-document th   { width: 34%; text-align: left; font-weight: 700; background: #EDF1F8; }
.official-document td   { text-align: left; }
.official-document p,
.official-document li   { text-align: justify; }
.official-document p    { margin: 0 0 10px; }

/* Letter anatomy */
.official-document .letter-opening       { margin: 2px 0 18px; }
.official-document .letter-opening-top   { display: grid; grid-template-columns: 1fr auto; align-items: start; gap: 8px 12px; margin-bottom: 10px; }
.official-document .letter-ref,
.official-document .letter-date          { margin: 0; text-align: left; }
.official-document .letter-date          { text-align: right; white-space: nowrap; }
.official-document .letter-addressee,
.official-document .letter-salutation,
.official-document .letter-subject       { text-align: left; }
.official-document .letter-addressee     { margin: 2px 0 12px; line-height: 1.5; }
.official-document .letter-salutation    { margin: 0 0 14px; }
.official-document .letter-subject       { margin: 4px 0 14px; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.official-document .letter-original-block { display: none; }
.official-document .letter-narrative     { position: relative; padding-left: 30px; text-align: justify; }
.official-document .letter-narrative::before { content: attr(data-para-no); position: absolute; left: 0; top: 0; width: 26px; text-align: left; font-weight: 700; }

/* Signature space */
.signature-space { margin-top: 24px; border-top: 1px solid #A8B4C0; padding-top: 12px; width: min(100%, 340px); margin-left: auto; text-align: left; }
.signature-space p { margin: 0 0 5px; text-align: left; }

/* ── 15. GoI Standard Document Envelope ──────────────────────────────────── */
.gov-standard-doc {
  position: relative;
  border: 1px solid var(--gov-border, #B8C4D0);
  border-top: none;
  border-radius: 4px;
  background: #FFFFFF;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 30, 80, 0.09);
}

/* National flag stripe */
.gov-standard-doc::before {
  content: "";
  display: block;
  height: 7px;
  background: linear-gradient(
    to right,
    var(--goi-saffron, #FF9933) 0% 33.33%,
    #FFFFFF                    33.33% 66.67%,
    var(--goi-green, #138808)  66.67% 100%
  );
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 4;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Authority-accent bar immediately below flag stripe */
.gov-standard-doc::after {
  content: "";
  display: block;
  height: 4px;
  background: var(--gov-accent, #003366);
  position: absolute;
  top: 7px; left: 0; right: 0;
  z-index: 4;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.gov-standard-doc-inner {
  position: relative;
  z-index: 1;
  padding-bottom: 28px;
  padding-top: 11px; /* clear the 7px flag + 4px navy stripes */
}

/* Body padding */
.gov-standard-doc-inner > .official-document,
.gov-standard-doc-inner > .gov-digital-signature {
  padding-left: 28px;
  padding-right: 28px;
  margin-top: 18px;
}

/* ── 16. GoI Document Classification Strip ────────────────────────────────── */
.gov-classification-strip {
  text-align: center;
  padding: 3px 0;
  font-size: 9pt;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  font-family: var(--ui-font);
  position: relative;
  z-index: 5;
  margin-top: 11px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.gov-classification-strip.official     { background: var(--gov-accent, #003366); color: #FFFFFF; }
.gov-classification-strip.confidential { background: #8B1A1A; color: #FFFFFF; }
.gov-classification-strip.restricted   { background: #7A5A00; color: #FFFFFF; }

/* ── 17. Document Watermark ───────────────────────────────────────────────── */
.gov-brand-watermark {
  position: absolute;
  left: 50%;
  top: 54%;
  transform: translate(-50%, -50%);
  width: 62%;
  height: 60%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 0;
}
/* Let the watermark asset wrapper fill the full overlay area. */
.gov-brand-watermark .gov-rbi-asset-wrap {
  width: 100%;
  height: 100%;
}
.gov-brand-watermark .gov-rbi-brand,
.gov-brand-watermark .gov-rbi-brand-image {
  width: 100%;
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  height: auto;
  opacity: var(--doc-watermark-opacity, 0.06);
  margin: auto;
  object-fit: contain;
}
/* Fallback SVG inside watermark should also fill the overlay. */
.gov-brand-watermark .gov-rbi-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 18. GoI Letterhead ───────────────────────────────────────────────────── */
.gov-letterhead {
  background: #FFFFFF;
  position: relative;
  z-index: 2;
}

/* Inner padding + double rule at bottom */
.gov-letterhead-inner {
  padding: 15px 24px 0;
  border-bottom: 3px double var(--gov-accent, #003366);
}

.gov-letterhead-top {
  display: grid;
  grid-template-columns: 172px 1fr 118px;
  align-items: center;
  gap: 14px;
  padding-bottom: 12px;
}

/* ── Left column: State Emblem + authority logo side by side ── */
.gov-brand-wrap {
  width: 172px;
  min-width: 172px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  background: transparent;
  padding: 0;
  height: auto;
}

/* State Emblem (Ashoka Lions — primary, always shown) */
.gov-state-emblem {
  width: 96px;
  height: 96px;
  display: block;
}

/* Authority logo (secondary, smaller, below emblem) */
.gov-rbi-asset-wrap {
  width: 60px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gov-rbi-brand,
.gov-rbi-brand-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: auto;
}
.gov-rbi-fallback { width: 100%; height: 100%; display: block; }

/* ── Center heading column ── */
.gov-heading-text {
  flex: 1;
  text-align: center;
  line-height: 1.3;
}

/* Department logo — top center, fully visible */
.gov-header-dept-logo {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 6px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.gov-header-dept-logo .gov-rbi-asset-wrap {
  width: auto;
  height: auto;
}
.gov-header-dept-logo .gov-rbi-brand,
.gov-header-dept-logo .gov-rbi-brand-image {
  max-height: 54px;
  width: auto;
  object-fit: contain;
}
.gov-line-hi {
  margin: 0 0 1px;
  font-size: 15pt;
  font-weight: 700;
  color: #0C1A26;
  font-family: "Noto Sans Devanagari", "Mangal", "Devanagari MT", "Lohit Devanagari", serif;
  letter-spacing: 0.05em;
}
.gov-line-en {
  margin: 0 0 4px;
  font-size: 11pt;
  font-weight: 700;
  color: #0C1A26;
  letter-spacing: 0.12em;
  font-family: var(--ui-font);
  text-transform: uppercase;
}
.gov-brand-line {
  margin: 3px 0 2px;
  font-size: 11pt;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gov-accent, #003366);
  font-family: var(--ui-font);
}
.gov-dept {
  margin: 1px 0;
  font-size: 9pt;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #2A3A4C;
  font-weight: 600;
  font-family: var(--ui-font);
}
.gov-doc-class {
  margin: 5px 0 2px;
  font-size: 8.5pt;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #FFFFFF;
  font-weight: 700;
  font-family: var(--ui-font);
  background: var(--gov-accent, #003366);
  display: inline-block;
  padding: 2px 12px;
  border-radius: 2px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.gov-doc-kind {
  margin: 2px 0;
  font-size: 9.5pt;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #3A4A5A;
  font-family: var(--ui-font);
}
.gov-ministry-address {
  font-size: 8pt;
  color: var(--gov-accent, #003366);
  margin: 4px 0 0;
  font-style: italic;
  letter-spacing: 0.01em;
  font-family: var(--ui-font);
}
.gov-ministry-contact {
  font-size: 7.5pt;
  color: #486070;
  margin: 0 0 2px;
  font-family: var(--ui-font);
}

/* ── Right column: QR or mirror ── */
.gov-brand-mirror {
  width: 118px;
  min-width: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.gov-qr-code-marker  { display: flex; align-items: center; justify-content: center; }
.gov-qr-code-image {
  width: 102px;
  height: 102px;
  max-width: 100%;
  border: 1px solid var(--gov-border, #B8C4D0);
  border-radius: 4px;
  background: #FFFFFF;
  padding: 3px;
  object-fit: contain;
}
.gov-doc-class-marker { display: none; }
.gov-doc-class-badge  { display: none; height: 100%; }
.gov-bank-mark        { display: block; width: 100%; height: 100%; }

/* ── Meta Strip ── */
.gov-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px 8px;
  padding: 7px 4px 9px;
  font-size: 10pt;
  border-top: 1px solid var(--gov-border, #B8C4D0);
  margin-top: 6px;
}
.gov-meta-strip > div { padding: 2px 4px; }

/* ── 19. Document Section Headers (Forms / Orders) ────────────────────────── */
.gov-section-header {
  background: var(--gov-accent, #003366);
  color: #FFFFFF;
  padding: 5px 10px;
  font-size: 9.5pt;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 16px 0 0;
  border-radius: 2px 2px 0 0;
  font-family: var(--ui-font);
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.gov-section-body {
  border: 1px solid var(--gov-border, #B8C4D0);
  border-top: none;
  padding: 10px 12px;
  margin-bottom: 12px;
  border-radius: 0 0 2px 2px;
}

/* Form-field grid within document */
.gov-form-grid     { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; }
.gov-field-group   { display: flex; flex-direction: column; gap: 2px; }
.gov-field-label   { font-size: 8.5pt; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #4A5A6A; font-family: var(--ui-font); }
.gov-field-value   { border-bottom: 1px solid #A8B8C8; padding: 2px 0; font-size: 10.5pt; min-height: 22px; font-family: var(--doc-font); }

/* ── 20. GoI Closing Formula & Digital Signature ──────────────────────────── */
.gov-digital-signature {
  margin-top: 20px;
  border-top: 1px dashed #7A8A9A;
  padding-top: 12px;
  font-size: 10.5pt;
  font-family: var(--doc-font);
}
.gov-digital-signature p { margin: 4px 0; }

/* "Yours faithfully" / "By order" closing block */
.gov-letter-closing {
  margin: 22px 0 8px;
  padding-top: 12px;
  border-top: 1px solid var(--gov-border, #B8C4D0);
}
.gov-yours-faithfully,
.gov-by-order {
  font-size: 10.5pt;
  font-style: italic;
  margin: 0 0 4px;
  color: #1A1A1A;
  font-family: var(--doc-font);
}
.gov-sd-line {
  font-size: 10pt;
  color: #2A2A2A;
  margin: 0;
  font-style: normal;
  letter-spacing: 0.04em;
  font-family: var(--doc-font);
}
.gov-goi-date { font-weight: 600; font-family: var(--doc-font); }
.gov-encl     { font-size: 9.5pt; color: #3A4A5A; margin-top: 12px; font-family: var(--doc-font); }

/* ── 21. Signature Verification Panel ────────────────────────────────────── */
.gov-sign-verify-row { display: flex; justify-content: flex-end; align-items: flex-start; gap: 10px; margin-top: 8px; }
.gov-sign-verify-row.with-qr .gov-sign-verification { flex: 0 0 min(44%, 380px); margin: 0; }
.gov-sign-verification {
  border: 1px solid #A8B4C0;
  border-radius: 4px;
  position: relative;
  padding: 8px 10px;
  background: #F4F6FA;
  overflow: hidden;
  width: min(44%, 380px);
  margin-left: auto;
}
.gov-sign-verification-watermark {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-size: 74px;
  line-height: 1;
  font-weight: 900;
  color: rgba(255, 210, 80, 0.55);
  pointer-events: none;
  -webkit-user-select: none;
  user-select: none;
  z-index: 1;
}
.gov-sign-verification-content { min-width: 0; position: relative; z-index: 2; }
.gov-sign-verification-title   { margin: 0; font-weight: 700; font-size: 11pt; }
.gov-sign-verification-line    { margin: 3px 0 0; font-size: 9.5pt; color: #3A4A5A; line-height: 1.35; }

.gov-sign-verification.unverified                              { border-color: #B0BCC8; background: #F2F4F8; }
.gov-sign-verification.unverified .gov-sign-verification-watermark { color: #D4A017; font-size: 88px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.gov-sign-verification.unverified .gov-sign-verification-title { color: #2A3A4A; }
.gov-sign-verification.verified                                { border-color: #78C492; background: #EAF5EE; }
.gov-sign-verification.verified .gov-sign-verification-watermark { color: rgba(20, 100, 50, 0.40); font-size: 88px; }
.gov-sign-verification.verified .gov-sign-verification-title  { color: #0E4E22; font-size: 13pt; }
.gov-sign-dept-header {
  margin: 0 0 3px;
  font-size: 9pt;
  font-weight: 600;
  color: #1A3A5C;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .gov-sign-verification        { width: min(92%, 380px); }
  .gov-sign-verify-row          { justify-content: center; flex-wrap: wrap; }
  .gov-sign-verify-row.with-qr .gov-sign-verification { flex: 1 1 auto; }
}

/* ── 22. Portal URL, Regulatory Strip, Sign Note ──────────────────────────── */
.gov-portal-url { word-break: break-all; color: var(--gov-accent, #003366); }

.gov-regulatory-strip {
  margin-top: 10px;
  background: var(--gov-panel, #EEF2F8);
  border: 1px solid var(--gov-border, #B8C4D0);
  border-left: 4px solid var(--gov-accent, #003366);
  padding: 8px 12px;
}
.gov-regulatory-strip p { margin: 0 0 6px; font-size: 10pt; font-weight: 600; }
.gov-reg-list           { margin: 0; padding-left: 20px; font-size: 9.5pt; }
.gov-reg-list li        { margin: 3px 0; }

.gov-sign-note {
  font-size: 8.5pt;
  font-style: normal;
  color: #3A4A5A;
  text-align: justify;
  background: #F0F3F8;
  border: 1px solid #B2BCC8;
  border-left: 4px solid var(--gov-note, #003366);
  padding: 7px 10px;
  margin-top: 8px;
  line-height: 1.5;
  font-family: var(--ui-font);
}

/* ── 23. Barcode / QR / Certification ────────────────────────────────────── */
.gov-footer-barcode     { width: 100%; margin: 12px 0 6px; padding: 6px 0; border-top: 1px dashed var(--gov-border, #B8C4D0); border-bottom: 1px dashed var(--gov-border, #B8C4D0); }
.gov-footer-barcode-image { width: 100%; height: 68px; display: block; object-fit: fill; background: #fff; }
.gov-footer-barcode-text  { margin: 5px 0 0; font-size: 7.5px; line-height: 1.2; color: #3A4A5A; word-break: break-word; font-family: var(--ui-font); }

.gov-owner-row       { display: inline-flex; align-items: center; gap: 8px; }
.gov-owner-qr-inline { display: inline-flex; width: 44px; height: 44px; border: 1px solid var(--gov-border, #B8C4D0); border-radius: 3px; padding: 2px; background: #fff; }
.gov-owner-qr-image  { width: 100%; height: 100%; object-fit: contain; }

.gov-cert-qr-right  { width: 158px; margin: 8px 0 8px auto; text-align: center; }
.gov-cert-qr-image  { width: 100%; height: auto; border: 1px solid var(--gov-border, #B8C4D0); border-radius: 3px; padding: 4px; background: #fff; }
.gov-cert-qr-caption { margin: 4px 0 0; font-size: 8px; color: #3A4A5A; font-family: var(--ui-font); }

/* ── 24. Form Helpers (in-document) ──────────────────────────────────────── */
.req         { color: #8B1A1A; font-size: 12px; font-weight: 700; }
.hint-inline { font-size: 11px; color: var(--app-text-muted); font-weight: normal; }
.hint        { font-size: 12px; color: var(--app-text-muted); margin: 5px 0 0; line-height: 1.4; }

.badge      { display: inline-block; padding: 1px 7px; border-radius: 3px; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; font-weight: 600; vertical-align: middle; }
.badge.auto { background: #E4F0E4; color: #1A521A; }

.currency-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; width: 100%; }
.currency-row input[type="number"] { flex: 1 1 220px; min-width: 160px; min-height: 44px; font-size: 15px; }
.currency-row select { flex: 0 1 200px; width: min(100%, 200px); min-height: 44px; }

.inline-btn                       { flex: 0 0 auto; border-radius: 4px; padding: 8px 14px; font-size: 13px; background: #145A2E; color: #fff; border: none; cursor: pointer; white-space: nowrap; }
.inline-btn:hover:not(:disabled)  { background: #0F4422; }
.inline-btn:disabled              { opacity: 0.6; cursor: not-allowed; }

/* ── 25. Photo / File Upload ─────────────────────────────────────────────── */
.photo-upload-grid      { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
.single-photo           { grid-template-columns: minmax(220px, 400px); }
.bank-proof-upload-grid { margin-top: 14px; grid-template-columns: 1fr; }
.id-documents-block     { margin-top: 12px; border: 1px solid #D0D8E4; border-radius: 5px; padding: 12px; background: #FAFBFD; }
.id-doc-grid            { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.required-doc           { border-color: #B8C4D0; background: #F6F8FC; }

.photo-upload-block { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px dashed #A8B4C0; border-radius: 5px; background: #fff; }
.upload-label       { margin: 0; font-size: 13px; font-weight: 600; }
.file-input-hidden  { display: none; }
.file-input-label   { display: inline-block; padding: 7px 16px; border-radius: 4px; background: #EDF1F7; color: var(--goi-navy, #003366); font-size: 13px; cursor: pointer; text-align: center; font-weight: 600; border: 1px solid #B2BCC8; }
.file-input-label:hover { background: #DDE4EE; }

.photo-preview { min-height: 80px; border-radius: 4px; background: #EEF1F5; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #5A6A7A; overflow: hidden; padding: 4px; text-align: center; }
.preview-status         { margin-top: 4px; font-size: 12px; font-weight: 600; }
.preview-status.success { color: #0E4E22; }
.preview-status.info    { color: #3C4C60; }
.preview-status.error   { color: #841A1A; }

/* ── 26. Declarations Panel ──────────────────────────────────────────────── */
.declarations {
  background: #F4F8FD;
  border: 1px solid #B8C4D0;
  border-left: 4px solid var(--goi-navy, #003366);
  border-radius: 4px;
  padding: 12px 16px;
  margin-bottom: 14px;
  font-size: 12.5px;
  line-height: 1.6;
}
.declarations ol { margin: 6px 0 0; padding-left: 22px; }

/* ── 27. Document Images / Evidence Stamps ────────────────────────────────── */
.applicant-photo  { width: 120px; height: 150px; object-fit: cover; border: 1px solid #B8C4D0; display: block; margin-bottom: 8px; }
.photo-id-img,
.bank-proof-img   { max-width: 320px; max-height: 200px; border: 1px solid #B8C4D0; display: block; margin-bottom: 8px; }
.evidence-stamp-wrap   { position: relative; display: inline-block; }
.evidence-rubber-stamp { position: absolute; left: 50%; top: 50%; color: #0E124D; padding: 0; font-size: 18px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; transform: translate(-50%, -50%) rotate(-14deg); line-height: 1.1; opacity: 1; pointer-events: none; }

/* ── 28. Pack Page Break ─────────────────────────────────────────────────── */
.pack-page-break { page-break-after: always; break-after: page; height: 0; }

/* ── 29. Responsive (≤ 1100px) ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .layout         { grid-template-columns: 1fr; }
  .two-up         { grid-template-columns: 1fr; }
  .hero, .preview-header { flex-direction: column; }
  .hero-emblem { gap: 10px; }
  .hero-emblem-svg { width: 44px; height: 54px; }
  .gov-letterhead-top { grid-template-columns: 130px 1fr 100px; }
  .gov-brand-wrap     { width: 130px; min-width: 130px; }
  .gov-state-emblem   { width: 76px; height: 76px; }
  .gov-rbi-asset-wrap { width: 50px; height: 38px; }
  .gov-brand-mirror   { width: 100px; min-width: 100px; }
  .gov-meta-strip     { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .photo-upload-grid  { grid-template-columns: 1fr; }
  .currency-row > *   { width: 100%; }
}

/* ── 30. Print / PDF — Legal Paper (8.5×14 in) ────────────────────────────
   Margins: 18mm all sides — maximises usable print area on legal paper
   ─────────────────────────────────────────────────────────────────────────── */
@media print {
  @page {
    size: 8.5in 14in portrait;
    margin: 18mm 18mm 18mm 18mm;
  }

  html, body {
    margin: 0;
    padding: 0;
    background: #fff;
    font-size: 11pt;
    width: 100%;
  }
  body::before { display: none; }

  .panel,
  .hero,
  .actions,
  .preview-actions,
  .compliance-banner,
  .signing-settings,
  .signing-settings-actions,
  .preview-header,
  #previewMeta { display: none !important; }

  /* Remove preview wrapper styling so content fills the page */
  .preview {
    padding: 0 !important;
    border: none !important;
    background: #fff !important;
    box-shadow: none !important;
    margin: 0 !important;
    width: 100% !important;
    overflow: visible !important;
  }

  /* Stretch document to full page width */
  .official-document,
  .gov-standard-doc,
  .gov-letter-body {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 6mm !important;
    padding-right: 6mm !important;
    box-sizing: border-box !important;
  }

  /* Each pack section fills full width and starts on a fresh page */
  .pack-preview-section {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  .pack-preview-section + .pack-preview-section {
    break-before: page;
    page-break-before: always;
  }

  /* Tables fill full width */
  table { width: 100% !important; table-layout: fixed !important; }

  /* Hide the "Next Document" separator — page break handles separation */
  .pack-preview-divider { display: none !important; }

  @supports (orphans: 3) {
    .official-document p { orphans: 3; widows: 3; }
  }
  .gov-letter-closing,
  .signature-space,
  .gov-digital-signature  { break-inside: avoid; page-break-inside: avoid; }

  .gov-brand-watermark { top: 56%; width: 58%; height: 55%; }
  .print-shell-body .gov-brand-watermark { display: none !important; }
  .print-page-watermark {
    display: flex         !important;
    position: fixed       !important;
    left: 50%             !important;
    top: 56%              !important;
    transform: translate(-50%, -50%) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust:         exact;
  }
  .evidence-rubber-stamp,
  .gov-standard-doc::before,
  .gov-standard-doc::after,
  .gov-doc-class,
  .gov-section-header,
  .gov-classification-strip,
  .gov-sign-verification.unverified .gov-sign-verification-watermark,
  .gov-sign-verification.verified .gov-sign-verification-watermark {
    -webkit-print-color-adjust: exact;
    print-color-adjust:         exact;
  }
  .gov-sign-verification.unverified .gov-sign-verification-watermark {
    color: #D4A017 !important;
    opacity: 1 !important;
  }
  .gov-sign-verification.verified .gov-sign-verification-watermark {
    color: rgba(20, 100, 50, 0.40) !important;
  }
}
