/* ── Design tokens (AI_Proposal_Design_Specification) ── */
:root {
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --text-body: #2d3748;
  --text-heading: #0f172a;
  --primary: #1e3a8a;
  --accent: #0ea5e9;
  --accent-emerald: #059669;
  --border-light: #e2e8f0;
  --dot-grid: rgba(226, 232, 240, 0.35);
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-border: rgba(14, 165, 233, 0.35);
  --gradient-heading: linear-gradient(135deg, #0f172a 0%, #1e3a8a 45%, #0ea5e9 100%);
  --gradient-table: linear-gradient(90deg, #0f172a 0%, #1e3a8a 50%, #0ea5e9 100%);
  --font-family: "Heebo", "Rubik", "Assistant", system-ui, sans-serif;
  --brand-dark: #0a0a0a;
  --brand-glow: rgba(14, 165, 233, 0.45);
}

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

html {
  font-size: 12pt;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-family);
  font-size: 11.5pt;
  line-height: 1.55;
  color: var(--text-body);
  background: #cbd5e1;
  direction: rtl;
  -webkit-font-smoothing: antialiased;
}

/* ── Dot grid blueprint background ── */
.dot-grid {
  background-color: var(--bg-secondary);
  background-image: radial-gradient(circle, var(--dot-grid) 1px, transparent 1px);
  background-size: 18px 18px;
}

/* ── Page shell ── */
.page {
  position: relative;
  width: 210mm;
  min-height: 297mm;
  margin: 12mm auto;
  padding: 18mm 20mm 22mm;
  background: var(--bg-primary);
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.12);
  overflow: hidden;
  page-break-after: always;
}

.page:last-child {
  page-break-after: auto;
}

/* ── Neural mesh overlay ── */
.neural-mesh {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.12;
}

.neural-mesh img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.page-content {
  position: relative;
  z-index: 1;
}

/* ── Cover page ── */
.cover {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 257mm;
  padding-top: 8mm;
}

.cover-top {
  text-align: center;
  padding-top: 18mm;
}

/* ── The Archetype – unified brand logo ── */
.brand-logo-frame {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand-dark);
  border: 1px solid var(--brand-glow);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 8px 24px rgba(14, 165, 233, 0.12);
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo-frame--cover {
  width: 148px;
  height: 148px;
  padding: 10px;
  margin-bottom: 10mm;
  border-radius: 18px;
}

.brand-logo-frame--header {
  width: 44px;
  height: 44px;
  padding: 4px;
  border-radius: 10px;
}

.brand-logo-frame--footer {
  width: 28px;
  height: 28px;
  padding: 3px;
  border-radius: 7px;
}

