/*
 * The page where a list is typed in for a TV. It is a light page (Lumdrit,
 * 15.11.2026: a first version in the dark look of the app was "too dark,
 * all of it"): the colours of the app's design as a soft, bright
 * background, white panes, dark lettering. Good and clear for the eye.
 *
 * The page can be switched to dark and back with the sign at the top
 * right (mode.js, site.js); the choice stays in the browser. Light is what
 * a visitor gets first.
 *
 * THE DESIGN stands in one place: the blocks ":root" and ".backdrop" below,
 * each once for light and once for dark. Today those are the colours of Polarlicht, the design
 * the app starts with, in a light version. Once Lumdrit and his father have chosen, these two blocks take the
 * values of the chosen design (app/css/tokens.css and designs.css); nothing
 * else on this page names a colour.
 *
 * Unlike the app this page runs in ordinary browsers on phones and PCs, so
 * it may use what a TV cannot afford: round gradients and blur.
 */

/* ---------- the faces of the app, handed out by the server from app/fonts ---------- */

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin-400-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin-600-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin-ext-400-normal.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(fonts/atkinson-hyperlegible-next-latin-ext-600-normal.woff2) format("woff2");
  unicode-range: U+0100-02AF, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Red Hat Display";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url(fonts/red-hat-display-latin-900-normal.woff2) format("woff2");
}

/* ---------- THE DESIGN: Polarlicht, light ---------- */

:root {
  --bg: #EAF0FA;
  --text: #0E1730;
  --muted: rgba(14, 23, 48, 0.72);
  --dim: rgba(14, 23, 48, 0.50);

  /* Panes: nearly white, the background shines through a little; a light rim and a soft shadow lift them. */
  --pane: rgba(255, 255, 255, 0.76);
  --rim: rgba(255, 255, 255, 0.95);
  --shadow: 0 14px 36px rgba(24, 44, 96, 0.13);
  --well: rgba(255, 255, 255, 0.90);
  --well-rim: rgba(14, 23, 48, 0.16);
  --line: rgba(14, 23, 48, 0.10);

  /* The accent marks what is to be pressed. On a light ground it is a full blue, with white lettering on it. */
  --accent: #2468E0;
  --accent-ink: #FFFFFF;
  --wave: #5E86C4;

  --ok: #178F4F;
  --warn: #B86A00;
  --bad: #CF3532;
}

/* The background of the design: its four lights, soft and bright, on a nearly white sky. Standing still. */
.backdrop {
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background:
    radial-gradient(70% 50% at 10% 0%, rgba(28, 222, 196, 0.40), rgba(28, 222, 196, 0) 70%),
    radial-gradient(70% 60% at 96% 4%, rgba(92, 104, 255, 0.34), rgba(92, 104, 255, 0) 70%),
    radial-gradient(70% 55% at 4% 100%, rgba(214, 76, 240, 0.24), rgba(214, 76, 240, 0) 70%),
    radial-gradient(60% 50% at 100% 80%, rgba(60, 170, 255, 0.34), rgba(60, 170, 255, 0) 70%),
    linear-gradient(180deg, #F4F8FE 0%, #E6EEFA 100%);
}

/* ---------- THE DESIGN: Polarlicht, dark, as in the app ---------- */

:root[data-mode="dark"] {
  --bg: #050A18;
  --text: #F4F6FA;
  --muted: rgba(244, 246, 250, 0.78);
  --dim: rgba(244, 246, 250, 0.52);

  --pane: linear-gradient(140deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 55%, rgba(255, 255, 255, 0.09)), rgba(9, 15, 34, 0.62);
  --rim: rgba(255, 255, 255, 0.26);
  --shadow: none;
  --well: rgba(3, 7, 20, 0.46);
  --well-rim: rgba(255, 255, 255, 0.18);
  --line: rgba(255, 255, 255, 0.14);

  --accent: #7CC0FF;
  --accent-ink: #06101F;
  --wave: #6583A3;

  --ok: #3CCB7F;
  --warn: #F5A524;
  --bad: #F0524F;
}

:root[data-mode="dark"] .backdrop {
  background:
    radial-gradient(70% 50% at 12% 0%, rgba(28, 222, 196, 0.50), rgba(28, 222, 196, 0) 70%),
    radial-gradient(70% 60% at 96% 6%, rgba(92, 104, 255, 0.58), rgba(92, 104, 255, 0) 70%),
    radial-gradient(70% 55% at 6% 100%, rgba(214, 76, 240, 0.40), rgba(214, 76, 240, 0) 70%),
    radial-gradient(60% 50% at 100% 78%, rgba(60, 170, 255, 0.42), rgba(60, 170, 255, 0) 70%),
    linear-gradient(180deg, #030918 0%, #07122E 55%, #040A1C 100%);
}

/* ---------- everything below takes its colours from the design ---------- */

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
  color: var(--text);
  font-family: "Atkinson Hyperlegible Next", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 28px 18px 56px;
}

main {
  max-width: 560px;
  margin: 0 auto;
}

/*
 * The switch on top: "my devices" or "new list". On a phone it shows one of
 * the two parts, so nobody scrolls past one to reach the other. It looks
 * like the switch between address and login: two halves, the chosen one
 * filled.
 */
.tabs {
  display: flex;
  margin: 0 0 18px;
  padding: 5px;
  border: 1px solid var(--rim);
  border-radius: 18px;
  background: var(--pane);
  box-shadow: var(--shadow);
}

.tab {
  flex: 1 1 0;
  min-height: 48px;
  padding: 10px 8px;
  border: 0;
  border-radius: 13px;
  background: none;
  color: var(--muted);
  font-size: 18px;
  font-weight: 600;
}

.tab.is-on {
  background: var(--accent);
  color: var(--accent-ink);
}

@media (max-width: 999px) {
  body.show-send #devices,
  body.show-devices #form {
    display: none;
  }

  /* The switch says what the part is; its own heading need not say it again. */
  #devices-title,
  #form-title {
    display: none;
  }

  .head {
    justify-content: flex-end;
  }

  /* On a phone a saved overview is brought back in the part "my devices". */
  #load-file-first {
    display: none;
  }
}

