
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Source+Serif+4:opsz,wght@8..60,400;8..60,600;8..60,700&display=swap');

:root {
  --bg-deep: #060a14;
  --bg-card: #0c1220;
  --bg-elevated: #111827;
  --bg-surface: #1a2234;
  --accent-blue: #3b82f6;
  --accent-teal: #14b8a6;
  --accent-gradient: linear-gradient(135deg, #3b82f6, #14b8a6);
  --accent-glow: rgba(59, 130, 246, 0.15);
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --border-subtle: rgba(255,255,255,0.08);
  --border-accent: rgba(59, 130, 246, 0.3);
  --serif: 'Source Serif 4', 'Georgia', serif;
  --sans: 'Inter', -apple-system, 'Segoe UI', sans-serif;
}

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

body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-secondary);
  background: var(--bg-deep);
  -webkit-font-smoothing: antialiased;
}

.doc-container {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  box-shadow: 0 0 80px rgba(59, 130, 246, 0.04);
}

.doc-header {
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border-subtle);
  padding: 48px 60px 40px;
  position: relative;
  overflow: hidden;
}

.doc-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-gradient);
}

.doc-header .brand {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 20px;
}

.doc-header h1 {
  font-family: var(--serif);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.doc-header .meta {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
}

.doc-header .meta strong { color: var(--text-secondary); }

.doc-body { padding: 48px 60px 60px; }

.notice-box {
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid var(--border-accent);
  border-left: 4px solid var(--accent-blue);
  border-radius: 0 6px 6px 0;
  padding: 18px 22px;
  margin-bottom: 36px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.notice-box strong { color: var(--text-primary); }

.toc {
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 28px 32px;
  margin-bottom: 40px;
}

.toc h2 {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.toc ol {
  list-style: none;
  counter-reset: toc-counter;
  padding: 0;
}

.toc ol li {
  counter-increment: toc-counter;
  margin-bottom: 6px;
}

.toc ol li a {
  color: var(--accent-blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: baseline;
  gap: 10px;
  transition: color 0.15s;
}

.toc ol li a::before {
  content: counter(toc-counter) ".";
  color: var(--text-muted);
  font-weight: 400;
  min-width: 22px;
  font-variant-numeric: tabular-nums;
}

.toc ol li a:hover { color: var(--accent-teal); }

h2.section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 48px;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-subtle);
  position: relative;
}

h2.section-title::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--accent-gradient);
}

h3 {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 28px;
  margin-bottom: 10px;
}

p { margin-bottom: 14px; }

ol.legal, ul.legal {
  margin-bottom: 14px;
  padding-left: 28px;
}

ol.legal li, ul.legal li {
  margin-bottom: 8px;
}

.placeholder {
  background: rgba(234, 179, 8, 0.15);
  border: 1px solid rgba(234, 179, 8, 0.3);
  padding: 1px 7px;
  border-radius: 3px;
  font-weight: 600;
  color: #eab308;
  font-size: 13px;
}

.regional-addendum {
  margin-top: 20px;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  overflow: hidden;
}

.regional-addendum .region-header {
  background: var(--bg-elevated);
  padding: 10px 16px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-subtle);
}

.regional-addendum .region-body {
  padding: 18px 22px;
  font-size: 14px;
  background: var(--bg-card);
}

.regional-addendum .region-body p { margin-bottom: 10px; }
.regional-addendum .region-body p:last-child { margin-bottom: 0; }

table.legal-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0 20px;
  font-size: 14px;
}

table.legal-table th {
  background: var(--bg-elevated);
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  font-size: 13px;
}

table.legal-table td {
  padding: 10px 14px;
  border: 1px solid var(--border-subtle);
  vertical-align: top;
}

.warning-box {
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.25);
  border-left: 4px solid #dc2626;
  border-radius: 0 6px 6px 0;
  padding: 16px 20px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.6;
}

.warning-box strong { color: #fca5a5; }

.annex {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid var(--border-subtle);
}

.annex h2 {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.signature-block {
  margin-top: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}

.sig-party h3 { margin-top: 0; margin-bottom: 20px; font-size: 15px; }
.sig-line { border-bottom: 1px solid var(--text-muted); margin-bottom: 6px; padding-bottom: 4px; min-height: 28px; }
.sig-label { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }

.doc-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 24px 60px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}

a { color: var(--accent-blue); text-decoration: none; }
a:hover { color: var(--accent-teal); }

@media print {
  body { background: #fff; color: #333; }
  .doc-container { box-shadow: none; border: none; background: #fff; }
  .doc-header { background: #fff; border-bottom: 3px solid #000; }
  .doc-header::before { background: #000; }
  .doc-header h1 { color: #000; }
  .doc-header .brand { -webkit-text-fill-color: #000; color: #000; }
  .doc-header .meta, .doc-header .meta strong { color: #333; }
  .toc { background: #f5f5f5; border-color: #ddd; }
  .toc ol li a { color: #000; }
  h2.section-title { color: #000; border-bottom-color: #ddd; }
  h2.section-title::after { background: #000; }
  h3 { color: #000; }
  .notice-box { background: #f0f7ff; border-color: #3b82f6; }
  .regional-addendum { border-color: #ddd; }
  .regional-addendum .region-header { background: #f5f5f5; border-color: #ddd; color: #333; }
  .regional-addendum .region-body { background: #fff; }
  table.legal-table th { background: #f5f5f5; border-color: #ddd; color: #000; }
  table.legal-table td { border-color: #ddd; color: #333; }
  .placeholder { background: #fff3cd; color: #856404; border-color: #856404; }
  p, ol.legal li, ul.legal li { color: #333; }
  .doc-footer { color: #666; border-color: #ddd; }
}

@media (max-width: 640px) {
  .doc-header, .doc-body, .doc-footer { padding-left: 24px; padding-right: 24px; }
  .doc-header h1 { font-size: 24px; }
  h2.section-title { font-size: 19px; }
  .signature-block { grid-template-columns: 1fr; gap: 32px; }
}
