/* Log in, sign up, Terms and Privacy. Light or Dark from the phone's or computer's own setting, as the chart page. */
:root {
  color-scheme: light;
  --bg: #ffffff; --text: #131722; --dim: #5d606b; --line: #d1d4dc; --field: #ffffff; --soft: #f0f3fa;
  --accent: #2962ff; --accent-text: #1e53e5; --error-bg: #fdecee; --error: #b22833;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #000000; --text: #f0f3fa; --dim: #9a9da8; --line: #363a45; --field: #0f0f0f; --soft: #1c1f27;
    --accent: #2962ff; --accent-text: #7ba1ff; --error-bg: #2d1417; --error: #ff9aa3;
  }
}
* { box-sizing: border-box; scrollbar-width: thin; scrollbar-color: rgba(120, 123, 134, 0.45) transparent; }
[hidden] { display: none !important; }
/* the height as percent, not vh: an installed app on Android may count 100vh taller than its window */
html { height: 100%; }
body {
  margin: 0; min-height: 100%; background: var(--bg); color: var(--text);
  font: 400 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu, sans-serif;
}
a { color: var(--accent-text); text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* log in and sign up: the brand's panel beside the form; the form alone on phones and narrow windows */
body[data-page] { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.hero {
  position: sticky; top: 0; height: 100vh; overflow: hidden; display: flex; flex-direction: column;
  background: #0b1f5c; color: #ffffff; padding: 48px 0 0 56px;
}
.tagline { margin: 56px 0 0; padding-right: 48px; min-height: 2.2em; max-width: 12em; font-size: clamp(36px, 4.2vw, 60px); font-weight: 650;
  line-height: 1.1; letter-spacing: -0.025em; text-wrap: balance; }
.hero-art { display: block; flex: 1; min-height: 0; width: 100%; margin-top: 24px; object-fit: cover; object-position: left bottom; }
.panel { display: flex; flex-direction: column; align-items: center;
  padding: max(32px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom)); }
.card { width: 100%; max-width: 380px; margin: auto; }
.brand-head { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-logo { display: block; border-radius: 10px; }
.app-name { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; }
h1 { margin: 0; font-size: 30px; font-weight: 650; line-height: 1.2; letter-spacing: -0.02em; text-wrap: balance; }
.sub { margin: 8px 0 28px; color: var(--dim); }
/* Google's button is a page of its own in light colours: "light" here, or the browser puts a white box behind it */
.google { display: flex; min-height: 44px; color-scheme: light; }
.busy .google { opacity: 0.45; pointer-events: none; }
.notice { margin: 32px 0 0; min-height: 1.5em; color: var(--dim); font-size: 13px; text-align: center; }
.switch-page { margin: 28px 0 0; }
.links { margin: 8px 0 0; color: var(--dim); font-size: 13px; }

form label { display: block; margin: 0 0 6px; font-size: 14px; font-weight: 550; }
.optional { color: var(--dim); font-weight: 400; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
#signup > label { margin-top: 18px; }
input:not([type="radio"]) {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--field); color: var(--text); font: inherit; font-size: 16px;   /* under 16px an iPhone zooms the page in */
}
input:not([type="radio"])::placeholder { color: var(--dim); }
input:not([type="radio"]):focus { border-color: var(--accent); outline: 1px solid var(--accent); outline-offset: 0; }
fieldset { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0 24px; padding: 0; border: 0; }
legend { margin-bottom: 6px; padding: 0; font-size: 14px; font-weight: 550; }
form .radio { display: flex; align-items: center; gap: 10px; height: 46px; margin: 0; padding: 0 14px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 10px; font-size: 15px; font-weight: 400; }
.radio input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.radio:has(input:checked) { border-color: var(--accent); background: var(--soft); }
.step { margin: 0 0 14px; color: var(--dim); overflow-wrap: anywhere; }
.primary { width: 100%; height: 46px; border: 0; border-radius: 23px; background: var(--accent); color: #ffffff;
  font: inherit; font-weight: 600; cursor: pointer; }
.primary:hover { background: #1e53e5; }
.busy .primary { opacity: 0.6; pointer-events: none; }
.staff-login { margin-top: 24px; }
.staff-login summary { cursor: pointer; color: var(--dim); font-size: 14px; }
.pw-form { display: flex; flex-direction: column; gap: 12px; margin-top: 14px; }

.note { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 18px 0 0; padding: 12px 14px; border-radius: 10px;
  background: var(--soft); font-size: 14px; }
.note.error { background: var(--error-bg); color: var(--error); }
.busy .note::before { content: ""; width: 16px; height: 16px; border: 2px solid var(--line); border-top-color: var(--accent);
  border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy .note::before { animation-duration: 3s; } }

/* Terms and Privacy */
.doc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; max-width: 1080px;
  margin: 0 auto; padding: max(20px, env(safe-area-inset-top)) 24px 20px; }
.doc-head nav { display: flex; gap: 22px; font-size: 14px; }
.doc-head nav a { padding: 6px 0; color: var(--dim); text-decoration: none; }
.doc-head nav a:hover, .doc-head nav a[aria-current] { color: var(--text); }
.doc-head nav a[aria-current] { font-weight: 600; }
.doc { max-width: 708px; margin: 0 auto; padding: 48px 24px 96px; }
.doc h1 { font-size: clamp(32px, 5vw, 44px); }
.doc-body { margin-top: 24px; font-size: 16px; line-height: 1.65; overflow-wrap: break-word; }
.doc-body h2 { margin: 40px 0 8px; font-size: 20px; font-weight: 650; line-height: 1.3; letter-spacing: -0.01em; }
.doc-body p { margin: 0 0 14px; }
.doc-body ul { margin: 0 0 14px; padding-left: 22px; }
.doc-body li { margin: 6px 0; }

/* Phones, and narrow or upright windows: the brand's area on top, the form on a sheet over its lower edge */
@media (max-width: 640px), (max-width: 1000px) and (orientation: portrait) {
  body[data-page] { display: flex; flex-direction: column; }
  .hero { position: relative; flex: 1 0 auto; height: auto; min-height: 330px; padding: max(24px, env(safe-area-inset-top)) 24px 0; }
  .tagline { position: relative; z-index: 1; margin-top: 28px; padding: 0; max-width: 8em; font-size: 34px; }
  .hero-art { position: absolute; left: 0; bottom: -14px; flex: none; width: 100%; height: auto; max-height: 62%; margin: 0; object-fit: cover;
    object-position: right bottom; }
  .panel { position: relative; z-index: 2; flex: none; margin-top: -24px; padding: 32px 24px max(20px, env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0; background: var(--bg); }
  .card { margin: 0 auto; max-width: 400px; }
  h1 { font-size: 26px; }
  .sub { margin: 6px 0 22px; }
  .switch-page { margin-top: 22px; }
  .notice { margin-top: 22px; }
  /* sign up has a long form: the name and the headline only */
  body[data-page="signup"] .hero { min-height: 0; padding-bottom: 48px; }
  body[data-page="signup"] .hero-art { display: none; }
  body[data-page="signup"] .tagline { margin-top: 20px; min-height: 1.1em; max-width: none; font-size: 26px; }
}
/* ... in Dark the sheet has the colour of Android's own bar under it, as the chart page's tabs (tv-drawings.js) */
@media (prefers-color-scheme: dark) and (max-width: 640px), (prefers-color-scheme: dark) and (max-width: 1000px) and (orientation: portrait) {
  :root { --bg: #131313; --field: #1c1c1c; --soft: #24262d; }
}

/* /plans: wider than the Terms, the cards side by side */
.plans-doc { max-width: 1240px; }
.plans-sub { margin: 8px 0 28px; color: var(--dim); }
