/* Terms of Use and Privacy notice: the two text buttons in the Get started
   card, the two pop-ups on oncology-platform.html, and the panels on
   terms.html and privacy.html. The typography matches the Oncology
   Modelling Platform's own Terms panel; the font is the site's own. */

/* ---- The two small text buttons at the foot of the Get started card ---- */
.action-card .action-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 22px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}
/* styles.css makes every .action-card .btn full-width, with 12px above the
   second of two buttons; undo both for this row only */
.action-card .action-legal .btn {
  width: auto;
  padding: 4px 2px;
  gap: 0;
  background: none;
  border: 0;
  box-shadow: none;
  font-family: inherit;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--link-teal);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.action-card .action-legal .btn + .btn { margin-top: 0; }
.action-card .action-legal .btn:hover,
.action-card .action-legal .btn:focus-visible {
  color: var(--magenta);
  transform: none;
}

/* ---- Page behind an open pop-up does not scroll ---- */
html.legal-dialog-open { overflow: hidden; scrollbar-gutter: stable; }
html.legal-dialog-open body { overflow: hidden; }

/* ---- The pop-up ---- */
.legal-dialog {
  width: min(760px, calc(100vw - 32px));
  max-width: 760px;
  max-height: 85vh;
  max-height: 85dvh;
  margin: auto;
  padding: 0;
  border: 1px solid rgba(0, 86, 121, 0.14);
  border-radius: 16px;
  background: #ffffff;
  color: #2c3e50;
  box-shadow: 0 18px 50px rgba(6, 36, 70, 0.18);
  font-family: inherit;
  overflow: hidden;
}
/* Only when open: a closed dialog must stay hidden */
.legal-dialog[open] { display: flex; flex-direction: column; }
.legal-dialog::backdrop { background: rgba(2, 1, 53, 0.55); }

.legal-dialog-inner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 28px 32px;
}
.legal-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.legal-dialog-title {
  margin: 0 0 6px;
  font-family: inherit;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  color: #020135;
}
.legal-dialog .legal-dialog-version {
  margin: 0 0 4px;
  font-size: 12.5px;
  line-height: 1.4;
  color: #5b6b76;
}
.legal-dialog-lead {
  margin: 4px 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #5b6b76;
}
.legal-dialog-close {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(0, 86, 121, 0.18);
  border-radius: 8px;
  background: #ffffff;
  color: #020135;
  font-size: 16px;
  cursor: pointer;
}
.legal-dialog-close:hover { border-color: #ff2a6d; color: #ff2a6d; }

/* The scroll box: the only part of the pop-up that scrolls */
.legal-dialog-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(0, 86, 121, 0.18);
  border-radius: 8px;
  padding: 14px 18px;
  background: #fafcfd;
}
.legal-dialog-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 18px;
  font-size: 13px;
}
.legal-dialog-foot a { color: #005679; text-decoration: underline; }
.legal-dialog-foot a:hover { color: #020135; }
.legal-dialog-done {
  border: 0;
  border-radius: 8px;
  padding: 10px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
  background: #005679;
  cursor: pointer;
  transition: background-color .3s;
}
.legal-dialog-done:hover { background: #020135; }

/* ---- The legal text, in the pop-up and on the pages ---- */
.legal-doc {
  font-family: inherit;
  font-size: 14px;
  line-height: 1.55;
  color: #2c3e50;
  text-align: left;
  overflow-wrap: anywhere;
}
.legal-doc h3 {
  margin: 16px 0 4px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: #020135;
}
.legal-doc p { margin: 0 0 10px; }
.legal-doc .legal-meta { margin: 0 0 12px; font-size: 12.5px; color: #5b6b76; }
.legal-doc strong { font-weight: 700; color: inherit; }
.legal-doc a { color: #005679; text-decoration: underline; font-weight: inherit; }
.legal-doc a:hover,
.legal-doc a:focus { color: #020135; }

/* ---- The white panel on terms.html and privacy.html ---- */
.legal-page {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 32px;
  background: #ffffff;
  border: 1px solid rgba(0, 86, 121, 0.14);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(6, 36, 70, 0.18);
}

/* ---- Phones ---- */
@media (max-width: 600px) {
  .legal-dialog-inner { padding: 20px 18px; }
  .legal-dialog-title { font-size: 19px; }
  .legal-dialog-body { padding: 12px 14px; }
  .legal-page { padding: 20px 18px; border-radius: 12px; }
}
