/* Spark Agency HR — the Spark paper (v49): one A4 design for forms, letters and certificates. */
@font-face {
  font-family: "Anton";
  src: url("/assets/fonts/anton.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}

.sp-sheet {
  --navy: #21345a;
  --blue: #4a90bf;
  --fill: #cfdcf4;
  --ink: #1b2233;
  position: relative;
  width: 210mm;
  min-height: 297mm;
  padding: 0 0 14mm;
  background: #fff;
  color: var(--ink);
  font-family: "Manrope", "IBM Plex Sans Arabic", Arial, sans-serif;
  font-size: 9.6pt;
  line-height: 1.35;
  box-sizing: border-box;
  page: sparkpaper;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}
.sp-sheet * { box-sizing: border-box; }
.sp-sheet.sp-ar { font-family: "IBM Plex Sans Arabic", "Manrope", Arial, sans-serif; }

/* header: navy band with the title, light-blue block with the logo */
.sp-top { position: relative; height: 33mm; }
.sp-band {
  position: absolute;
  top: 5mm;
  left: 0;
  width: 152mm;
  height: 25mm;
  background: var(--navy);
  clip-path: polygon(0 0, 100% 0, 97% 100%, 0 100%);
  color: #fff;
  display: flex;
  align-items: center;
}
.sp-band-in { padding: 0 13mm 0 11mm; width: 100%; }
.sp-title {
  font-family: "Anton", "Manrope", Arial, sans-serif;
  font-size: 26pt;
  line-height: 1.05;
  text-transform: uppercase;
  letter-spacing: 0.005em;
}
.sp-ar .sp-title { font-family: "IBM Plex Sans Arabic", Arial, sans-serif; font-weight: 700; font-size: 23pt; text-transform: none; line-height: 1.25; }
.sp-sub { font-family: "IBM Plex Sans Arabic", Arial, sans-serif; font-size: 9pt; opacity: 0.92; margin-top: 1mm; }
.sp-en .sp-sub { text-align: left; }
.sp-ar .sp-band-in { text-align: right; padding: 0 18mm 0 10mm; }
.sp-ar .sp-sub { text-align: right; }
.sp-logo {
  position: absolute;
  top: 5mm;
  right: 0;
  width: 61mm;
  height: 25mm;
  background: var(--blue);
  clip-path: polygon(7.5% 0, 100% 0, 100% 100%, 0 100%);
  display: grid;
  place-items: center;
  padding-left: 4mm;
}
.sp-logo img { width: 34mm; height: auto; display: block; }
/* Arabic keeps the same header layout (logo on the right), like the printed papers */
.sp-ar .sp-band { left: 0; }
.sp-ar .sp-logo { right: 0; }

.sp-body { padding: 4mm 13mm 0; }
.sp-sec { margin-bottom: 4.5mm; }
.sp-sec-h {
  position: relative;
  background: var(--navy);
  color: #fff;
  height: 8.5mm;
  display: flex;
  align-items: center;
  padding: 0 6mm 0 8mm;
  margin: 0 0 3.5mm;
}
.sp-sec-h::before {
  content: "";
  position: absolute;
  inset: -1mm auto -1mm 0;
  width: 2.6mm;
  background: var(--blue);
}
.sp-ar .sp-sec-h { padding: 0 8mm 0 6mm; }
.sp-ar .sp-sec-h::before { inset: -1mm 0 -1mm auto; }
.sp-sec-h span { font-weight: 800; font-size: 8.6pt; letter-spacing: 0.28em; text-transform: uppercase; }
.sp-ar .sp-sec-h span { letter-spacing: 0; font-size: 10pt; font-weight: 700; }

.sp-rows { display: grid; gap: 2.6mm; }
.sp-row { display: flex; gap: 4mm; align-items: center; }
.sp-f { flex: var(--fw, 1) 1 0; min-width: 0; display: flex; align-items: center; gap: 2.5mm; }
.sp-l { white-space: nowrap; font-size: 9.2pt; color: var(--ink); }
.sp-box {
  flex: 1;
  min-width: 10mm;
  min-height: 6.4mm;
  background: var(--fill);
  padding: 1.2mm 2mm;
  font-size: 9.6pt;
  outline: none;
  overflow-wrap: anywhere;
  unicode-bidi: plaintext;
}
.sp-box:focus { box-shadow: inset 0 0 0 1.5px var(--blue); }
.sp-f-big { flex-direction: column; align-items: stretch; gap: 1.5mm; }
.sp-big { min-height: 20mm; }
.sp-row-c { gap: 8mm; flex-wrap: wrap; }
.sp-c { display: flex; align-items: center; gap: 3mm; padding: 1mm 0; }
.sp-check { width: 3.6mm; height: 3.6mm; background: var(--fill); flex: none; cursor: pointer; display: grid; place-items: center; font-size: 8pt; font-weight: 900; color: var(--navy); }
.sp-check[aria-checked="true"]::after { content: "✓"; }
.sp-p { margin: 0.5mm 0; line-height: 1.7; font-size: 9.8pt; }
.sp-bold { font-weight: 800; }
.sp-row-sg { gap: 10mm; margin-top: 3mm; align-items: flex-start; }
.sp-sg { flex: 1; display: grid; gap: 2mm; }
.sp-sg .sp-box { min-height: 8mm; }
.sp-caps .sp-l { font-weight: 800; letter-spacing: 0.22em; text-transform: uppercase; font-size: 8.8pt; }
.sp-ar .sp-caps .sp-l { letter-spacing: 0; font-size: 10pt; }
.sp-tb { flex: 1; display: grid; grid-template-columns: repeat(var(--cols, 4), 1fr); gap: 2mm 3mm; }
.sp-tb .sp-l { white-space: normal; }
.sp-cp { flex: 1; display: flex; justify-content: space-between; gap: 6mm; font-size: 9pt; margin-top: 3mm; }
.sp-letter p { line-height: 1.8; margin: 0 0 3mm; font-size: 10.5pt; }
.sp-letter h1 { display: none; }
.sp-letter h2, .sp-letter h3 { color: var(--navy); margin: 5mm 0 2mm; }
.sp-letter table { width: 100%; border-collapse: collapse; font-size: 9pt; margin-bottom: 4mm; background: none; border-radius: 0; }
.sp-letter th { background: var(--navy); color: #fff; text-transform: none; letter-spacing: 0; font-size: 8.6pt; padding: 1.8mm 2mm; }
.sp-letter td { padding: 1.6mm 2mm; border-bottom: 1px solid #dfe6f2; }
.sp-letter .signatures { display: flex; justify-content: space-between; gap: 10mm; margin-top: 12mm; }
.sp-letter .letterhead { display: none; }
.sp-foot {
  position: absolute;
  left: 13mm;
  right: 13mm;
  bottom: 6mm;
  border-top: 0.4mm solid var(--fill);
  padding-top: 2mm;
  font-size: 7.6pt;
  color: #6b7590;
  text-align: center;
}

/* on screen: the sheet scaled into its box */
.sp-preview {
  --sp-scale: 1;
  position: relative;
  height: var(--sp-h, auto);
  overflow: hidden;
}
.sp-preview .sp-sheet {
  transform: scale(var(--sp-scale));
  transform-origin: top left;
  box-shadow: 0 18px 50px #0f2a3624, 0 2px 6px #0f2a3614;
}

@page sparkpaper { size: A4; margin: 0; }
@media print {
  body.sp-printing > *:not(#sp-print-root) { display: none !important; }
  body.sp-printing #sp-print-root { display: block !important; position: static !important; visibility: visible !important; }
  body.sp-printing #sp-print-root * { visibility: visible !important; }
  body.sp-printing main, body.sp-printing aside { display: none !important; }
  body.sp-printing #sp-print-root .sp-sheet { transform: none; box-shadow: none; margin: 0; min-height: 296mm; }
  body.sp-printing { background: #fff !important; }
  .sp-box:focus { box-shadow: none; }
}
@media screen {
  #sp-print-root { position: fixed; left: -10000px; top: 0; }
}

/* v56/v57: uploaded templates — every page in the Spark frame, signatures under the last page */
.sp-sheet.sp-upl { padding: 0; min-height: 0; }
.sp-upl-pg { position: relative; display: flex; flex-direction: column; width: 210mm; height: 297mm; overflow: hidden; background: #fff; padding-bottom: 14mm; break-after: page; page-break-after: always; }
.sp-upl-pg + .sp-upl-pg { border-top: 1px dashed #c9d6e6; }
.sp-upl-pg:last-child { break-after: auto; page-break-after: auto; }
.sp-upl-pg > .sp-top { flex: none; }
.sp-upl-img { flex: 1 1 auto; min-height: 0; padding: 3mm 13mm 0; display: flex; justify-content: center; }
.sp-upl-img > img { display: block; max-width: 100%; max-height: 100%; object-fit: contain; object-position: top center; box-shadow: 0 0 0 0.3mm #dfe6f2; }
.sp-upl-signs { flex: none; padding-top: 3mm; }
.sp-upl-signs:empty { display: none; }
.sp-upl-signs .sp-sec { margin-bottom: 0; }
.sp-upl-after:empty { display: none; }
.sp-upl-html table { border-collapse: collapse; width: 100%; }
.sp-upl-html td, .sp-upl-html th { border: 0.3mm solid #c9d6e6; padding: 1.5mm 2mm; vertical-align: top; }
.sp-upl-html img { max-width: 100%; }
.sp-upl-wait { display: grid; place-items: center; min-height: 200mm; color: #8a97ab; font-size: 14pt; }
.sp-foot:empty { display: none; }
@media print {
  body.sp-printing #sp-print-root .sp-sheet.sp-upl { min-height: 0; }
  .sp-upl-pg + .sp-upl-pg { border-top: 0; }
}

/* v57: documents to sign (contracts, papers) in the Spark design */
.sp-letter ol, .sp-letter ul { margin: 0 0 3mm; padding-inline-start: 6mm; line-height: 1.8; font-size: 10.5pt; }
.sp-letter li { margin-bottom: 1mm; }
.sp-letter blockquote { margin: 0 0 3mm; padding: 2mm 4mm; border-inline-start: 1mm solid var(--blue); background: #f2f6fc; }
.sp-doc [dir="rtl"], .sp-doc p:lang(ar) { text-align: right; }
.sp-doc-sign { margin-top: 8mm; break-inside: avoid; }
.sp-doc-sign .sp-sg .sp-box { min-height: 16mm; display: flex; align-items: center; }
.sp-doc-sign .sp-box.sp-signed img { max-height: 15mm; max-width: 100%; }
.sp-doc-code { margin: 2mm 0 0; font-size: 7.6pt; color: #6b7590; }
.sp-box.sp-signed { background: #fff; box-shadow: inset 0 0 0 0.3mm var(--fill); }
.sp-box.sp-signed img { max-height: 14mm; display: block; }

/* the same design, readable on a phone (not an A4 page made small) */
.sp-sheet.sp-fluid { width: 100%; min-height: 0; padding-bottom: 46px; font-size: 14px; border-radius: 14px; overflow: hidden; box-shadow: 0 10px 30px #0f2a361f; }
.sp-fluid .sp-top { display: flex; height: auto; padding-top: 12px; }
.sp-fluid .sp-band { position: relative; top: 0; flex: 1 1 auto; width: auto; height: auto; min-height: 66px; padding: 10px 0; }
.sp-fluid .sp-band-in { padding: 0 22px 0 16px; }
.sp-ar.sp-fluid .sp-band-in { padding: 0 16px 0 22px; }
.sp-fluid .sp-title { font-size: clamp(19px, 5.6vw, 28px); }
.sp-ar.sp-fluid .sp-title { font-size: clamp(18px, 5vw, 25px); }
.sp-fluid .sp-sub { font-size: 11px; }
.sp-fluid .sp-logo { position: relative; top: 0; flex: 0 0 28%; width: auto; height: auto; padding-left: 10px; }
.sp-fluid .sp-logo img { width: 78%; max-width: 120px; }
.sp-fluid .sp-body { padding: 16px 16px 0; }
.sp-fluid .sp-letter p, .sp-fluid .sp-letter ol, .sp-fluid .sp-letter ul { font-size: 15px; line-height: 1.7; margin-bottom: 10px; }
.sp-fluid .sp-sec-h { height: 34px; margin-bottom: 12px; padding: 0 14px 0 18px; }
.sp-fluid .sp-sec-h::before { width: 6px; }
.sp-fluid .sp-sec-h span { font-size: 11px; }
.sp-fluid .sp-row-sg { flex-wrap: wrap; gap: 12px; }
.sp-fluid .sp-sg { min-width: 40%; }
.sp-fluid .sp-l { font-size: 12px; }
.sp-fluid .sp-box { min-height: 34px; padding: 6px 8px; font-size: 14px; }
.sp-fluid .sp-doc-sign .sp-box { min-height: 54px; }
.sp-fluid .sp-doc-sign .sp-box.sp-signed img { max-height: 50px; }
.sp-fluid .sp-doc-code { font-size: 11px; }
.sp-fluid .sp-foot { left: 16px; right: 16px; bottom: 14px; font-size: 11px; padding-top: 8px; }