/* A wide screen needs no switch: with devices to show it puts them beside the form, without it shows the form alone. */
@media (min-width: 1000px) {
  .tabs {
    display: none;
  }

  body:not(.has-devices) #devices {
    display: none;
  }

  body.has-devices main {
    max-width: 1120px;
  }

  body.has-devices .cols {
    display: flex;
    align-items: flex-start;
  }

  body.has-devices .cols > * {
    flex: 1 1 0;
    min-width: 0;
  }

  body.has-devices #devices {
    margin-right: 24px;
  }
}

/* ---------- the head ---------- */

header {
  position: relative;
}

/* The sign for light or dark, at the top right: round, as large as a thumb needs. */
.mode {
  position: absolute;
  right: 0;
  top: 0;
  width: 48px;
  height: 48px;
  padding: 11px;
  border: 1px solid var(--well-rim);
  border-radius: 50%;
  background: var(--well);
  color: var(--text);
}

.mode svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The moon leads to dark, the sun back to light: only the one that applies is shown. */
.mode .mode-sun,
:root[data-mode="dark"] .mode .mode-moon {
  display: none;
}

:root[data-mode="dark"] .mode .mode-sun {
  display: block;
}

.mark {
  display: block;
  width: 230px;
  height: auto;
  margin: 4px 0 18px -14px;
}

