/* ════════════════════════════════════════════════════════════════════
   HupSub Document Templates — Shared Styles
   Includes: A4 layout, watermark, header, sections, signatures, footer
   ════════════════════════════════════════════════════════════════════ */

@page { size: A4; margin: 18mm; }
* { box-sizing: border-box; }
body {
  font-family: 'Noto Sans Lao', 'Segoe UI', sans-serif;
  color: #1f2937;
  line-height: 1.65;
  max-width: 210mm;
  margin: 0 auto;
  padding: 18mm 18mm 30mm 18mm;
  background: #fff;
  position: relative;
  font-size: 12px;
}

/* Watermark — semi-transparent logo at center */
body::before {
  content: "";
  position: fixed;
  top: 50%;
  left: 50%;
  width: 420px;
  height: 420px;
  transform: translate(-50%, -50%) rotate(-15deg);
  background: url('/images/hupsub_logo_1024.png') center / contain no-repeat;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}
body > * { position: relative; z-index: 1; }

/* Top bar (hidden on print) */
.top-bar {
  background: #1e293b;
  color: #fff;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: -18mm -18mm 18px -18mm;
}
.top-bar p { margin: 0; font-size: 13px; }
.top-bar .btns { display: flex; gap: 8px; }
.btn-action {
  background: #7c3aed; color: #fff; border: none; padding: 8px 16px;
  border-radius: 6px; font-weight: 700; font-size: 12px; cursor: pointer;
  text-decoration: none; display: inline-flex; align-items: center; gap: 6px;
}
.btn-action:hover { background: #6d28d9; }
.btn-action.green { background: #16a34a; }
.btn-action.green:hover { background: #15803d; }
.btn-action.secondary { background: #475569; }
.btn-action.secondary:hover { background: #334155; }

/* Document header with logo */
.doc-header {
  text-align: center;
  border-bottom: 3px double #7c3aed;
  padding-bottom: 14px;
  margin-bottom: 22px;
}
.doc-header-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
}
.doc-header img {
  width: 70px;
  height: 70px;
  border-radius: 14px;
  box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}
.doc-header-text { text-align: left; }
.doc-brand {
  font-size: 22px;
  font-weight: 900;
  color: #1e1b4b;
  letter-spacing: 0.3px;
  line-height: 1.1;
}
.doc-subtitle {
  font-size: 12px;
  color: #6b7280;
  margin-top: 4px;
}

/* Document title centered */
.doc-title {
  text-align: center;
  margin: 16px 0 20px 0;
}
.doc-title h1 {
  font-size: 24px;
  font-weight: 900;
  color: #5b21b6;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-family: 'Times New Roman', serif;
  margin: 0;
}
.doc-title .sub {
  font-size: 13px;
  color: #6b7280;
  margin-top: 4px;
  font-style: italic;
}

/* Section heading */
h2.section {
  font-size: 15px;
  color: #1e1b4b;
  margin: 18px 0 8px 0;
  border-left: 4px solid #7c3aed;
  padding-left: 10px;
}

/* Party info boxes */
.party-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 16px;
}
.party-box {
  background: #f9fafb;
  border: 1.5px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
}
.party-box h3 {
  font-size: 11px;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 6px 0;
  font-weight: 700;
}

/* Field with underline */
.field {
  border-bottom: 1.5px solid #555;
  padding: 4px 0;
  min-height: 22px;
}
.label {
  font-size: 11px;
  font-weight: 700;
  color: #555;
  display: block;
  margin-bottom: 2px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

/* Clauses */
.clause {
  margin-bottom: 12px;
  padding-left: 6px;
}
.clause-title {
  font-weight: 700;
  color: #1e1b4b;
  margin-bottom: 4px;
}
.lao { color: #4b5563; font-style: italic; font-size: 11px; }

/* Highlighted info box */
.info-box {
  background: #faf5ff;
  border-left: 4px solid #7c3aed;
  padding: 12px 16px;
  border-radius: 4px;
  margin: 14px 0;
}
.warn-box {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 4px;
  margin: 14px 0;
  color: #78350f;
}
.success-box {
  background: #f0fdf4;
  border-left: 4px solid #16a34a;
  padding: 12px 16px;
  border-radius: 4px;
  margin: 14px 0;
  color: #14532d;
}

/* Royalty split table */
.split-table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}
.split-table th, .split-table td {
  border: 1.5px solid #d1d5db;
  padding: 8px 12px;
  text-align: left;
  font-size: 12px;
}
.split-table th {
  background: #f3f0ff;
  color: #5b21b6;
  font-weight: 700;
}

/* Signature grid */
.signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-top: 28px;
  page-break-inside: avoid;
}
.sig-block { text-align: center; }
.sig-line {
  border-bottom: 1.5px solid #333;
  height: 50px;
  margin-bottom: 6px;
}
.sig-label {
  font-size: 11px;
  color: #555;
  line-height: 1.5;
}

/* HupSub Notary Seal box */
.notary-seal {
  margin-top: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px;
  border: 2px dashed #7c3aed;
  border-radius: 12px;
  background: #faf5ff;
}
.notary-seal img {
  width: 54px;
  height: 54px;
  border-radius: 10px;
}
.notary-seal-text {
  font-size: 11px;
  color: #5b21b6;
  line-height: 1.5;
}
.notary-seal-text strong { color: #1e1b4b; font-size: 13px; }

/* Footer */
.doc-footer {
  margin-top: 24px;
  padding-top: 10px;
  border-top: 2px solid #e5e7eb;
  text-align: center;
  font-size: 9px;
  color: #6b7280;
  line-height: 1.6;
}
.doc-footer img {
  width: 14px;
  height: 14px;
  vertical-align: middle;
  margin-right: 4px;
  border-radius: 3px;
}

@media print {
  .top-bar, .no-print { display: none !important; }
  body { padding: 18mm; }
}
