/* ==========================================================================
   User Agreement (/vuz/agreement)
   Scoped with .ag-* to avoid Bootstrap / MDB conflicts
   ========================================================================== */

:root {
  --ag-bg: #f1f5f9;
  --ag-card: #ffffff;
  --ag-ink: #0f172a;
  --ag-text: #1e293b;
  --ag-muted: #64748b;
  --ag-line: #e2e8f0;
  --ag-brand: #1e3a8a;
  --ag-brand2: #2563eb;
  --ag-brand-soft: #eff6ff;
  --ag-orange: #ef7f1a;
  --ag-orange-soft: #fff7ed;
  --ag-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 6px 20px rgba(15, 23, 42, 0.05);
}

/* ---------- Hero Banner (inside layout.hbs .main) ---------- */
.ag-hero-wrap {
  margin-top: -40px;
  padding-bottom: 34px;
}

.ag-hero {
  padding-top: 24px;
}

.ag-breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
  margin: 0 0 14px;
}

.ag-breadcrumbs a {
  color: #fbbf24;
  text-decoration: none;
  font-weight: 500;
}

.ag-breadcrumbs a:hover {
  color: #fde68a;
  text-decoration: underline;
}

.ag-breadcrumbs .ag-bc-sep {
  opacity: 0.55;
}

.ag-hero-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.ag-hero-main {
  flex: 1 1 520px;
  min-width: 0;
}

.ag-hero-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.ag-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ag-hero-badge--accent {
  background: rgba(239, 127, 26, 0.24);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fef3c7;
}

.ag-hero-title {
  color: #ffffff;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
}

.ag-hero-sub {
  color: rgba(255, 255, 255, 0.85);
  font-size: 15px;
  line-height: 1.5;
  margin: 10px 0 0;
  max-width: 740px;
}

.ag-hero-sub a {
  color: #fde68a;
  text-decoration: underline;
}

.ag-hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.ag-hero-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.12s ease, border-color 0.16s ease;
  white-space: nowrap;
}

.ag-hero-btn--primary {
  background: var(--ag-orange);
  color: #ffffff !important;
  border: 1px solid var(--ag-orange);
}

.ag-hero-btn--primary:hover {
  background: #d96d0f;
  border-color: #d96d0f;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.ag-hero-btn--ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff !important;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.ag-hero-btn--ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff !important;
}

/* ---------- Page Layout ---------- */
.ag-page {
  background: var(--ag-bg);
  padding: 28px 0 56px;
}

.ag-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* ---------- Sticky TOC Sidebar ---------- */
.ag-toc {
  position: sticky;
  top: 20px;
  background: var(--ag-card);
  border: 1px solid var(--ag-line);
  border-radius: 14px;
  padding: 18px 16px;
  box-shadow: var(--ag-shadow);
}

.ag-toc-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ag-muted);
  margin: 0 0 12px;
  padding: 0 8px;
}

.ag-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ag-toc-link {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.35;
  color: var(--ag-text);
  text-decoration: none !important;
  border-left: 3px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.ag-toc-link:hover {
  background: var(--ag-brand-soft);
  color: var(--ag-brand);
}

.ag-toc-link.is-active {
  background: var(--ag-brand-soft);
  color: var(--ag-brand);
  font-weight: 600;
  border-left-color: var(--ag-orange);
}

/* ---------- Document Card ---------- */
.ag-doc {
  background: var(--ag-card);
  border: 1px solid var(--ag-line);
  border-radius: 16px;
  padding: 40px 44px;
  box-shadow: var(--ag-shadow);
  color: var(--ag-text);
  font-size: 15px;
  line-height: 1.72;
}

/* Approval stamp grid */
.ag-approvals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-bottom: 24px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--ag-line);
}

.ag-approval-box {
  background: #f8fafc;
  border: 1px solid var(--ag-line);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--ag-text);
}

.ag-approval-label {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ag-brand);
  background: var(--ag-brand-soft);
  padding: 2px 9px;
  border-radius: 6px;
  margin-bottom: 8px;
}

.ag-approval-box p {
  margin: 0 0 6px;
}

.ag-approval-box p:last-child {
  margin-bottom: 0;
  color: var(--ag-muted);
  font-weight: 500;
}

/* Title block */
.ag-doc-title-block {
  text-align: center;
  padding: 8px 0 28px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--ag-brand-soft);
}

.ag-doc-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--ag-ink);
  margin: 0 0 6px;
  letter-spacing: 0.01em;
}

.ag-doc-subtitle {
  font-size: 16px;
  font-weight: 600;
  color: var(--ag-brand);
  margin: 0 0 4px;
}

.ag-doc-url {
  font-size: 15px;
  margin: 4px 0 12px;
}

.ag-doc-city {
  font-size: 14px;
  font-weight: 600;
  color: var(--ag-muted);
  margin: 0;
}

/* Sections */
.ag-section {
  scroll-margin-top: 24px;
  padding-top: 8px;
  margin-bottom: 32px;
}

.ag-section:last-child {
  margin-bottom: 0;
}