.mark text {
  fill: var(--text);
  font-family: "Red Hat Display", "Atkinson Hyperlegible Next", sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.mark-tail {
  fill-opacity: 0.62;
}

.mark-wave {
  fill: var(--wave);
}

.intro {
  margin: 0 0 26px;
  max-width: 560px;
  color: var(--text);
  font-size: 20px;
}

/* ---------- panes ---------- */

.pane {
  margin: 0 0 24px;
  padding: 24px 22px 26px;
  border: 1px solid var(--rim);
  border-radius: 24px;
  background: var(--pane);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(22px);
  backdrop-filter: blur(22px);
}

h2 {
  margin: 0 0 18px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
}

.head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

/* ---------- the form ---------- */

fieldset {
  margin: 0 0 22px;
  padding: 0 0 22px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

legend {
  padding: 0;
  font-weight: 600;
}

label {
  display: block;
  margin: 18px 0 7px;
  color: var(--muted);
  font-size: 16px;
}

input:not([type="radio"]):not([type="checkbox"]):not([type="file"]) {
  display: block;
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid var(--well-rim);
  border-radius: 14px;
  background: var(--well);
  color: var(--text);
  font: inherit;
}

input::placeholder {
  color: var(--dim);
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ID and key are read off a TV and typed in: wide signs, easy to compare. */
#number,
#key {
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Address or login: two halves of one switch, the chosen one filled. */
.kinds {
  display: flex;
  padding: 5px;
  border: 1px solid var(--well-rim);
  border-radius: 16px;
  background: var(--well);
}

.seg {
  flex: 1 1 0;
  margin: 0;
  color: var(--text);
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
}

.seg span {
  display: block;
  padding: 11px 8px;
  border-radius: 12px;
  color: var(--muted);
}

.seg input:checked + span {
  background: var(--accent);
  color: var(--accent-ink);
}

.seg input:focus-visible + span {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.known {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  font-weight: 600;
}

.remember {
  margin-top: 24px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.check {
  display: flex;
  align-items: center;
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
}

.check input {
  flex: none;
  width: 22px;
  height: 22px;
  margin: 0 12px 0 0;
  accent-color: var(--accent);
}

/* ---------- buttons: one main one, small ones with a rim, quiet ones as words ---------- */

button {
  font: inherit;
  cursor: pointer;
}

button.main {
  display: block;
  width: 100%;
  min-height: 56px;
  margin-top: 26px;
  padding: 14px;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  font-size: 19px;
}

button.main:disabled {
  opacity: 0.5;
  cursor: default;
}

button.small {
  margin: 0 10px 0 0;
  padding: 8px 14px;
  border: 1px solid var(--well-rim);
  border-radius: 12px;
  background: none;
  color: var(--text);
  font-size: 16px;
}

button.small.is-accent {
  border-color: var(--accent);
  color: var(--accent);
}

button.quiet {
  margin: 0;
  padding: 6px 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 16px;
}

button:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

.state {
  min-height: 26px;
  margin: 16px 0 0;
}

.state.is-ok {
  color: var(--ok);
}

.state.is-bad,
.hint.is-bad {
  color: var(--bad);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 15px;
}

/* ---------- the devices a user remembered in this browser ---------- */

/* One TV: its name and ID, below them the lists that were sent to it from here. */
.device {
  margin-bottom: 14px;
  padding: 16px 18px;
  border: 1px solid var(--well-rim);
  border-radius: 18px;
  background: var(--well);
}

.device-name {
  font-size: 20px;
  font-weight: 600;
}

.device-id {
  color: var(--dim);
  font-size: 15px;
  letter-spacing: 0.06em;
}

.list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.list-name {
  font-weight: 600;
}

/* How a list stands: always a colour and words, as in the app. */
.status {
  display: flex;
  align-items: center;
  margin: 4px 0 10px;
  color: var(--muted);
  font-size: 16px;
}

.dot {
  flex: none;
  width: 12px;
  height: 12px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--dim);
}

.status.is-ok {
  color: var(--text);
}

.status.is-warn {
  color: var(--warn);
}

.status.is-bad {
  color: var(--bad);
}

.is-ok .dot {
  background: var(--ok);
}

.is-warn .dot {
  background: var(--warn);
}

.is-bad .dot {
  background: var(--bad);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

.device > .actions {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.device > .actions .quiet {
  margin-left: auto;
  color: var(--muted);
}

.backup {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
}

/* ---------- what is said at the foot ---------- */

.notes {
  padding: 0 4px;
  color: var(--muted);
  font-size: 15px;
}

.notes p {
  margin: 0 0 10px;
}

a {
  color: var(--accent);
}

a:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

/* ---------- a page to read: the privacy statement ---------- */

.doc main {
  max-width: 720px;
}

.doc header a {
  display: inline-block;
}

/* The languages of the page, at the top right, where the main page has its sign for light and dark. */
.languages {
  position: absolute;
  right: 0;
  top: 14px;
  font-size: 16px;
}

.languages a {
  margin-left: 14px;
  color: var(--muted);
  text-decoration: none;
}

.languages a.is-on {
  color: var(--text);
  font-weight: 600;
}

.doc h1 {
  margin: 0 0 14px;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.15;
}

.doc .lead {
  margin: 0 0 8px;
  font-size: 20px;
}

.doc h2 {
  margin: 30px 0 10px;
  font-size: 22px;
}

.doc p,
.doc ul {
  margin: 0 0 12px;
}

.doc ul {
  padding-left: 22px;
}

.doc li {
  margin: 0 0 8px;
}

.doc .operator {
  line-height: 1.5;
}

.doc .hint {
  margin-top: 26px;
}

.doc h2 + .hint {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}
