/*
 * Shared layout for all Tapmad legal content: the web app and hosted HTML/PHP pages.
 * Change the look of legal pages here and it changes everywhere.
 *
 * .legal-page rules are only for pages outside the web app, which do not have
 * the site's global styles. The web app never uses that class.
 */

@font-face {
  font-family: "celebsans";
  src: url("../fonts/celebsans-light.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "celebsans";
  src: url("../fonts/celebsans-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "celebsans";
  src: url("../fonts/celebsans-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "celebsans";
  src: url("../fonts/celebsans-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ---------- Base for pages outside the web app ---------- */

body.legal-page {
  margin: 0;
  background-color: #131417;
}

.legal-page {
  color: #fff;
  font-family: "celebsans", arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
}

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

.legal-page #legal-root,
.legal-page .legal-root {
  padding: 1rem 0.75rem 2.5rem;
}

/* :where() keeps these as weak as the site's bare tag styles, so the rules below still win. */
:where(.legal-page) h1,
:where(.legal-page) h2,
:where(.legal-page) h3,
:where(.legal-page) h4 {
  margin: 0 0 0.5rem;
  font-weight: 500;
  line-height: 1.2;
}

:where(.legal-page) p {
  margin: 0 0 1rem;
  line-height: 1.3;
}

:where(.legal-page) p:last-child {
  margin-bottom: 0;
}

:where(.legal-page) ul,
:where(.legal-page) ol {
  list-style: none;
  margin: 0 0 1rem;
  padding-left: 2rem;
}

:where(.legal-page) b,
:where(.legal-page) strong {
  font-weight: 700;
}

:where(.legal-page) a {
  color: #fff;
  text-decoration: none;
  transition: color 250ms ease-in-out, background-color 250ms ease-in-out;
  -webkit-user-select: none;
  user-select: none;
}

:where(.legal-page) hr {
  height: 1px;
  margin: 1rem 0;
  border: 0;
  color: inherit;
  background-color: currentColor;
  opacity: 0.25;
}

.legal-page .text-white {
  color: #fff;
}

.legal-page .text-primary {
  color: #37c673;
}

.legal-page .translate-sensitive-bn {
  display: none;
}

.legal-page [role="button"] {
  cursor: pointer;
}

.legal-page .legal-faq svg {
  display: inline-block;
  vertical-align: middle;
}

.legal-error {
  color: #adb0bb;
  line-height: 1.3;
}

.legal-error a {
  color: #37c673;
  text-decoration: underline;
}

/* ---------- Legal documents ---------- */

.legal-content {
  text-align: left;
  text-wrap: pretty;
  --base-heading-font-size: 1.4em;
  line-height: var(--base-heading-font-size);
}

.legal-content h2,
.legal-content h5 {
  font-weight: 400;
}

.legal-content h1 {
  font-size: calc(var(--base-heading-font-size) * 1.25);
}

.legal-content h2 {
  font-size: var(--base-heading-font-size);
}

.legal-content h3 {
  font-size: calc(var(--base-heading-font-size) * 0.85);
}

.legal-content h4 {
  font-size: calc(var(--base-heading-font-size) * 0.75);
}

.legal-content ul,
.legal-content ol,
.legal-content p:not(.text-white) {
  color: #adb0bb;
}

.legal-content ul,
.legal-content ol {
  margin: 0 0 1rem 0.25em;
}

.legal-content ul:last-child,
.legal-content ol:last-child {
  margin-bottom: 0;
}

.legal-content ul li,
.legal-content ol li {
  line-height: 1.3;
}

.legal-content ul li + li,
.legal-content ol li + li {
  margin-top: 0.5rem;
}

.legal-content ul li ul,
.legal-content ol li ul {
  margin-top: 0.5rem;
}

/* Check mark lists */
.legal-content ul {
  list-style: none;
  padding-left: 0;
}

.legal-content ul li {
  position: relative;
  padding-left: 1.75rem;
}

.legal-content ul li:before {
  content: "";
  position: absolute;
  left: 0rem;
  top: 0.35rem;
  border: solid #37c673;
  border-width: 0 0 2px 2px;
  display: inline-block;
  width: 1rem;
  height: 0.5rem;
  transform: rotate(-45deg);
}

.legal-content ol {
  padding-left: 1.2rem;
}

.legal-content ol > li {
  list-style: decimal;
}

.legal-content a {
  color: #37c673;
  text-decoration: underline;
}

.legal-content a:hover {
  color: #54db8c;
}

/* Headings with a numbered green circle */
.legal-numbered {
  counter-increment: headingNo;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.legal-numbered span {
  flex: 1;
}

.legal-numbered:before {
  content: counter(headingNo);
  width: calc(var(--base-heading-font-size) * 1.5);
  height: calc(var(--base-heading-font-size) * 1.5);
  border-radius: 2rem;
  background-color: #37c673;
  color: #131417;
  display: inline-block;
  text-align: center;
  line-height: calc(var(--base-heading-font-size) * 1.5);
  font-size: calc(var(--base-heading-font-size) * 0.5);
  vertical-align: middle;
  align-self: flex-start;
}

.legal-row + .legal-row {
  margin-top: 1rem;
}

.legal-row br {
  display: none;
}

/* Rewards section of the Pakistan refund policy */
.legal-section-heading {
  margin-top: 40px;
}

.legal-reward {
  padding-inline: 0.625rem;
}

.legal-reward ol {
  list-style: revert-layer;
}

.legal-reward li:has(strong.legal-policy-heading)::marker {
  color: white;
  font-size: 1.25rem;
  font-weight: bold;
}

.legal-reward .legal-policy-heading {
  display: block;
  font-size: 1.25rem;
  color: white;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

.legal-reward ol > li {
  line-height: 1.6rem;
}

/* ---------- FAQs ---------- */

.legal-faq-heading {
  font-size: 1.5em;
  margin: 1.5rem 0 0.5rem;
  font-weight: 500;
}

.legal-faq-heading:first-child {
  margin-top: 0;
}

.legal-faq {
  border-radius: 5px;
  background-color: #1c1e22;
}

.legal-faq + .legal-faq {
  margin-top: 1rem;
}

.legal-faq h3 {
  padding: 1rem;
  font-size: 1.1em;
  line-height: 1;
  margin: 0;
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  -webkit-user-select: none;
  user-select: none;
  gap: 1rem;
  vertical-align: top;
  font-weight: 500;
  color: #aaadb4;
}

.legal-faq h3 span {
  flex: 1;
}

.legal-faq ul > li {
  list-style: disc;
}

.legal-faq-answer {
  padding: 0 1rem 1rem;
  color: #aaadb4;
  font-weight: 300;
  font-size: 0.95em;
}

.legal-faq-answer ul {
  padding-inline-start: 1rem;
  margin-block-end: 0;
}

.legal-faq-answer ul li + li {
  margin-block-start: 0.5rem;
}

.legal-faq-answer ul + p {
  margin-top: 0.5rem;
}