.brand-logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Hero emblem – decorative watermark only (not a logo substitute) */
.hero-watermark {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-watermark img {
  width: min(72%, 420px);
  height: auto;
  opacity: 0.07;
  filter: saturate(0.85);
}

.hero-watermark--callout img {
  width: min(55%, 320px);
  opacity: 0.05;
}

.page-header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-header-brand-name {
  font-size: 8pt;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748b;
  line-height: 1.2;
}

.page-footer-brand {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cover-title {
  margin: 0 0 8mm;
  font-size: 26pt;
  font-weight: 700;
  line-height: 1.25;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cover-subtitle {
  margin: 0;
  font-size: 16pt;
  font-weight: 500;
  color: var(--primary);
}

.cover-meta {
  border-top: 1px solid var(--border-light);
  padding-top: 8mm;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4mm 12mm;
  font-size: 10pt;
  color: #64748b;
}

.cover-meta dt {
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: 1mm;
}

.cover-meta dd {
  margin: 0 0 4mm;
}

/* ── Internal header / footer ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 4mm;
  margin-bottom: 8mm;
  border-bottom: 1px solid var(--border-light);
  font-size: 9pt;
  color: #64748b;
}

.page-header .chapter-name {
  font-weight: 500;
  color: var(--text-heading);
}

.page-header .grid-accent {
  width: 28px;
  height: 28px;
  background-image: radial-gradient(circle, var(--dot-grid) 1px, transparent 1px);
  background-size: 6px 6px;
  opacity: 0.8;
}

.page-footer {
  position: absolute;
  bottom: 12mm;
  left: 20mm;
  right: 20mm;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 3mm;
  border-top: 1px solid var(--border-light);
  font-size: 8.5pt;
  color: #94a3b8;
}

.page-footer .confidential {
  font-weight: 500;
}

/* ── Typography ── */
h1.section-title {
  margin: 0 0 6mm;
  font-size: 22pt;
  font-weight: 700;
  line-height: 1.3;
  background: var(--gradient-heading);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

h2 {
  margin: 7mm 0 3mm;
  font-size: 16pt;
  font-weight: 600;
  color: var(--text-heading);
}

h3 {
  margin: 5mm 0 2mm;
  font-size: 13pt;
  font-weight: 600;
  color: var(--primary);
}

p {
  margin: 0 0 3.5mm;
}

ul,
ol {
  margin: 0 0 4mm;
  padding-right: 6mm;
}

li {
  margin-bottom: 2mm;
}

li::marker {
  color: var(--accent);
}

hr.section-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: 8mm 0;
}

/* ── Glassmorphic callouts ── */
.glass-callout {
  margin: 5mm 0 6mm;
  padding: 6mm 7mm;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(14, 165, 233, 0.06);
}

.glass-callout h2 {
  margin-top: 0;
}

.glass-callout ul {
  margin-bottom: 0;
}

/* ── Pricing table ── */
.pricing-table {
  width: 100%;
  border-collapse: collapse;
  margin: 5mm 0 6mm;
  font-size: 10pt;
}

.pricing-table thead tr {
  background: var(--gradient-table);
  color: #ffffff;
}

.pricing-table th {
  padding: 4mm 3mm;
  text-align: right;
  font-weight: 600;
  font-size: 9.5pt;
}

.pricing-table td {
  padding: 3.5mm 3mm;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.pricing-table tbody tr:last-child td {
  border-bottom: none;
}

.pricing-table tbody tr:nth-child(even) {
  background: rgba(250, 250, 250, 0.8);
}

.pricing-table .route-name {
  font-weight: 600;
  color: var(--text-heading);
  white-space: nowrap;
}

.pricing-table .price {
  font-weight: 600;
  color: var(--primary);
  white-space: nowrap;
}

/* ── Signature block ── */
.signature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10mm;
  margin-top: 8mm;
}

.signature-block {
  padding: 5mm;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-secondary);
}

.signature-block h3 {
  margin-top: 0;
  font-size: 11pt;
}

.signature-line {
  margin: 5mm 0 3mm;
  border-bottom: 1px solid #cbd5e1;
  min-height: 8mm;
}

.signature-label {
  font-size: 9pt;
  color: #64748b;
}

/* ── Route cards (scope section) ── */
.route-block {
  margin-bottom: 5mm;
  padding-bottom: 4mm;
  border-bottom: 1px dashed var(--border-light);
}

.route-block:last-of-type {
  border-bottom: none;
}

.route-block h3 {
  margin-top: 0;
}

/* ── Print ── */
@page {
  size: A4;
  margin: 0;
}

@media print {
  body {
    background: white;
  }

  .page {
    margin: 0;
    box-shadow: none;
    width: 210mm;
    min-height: 297mm;
  }

  .no-print {
    display: none !important;
  }

  .glass-callout {
    backdrop-filter: none;
    background: #f8fafc;
  }

  .brand-logo-frame {
    box-shadow: none;
  }

  .hero-watermark img {
    opacity: 0.06;
  }
}

/* ── Screen toolbar ── */
.toolbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(15, 23, 42, 0.92);
  color: white;
  font-family: var(--font-family);
  font-size: 13px;
}

.toolbar button {
  padding: 8px 18px;
  border: none;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.toolbar button:hover {
  background: #0284c7;
}

.toolbar span {
  opacity: 0.75;
}

@media print {
  .toolbar {
    display: none;
  }
}