.ag-section-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--ag-brand);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--ag-brand-soft);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ag-section-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--ag-brand-soft);
  color: var(--ag-brand);
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.ag-subhead {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ag-ink);
  margin: 18px 0 8px;
}

.ag-doc p {
  margin: 0 0 12px;
  text-align: justify;
  hyphens: auto;
}

.ag-clause-num {
  font-weight: 700;
  color: var(--ag-ink);
  margin-right: 4px;
}

.ag-indent {
  padding-left: 20px;
  border-left: 2px solid var(--ag-line);
  margin: 10px 0 14px;
}

.ag-indent p:last-child {
  margin-bottom: 0;
}

/* Terms & Definitions */
.ag-terms {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 14px 0 0;
}

.ag-term-item {
  background: #f8fafc;
  border: 1px solid var(--ag-line);
  border-left: 3px solid var(--ag-brand);
  border-radius: 10px;
  padding: 12px 16px;
}

.ag-term-item p {
  margin: 0;
}

.ag-term-item p + p {
  margin-top: 6px;
}

.ag-term-name {
  font-weight: 700;
  color: var(--ag-ink);
}

/* Bullet lists */
.ag-list {
  margin: 8px 0 14px;
  padding-left: 22px;
}

.ag-list li {
  margin-bottom: 6px;
  text-align: justify;
}

.ag-list li::marker {
  color: var(--ag-orange);
}

/* Requisites Card */
.ag-requisites {
  margin-top: 20px;
  background: var(--ag-brand-soft);
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 18px 22px;
}

.ag-requisites-title {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ag-brand);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ag-requisites p {
  margin: 0 0 4px;
  text-align: left;
}

.ag-requisites p:last-child {
  margin-bottom: 0;
}

/* Appendix 1 */
.ag-appendix {
  border-top: 2px dashed var(--ag-line);
  padding-top: 28px;
  margin-top: 36px;
}

.ag-appendix-meta {
  text-align: right;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ag-muted);
  margin-bottom: 20px;
}

.ag-appendix-meta strong {
  color: var(--ag-ink);
  font-size: 14.5px;
}

.ag-appendix-title {
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: var(--ag-ink);
  margin: 0 0 6px;
}

.ag-appendix-sub {
  text-align: center;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ag-muted);
  margin: 0 0 18px;
}

.ag-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--ag-line);
  border-radius: 12px;
  margin: 16px 0 18px;
}

.ag-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}

.ag-table thead th {
  background: var(--ag-brand);
  color: #ffffff;
  font-weight: 600;
  text-align: left;
  padding: 12px 14px;
  border-bottom: 2px solid #172e6e;
}

.ag-table thead th a {
  color: #fde68a;
}

.ag-table tbody td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--ag-line);
  vertical-align: top;
}

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

.ag-table tbody tr:nth-child(even) {
  background: #f8fafc;
}

.ag-table tbody tr.ag-row-current {
  background: var(--ag-orange-soft);
}

.ag-table-num {
  width: 48px;
  text-align: center;
  font-weight: 700;
  color: var(--ag-brand);
}

.ag-sys-name {
  font-weight: 700;
  color: var(--ag-ink);
}

.ag-sys-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 999px;
  background: var(--ag-orange);
  color: #ffffff;
  vertical-align: middle;
}

.ag-sys-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ag-brand2);
  word-break: break-all;
}

.ag-sys-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 6px;
}

.ag-sys-links .ag-sys-link {
  margin-top: 0;
}

.ag-note {
  font-size: 13.5px;
  font-style: italic;
  color: var(--ag-muted);
  background: #f8fafc;
  border: 1px solid var(--ag-line);
  border-radius: 10px;
  padding: 12px 16px;
  margin-top: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .ag-layout {
    grid-template-columns: 1fr;
  }

  .ag-toc {
    position: static;
  }

  .ag-toc-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 6px;
  }

  .ag-toc-link {
    background: #f8fafc;
    border: 1px solid var(--ag-line);
    border-left-width: 1px;
    padding: 6px 11px;
    font-size: 13px;
  }

  .ag-toc-link.is-active {
    border-color: var(--ag-brand);
  }

  .ag-doc {
    padding: 28px 24px;
  }
}

@media (max-width: 767.98px) {
  .ag-hero-title {
    font-size: 22px;
  }

  .ag-approvals {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ag-doc {
    padding: 22px 16px;
    font-size: 14.5px;
  }

  .ag-doc p {
    text-align: left;
  }
}

/* ---------- Print Styles ---------- */
@media print {
  .main,
  nav.navbar,
  footer,
  #myBtn,
  .ag-toc,
  .ag-hero-actions,
  .ag-sys-badge {
    display: none !important;
  }

  .ag-page {
    background: #ffffff;
    padding: 0;
  }

  .ag-layout {
    display: block;
  }

  .ag-doc {
    border: none;
    box-shadow: none;
    padding: 0;
    font-size: 12pt;
    line-height: 1.5;
  }

  .ag-section {
    page-break-inside: auto;
  }

  .ag-appendix {
    page-break-before: always;
    border-top: none;
    padding-top: 0;
  }
}
