/* ═══════════════════════════════════════════════════
   PTICHKI — DOCUMENT PAGES SHARED STYLES
   Used by all individual document pages in /docs/
═══════════════════════════════════════════════════ */

:root {
  --bg: #FAF7F3;
  --surface: #ffffff;
  --primary: #1A1A1A;
  --primary-bg: #EDE6DF;
  --text: #1A1A1A;
  --text-secondary: #7A7168;
  --text-muted: #A89E94;
  --border: #E0D8CF;
  --shadow: 0 2px 20px rgba(0,0,0,0.06);
  --transition: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-weight: 400;
  min-height: 100vh;
}

/* ═══════ PAGE HEADER ═══════ */
.doc-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 100;
}

.doc-page-logo img {
  max-width: 100px;
  filter: brightness(0) invert(0);
  mix-blend-mode: multiply;
}

.doc-page-back {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition);
}

.doc-page-back:hover {
  color: var(--text);
}

/* ═══════ LAYOUT ═══════ */
.doc-page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  max-width: 1200px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
}

/* ═══════ SIDEBAR ═══════ */
.doc-sidebar {
  border-right: 1px solid var(--border);
  padding: 32px 0;
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
}

.doc-sidebar-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text-muted);
  padding: 0 24px;
  margin-bottom: 12px;
}

.doc-sidebar-list {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.doc-sidebar-group + .doc-sidebar-group {
  margin-top: 24px;
}

.doc-sidebar-link {
  display: block;
  padding: 10px 24px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: all var(--transition);
  line-height: 1.4;
}

.doc-sidebar-link:hover {
  color: var(--text);
  background: var(--primary-bg);
}

.doc-sidebar-link.active {
  color: var(--text);
  font-weight: 600;
  border-left-color: var(--primary);
  background: var(--primary-bg);
}

/* ═══════ MAIN CONTENT ═══════ */
.doc-content {
  padding: 40px 48px 100px;
  max-width: 800px;
}

.doc-card {
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--border);
}

.doc-header {
  padding: 28px 32px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--primary-bg);
}

.doc-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.badge-policy { background: #e8f5e9; color: #2e7d32; }
.badge-offer { background: #e3f2fd; color: #1565c0; }
.badge-consent { background: #fce4ec; color: #c62828; }
.badge-terms { background: #f3e5f5; color: #6a1b9a; }
.badge-paper { background: #f3e5f5; color: #6a1b9a; }

.doc-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 4px;
}

.doc-header .doc-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 300;
}

.doc-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
}

.doc-print {
  appearance: none;
  border: 1px solid rgba(26, 26, 26, 0.18);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
}

.doc-print:hover {
  background: #fff;
  border-color: rgba(26, 26, 26, 0.32);
  transform: translateY(-1px);
}

.doc-body {
  padding: 32px;
}

.doc-body h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 28px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.doc-body h3:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.doc-body p, .doc-body li {
  font-size: 14.5px;
  color: var(--text);
  line-height: 1.8;
  margin-bottom: 8px;
}

.doc-body ul, .doc-body ol {
  padding-left: 20px;
  margin-bottom: 12px;
}

.doc-body ul { list-style: disc; }

.doc-body li {
  margin-bottom: 4px;
}

.doc-body a {
  color: #1565c0;
  text-decoration: underline;
  text-decoration-color: rgba(21,101,192,0.3);
  transition: text-decoration-color var(--transition);
}

.doc-body a:hover {
  text-decoration-color: #1565c0;
}

.doc-body .highlight {
  background: var(--primary-bg);
  border-left: 3px solid var(--primary);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  font-size: 14px;
}

.doc-body .info-grid {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.doc-body .info-row {
  display: flex;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid #f0ece4;
  font-size: 14px;
}

.doc-body .info-row:last-child { border-bottom: none; }

.doc-body .info-label {
  color: var(--text-muted);
  min-width: 140px;
  flex-shrink: 0;
}

.doc-body .info-value {
  color: var(--text);
  font-weight: 500;
}

.doc-body .placeholder-text {
  background: var(--primary-bg);
  padding: 40px 32px;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: 8px;
  margin: 20px 0;
}

.doc-body .placeholder-text p {
  color: var(--text-muted);
  font-style: italic;
  font-size: 15px;
}

.doc-body .doc-note {
  background: rgba(237, 230, 223, 0.45);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 24px;
}

.doc-body .doc-note p:last-child {
  margin-bottom: 0;
}

.doc-body .doc-divider-title {
  margin: 32px 0 16px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}

.doc-body .doc-signature-title {
  margin-top: 24px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.doc-body .doc-instruction {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.doc-body .doc-field-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.doc-body .doc-form-block {
  background: rgba(250, 247, 243, 0.8);
  border: 1px solid rgba(224, 216, 207, 0.9);
  border-radius: 14px;
  padding: 16px 18px;
  margin: 14px 0;
}

.doc-body .doc-form-block p:last-child {
  margin-bottom: 0;
}

.doc-body .doc-checkline {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 12px;
  margin: 8px 0;
  border: 1px solid rgba(224, 216, 207, 0.9);
  border-radius: 12px;
  background: #fff;
}

.doc-body .doc-checkbox {
  font-size: 16px;
  line-height: 1;
  margin-top: 2px;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.doc-body .doc-signline {
  padding: 14px 0 6px;
  margin-top: 10px;
  border-bottom: 1px solid var(--border);
}

.doc-body .doc-signline p {
  margin-bottom: 0;
}

.doc-body .doc-signline-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}

.doc-page-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.doc-page-bottom a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}

.doc-page-bottom a:hover {
  color: var(--text);
}

/* ═══════ RESPONSIVE ═══════ */
@media (max-width: 900px) {
  .doc-page-layout {
    grid-template-columns: 1fr;
  }

  .doc-sidebar {
    position: relative;
    top: 0;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
  }

  .doc-sidebar-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 16px;
  }

  .doc-sidebar-link {
    padding: 6px 12px;
    border-left: none;
    border-radius: 100px;
    font-size: 12px;
    white-space: nowrap;
  }

  .doc-sidebar-link.active {
    background: var(--primary);
    color: #FAF7F3;
    border-left-color: transparent;
  }

  .doc-content {
    padding: 24px 16px 80px;
  }

  .doc-header { padding: 20px 20px 18px; }
  .doc-body { padding: 20px; }
  .doc-body .info-row { flex-direction: column; gap: 2px; }
  .doc-actions { justify-content: flex-start; }
  .doc-page-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  .doc-page-header { padding: 12px 16px; }
  .doc-page-logo img { max-width: 80px; }
  .doc-page-back { font-size: 13px; }
}

@media print {
  body {
    background: #fff;
  }

  .doc-page-header,
  .doc-sidebar,
  .doc-actions,
  .doc-page-bottom {
    display: none !important;
  }

  .doc-page-layout {
    display: block;
    max-width: none;
    min-height: auto;
  }

  .doc-content {
    max-width: none;
    padding: 0;
  }

  .doc-card {
    border: none;
    box-shadow: none;
  }

  .doc-header {
    background: #fff;
    padding: 0 0 18px;
  }

  .doc-body {
    padding: 0;
  }

  .doc-body h3 {
    break-after: avoid;
  }
}
