/*
 * The look of every page on playades.app: the privacy policy, the terms, the
 * delete-account page and the report form. One file so they cannot drift apart.
 *
 * The colours are the app's own Screen set (`src/constants/palettes.ts`), light
 * and dark, so a page opened from the app looks like the app. The typeface is
 * the app's too, Schibsted Grotesk, served from this site rather than from a
 * font service: a privacy policy that sends every reader's address to a third
 * party just to draw its letters would contradict itself.
 */

@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/SchibstedGrotesk_400Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/SchibstedGrotesk_600SemiBold.ttf') format('truetype');
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: 'Schibsted Grotesk';
  src: url('/fonts/SchibstedGrotesk_700Bold.ttf') format('truetype');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #F7F7FA;
  --panel: #ECECF1;
  --text: #1B1C1F;
  --muted: #6C6D73;
  --accent: #0B63CE;
  --border: #D8D8DF;
  --danger: #D93025;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1D21;
    --panel: #26272C;
    --text: #F5F5F7;
    --muted: #A2A3AA;
    --accent: #6FA8FF;
    --border: #3A3B41;
    --danger: #FF6B6B;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 20px 96px;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 'Schibsted Grotesk', sans-serif;
  -webkit-text-size-adjust: 100%;
}

main { max-width: 42rem; margin: 0 auto; }
header { padding: 72px 0 8px; }

h1 { font-size: 34px; line-height: 1.15; font-weight: 700; margin: 0 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 22px; line-height: 1.3; font-weight: 700; margin: 56px 0 12px; scroll-margin-top: 24px; }
h3 { font-size: 17px; line-height: 1.4; font-weight: 600; margin: 28px 0 6px; }

p, li, td { color: var(--muted); }
.stamp { font-size: 15px; margin: 0; }

strong { color: var(--text); font-weight: 600; }
a { color: var(--accent); }
a:hover { text-decoration: none; }

ul { padding-left: 20px; }
li { margin: 6px 0; }

.summary {
  background: var(--panel);
  border-radius: 20px;
  padding: 20px 24px;
  margin: 32px 0 8px;
}
.summary ul { margin: 0; }
.summary li { color: var(--text); margin: 10px 0; }

.toc { font-size: 15px; margin: 28px 0 0; padding: 0; list-style: none; columns: 2; column-gap: 24px; }
.toc li { margin: 2px 0; break-inside: avoid; }

.table { overflow-x: auto; margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
th { text-align: left; font-weight: 600; color: var(--text); padding: 8px 12px 8px 0; border-bottom: 1px solid var(--border); vertical-align: bottom; }
td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--border); vertical-align: top; }

/*
 * Sections that open and close. The row shows the heading and a one-line
 * answer, so the page reads complete when everything is closed, and the
 * details sit underneath for whoever wants them.
 */
.sections { margin: 40px 0 0; border-top: 1px solid var(--border); }
.sections details { border-bottom: 1px solid var(--border); }
.sections summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 36px 18px 0;
  position: relative;
}
.sections summary::-webkit-details-marker { display: none; }
.sections summary::after {
  content: '';
  position: absolute;
  right: 6px;
  top: 26px;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}
.sections details[open] summary::after { transform: rotate(-135deg); top: 30px; }
.sections summary h2 { font-size: 19px; line-height: 1.35; margin: 0; }
.sections summary .answer { display: block; margin: 4px 0 0; font-size: 15px; line-height: 1.45; color: var(--muted); }
.sections .body { padding: 0 0 20px; }
.sections .body > :first-child { margin-top: 0; }
.sections h3 { margin-top: 20px; }

.intro { font-size: 18px; line-height: 1.55; color: var(--text); margin: 24px 0 0; }

/* The report page (playades.app/report): the same panels and colours as the pages. */

/* The two cards that pick a form. */
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 32px 0 0; }
.choice {
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--panel);
  border-radius: 16px;
  padding: 16px;
  cursor: pointer;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.45;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice strong { display: block; color: var(--text); font-size: 17px; margin: 0 0 2px; }
.choice:has(input:checked) { box-shadow: inset 0 0 0 2px var(--accent); }
.choice:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

.form { margin: 28px 0 40px; }
/* The field styles below set `display`, which would otherwise beat `hidden`. */
.form [hidden] { display: none !important; }
.form .notice-head { margin: 0 0 22px; }
.form .notice-head h2 { font-size: 22px; margin: 0; }
.form .notice-head p { color: var(--muted); margin: 2px 0 0; }
.form .check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--panel);
  border-radius: 16px;
  padding: 14px 16px;
  margin: 0 0 10px;
  cursor: pointer;
  color: var(--muted);
}
.form .check input { margin: 5px 0 0; accent-color: var(--accent); flex: none; }
.form .field { display: block; margin: 0 0 18px; }
.form .field > span { display: block; font-size: 15px; font-weight: 600; color: var(--text); margin: 0 0 6px; }
.form .field em { font-style: normal; font-weight: 400; color: var(--muted); }
.form .field small { display: block; font-size: 15px; color: var(--muted); margin: -4px 0 8px; }
.form .field small.count { text-align: right; margin: 6px 0 0; }
.form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form input:not([type]), .form input[type='email'], .form textarea {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
}
.form textarea { resize: vertical; }

/* Tap choices, like the app's Report sheet. */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; position: relative; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: block;
  font-size: 15px;
  color: var(--text);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 14px;
}
.chips input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.form .trap { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.form button {
  font: inherit;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 999px;
  padding: 12px 24px;
  cursor: pointer;
}
.form button:disabled { opacity: 0.5; cursor: default; }
/* An action that cannot be undone: deleting an account. */
.form button.danger { background: var(--danger); }
.form .result { color: var(--text); margin: 16px 0 0; }
.form .check:last-of-type { margin-bottom: 24px; }
/* Send pressed with something needed left out: that box lights up red, with
   an asterisk, until it's filled in. */
.form .check.missing { box-shadow: inset 0 0 0 2px var(--danger); color: var(--text); }
.form .check.missing span::after,
.form .field.missing > span::after { content: ' *'; color: var(--danger); font-weight: 700; }
.form .field.missing input, .form .field.missing textarea { border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.form .field.missing .chips span { border-color: var(--danger); }

/* Help & support: one button or link per topic. A link leaves for its own page. */
.topics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 28px 0; }
.topic {
  display: block;
  text-align: left;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: var(--panel);
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  cursor: pointer;
  text-decoration: none;
}
.topic.chosen { box-shadow: inset 0 0 0 2px var(--accent); }
a.topic::after { content: ' \203A'; color: var(--muted); }

/* "If someone is in danger", under the form. */
.help { background: var(--panel); border-radius: 16px; padding: 4px 20px; margin: 0 0 32px; }
.help h2 { font-size: 17px; margin: 16px 0 0; }
.help ul { padding-left: 20px; }

@media (max-width: 480px) {
  .choices, .form .pair, .topics { grid-template-columns: 1fr; }
  body { font-size: 16px; }
  header { padding-top: 48px; }
  h1 { font-size: 28px; }
  h2 { font-size: 20px; margin-top: 44px; }
  .summary { padding: 16px 18px; border-radius: 16px; }
  .toc { columns: 1; }
}
