/* web/src/static/style.css — the account pages (sign in, access code, recover, the account, the phone
   step, the Terms): dark, in the look of the public page (team.css has the tokens, the robots and the
   mark; a page links it first). Here: the header, the footer, the card, the field, the buttons, the
   fold of the account. funnel.css has the three steps of the funnel and their pictures.
   /phone/frame is the one page with a light side: it stands in the console's frame, with no team.css,
   in the console's own light and dark (the class "in-frame").
   Colour only at dot size. No inline style anywhere: the CSP is style-src 'self', font-src 'self'. */

@font-face { font-family: "Geist"; src: url("/static/geist-1.7.1.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("/static/geist-mono-1.7.1.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }

:root {
  color-scheme: light dark;
  --bg-0: #f3f3f3; --bg-1: #ffffff; --bg-2: #f3f3f3; --bg-3: #ececec;
  --line: #0000000f; --line-2: #0000001c;
  --ink-0: #171717; --ink-1: #5c5c5c; --ink-2: #8f8f8f;
  --inv: #171717; --inv-ink: #ffffff; --inv-hover: #383838;
  --shadow: 0 1px 2px #0000000a, 0 0 0 1px #0000000f;
  --ok: #1d8a3d; --err: #d42a2a; --warn: #b06d00; --run: #5c5c5c; --idle: #b0b0b0;
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --text-xs: 12px; --text-sm: 13px; --text-base: 14px; --text-lg: 16px; --text-xl: 20px;
  --radius-sm: 7px; --radius: 12px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg-0: #0a0a0a; --bg-1: #111112; --bg-2: #1b1b1c; --bg-3: #1e1e1f;
    --line: #ffffff12; --line-2: #ffffff21;
    --ink-0: #ededed; --ink-1: #a3a3a3; --ink-2: #6e6e6e;
    --inv: #ededed; --inv-ink: #0a0a0a; --inv-hover: #d4d4d4;
    --shadow: 0 0 0 1px #ffffff10;
    --ok: #3fb35a; --err: #f05252; --warn: #e5a23a; --run: #a3a3a3; --idle: #5a5a5a;
  }
}
/* A page in the console's frame (/phone/frame) takes the console's theme, not the device's: its
   script writes data-theme from the frame's address. The same colours as above, by name. */
:root[data-theme="light"] {
  color-scheme: light;
  --bg-0: #f3f3f3; --bg-1: #ffffff; --bg-2: #f3f3f3; --bg-3: #ececec;
  --line: #0000000f; --line-2: #0000001c;
  --ink-0: #171717; --ink-1: #5c5c5c; --ink-2: #8f8f8f;
  --inv: #171717; --inv-ink: #ffffff; --inv-hover: #383838;
  --shadow: 0 1px 2px #0000000a, 0 0 0 1px #0000000f;
  --ok: #1d8a3d; --err: #d42a2a; --warn: #b06d00; --run: #5c5c5c; --idle: #b0b0b0;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg-0: #0a0a0a; --bg-1: #111112; --bg-2: #1b1b1c; --bg-3: #1e1e1f;
  --line: #ffffff12; --line-2: #ffffff21;
  --ink-0: #ededed; --ink-1: #a3a3a3; --ink-2: #6e6e6e;
  --inv: #ededed; --inv-ink: #0a0a0a; --inv-hover: #d4d4d4;
  --shadow: 0 0 0 1px #ffffff10;
  --ok: #3fb35a; --err: #f05252; --warn: #e5a23a; --run: #a3a3a3; --idle: #5a5a5a;
}

/* The small grey of the public page (4.5:1 on the page). */
:root[data-theme="dark"]:not(.in-frame) { --ink-2: var(--ink2); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  background: var(--bg-0); color: var(--ink-0);
  font: 400 var(--text-base)/1.5 var(--font-sans); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button, input { font-family: inherit; }
b, strong { font-weight: 600; }

/* "Test mode: no real payment": one quiet line on top, an amber dot (amber = waiting). */
.banner {
  display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0;
  padding: max(7px, env(safe-area-inset-top)) 16px 7px; background: var(--bg-1); border-bottom: 1px solid var(--line);
  color: var(--ink-1); font-size: var(--text-xs); line-height: 1.4;
}
.banner::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }

/* The frame of each page, on the edges of the public page: the header line with the mark (and the
   step rail, funnel.css), the footer with the two links. */
.wrap { width: min(1080px, 100%); margin: 0 auto; padding: 0 24px; }
@media (max-width: 760px) { .wrap { padding: 0 20px; } }
.ftop { flex: none; border-bottom: 1px solid var(--line); }
.ftop .wrap { display: flex; align-items: center; gap: 14px; height: 60px; }
.foot { flex: none; padding-bottom: env(safe-area-inset-bottom); }
.foot .wrap { display: flex; align-items: center; gap: 22px; height: 76px; font-size: var(--text-base); }
.foot a { color: var(--ink-2); text-decoration: none; }
@media (hover: hover) { .foot a:hover { color: var(--ink-0); } }

/* One column of 380 px, as the console's first page; short pages stand in the middle. */
main {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  width: min(380px, 100%); margin: 0 auto;
  padding: 48px 16px max(56px, env(safe-area-inset-bottom));
}
main > * { margin: 0; }
main > * + * { margin-top: 10px; }

h1 { font-size: var(--text-xl); font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
main > p { color: var(--ink-1); }
main > p strong { color: var(--ink-0); overflow-wrap: anywhere; }
.muted, main > p.muted { color: var(--ink-2); font-size: var(--text-sm); }
main > .muted { margin-top: 12px; }

/* The line of who is signed in (the account page: the first line of its fold). */
p.sub { color: var(--ink-1); font-size: var(--text-sm); }

/* A section title of the account page: as a block title of Settings. */
h2 { margin-top: 32px; font-size: var(--text-sm); font-weight: 500; color: var(--ink-1); line-height: 1.4; }
main > h2 + * { margin-top: 8px; }
h3 { margin: 4px 0 0; font-size: var(--text-sm); font-weight: 500; }

/* The card: the panel of the console's first page. The form of a page, each block of the fold. */
.card, main > form, ul.keys {
  display: grid; gap: 12px; padding: 16px; border-radius: var(--radius);
  background: var(--bg-1); box-shadow: var(--shadow);
}
main > .card, main > form { margin-top: 20px; }
main > h2 + .card, main > h2 + ul.keys { margin-top: 8px; }
.card > *, form > *, #server > *, #server-actions > * { margin: 0; }
#server-actions { display: grid; gap: 10px; }
.card > p { color: var(--ink-1); }
.card > p strong { color: var(--ink-0); }

/* Fields: as the pairing field of the console. */
label { color: var(--ink-1); font-size: var(--text-sm); }
form > label + input { margin-top: -6px; }
input {
  width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--bg-0); color: var(--ink-0); outline: none; font: 400 var(--text-lg) var(--font-sans);
}
input:focus { border-color: var(--ink-2); }

/* Buttons: 40 px, radius 7. The first action is inverted; .quiet is the second one. */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; padding: 0 16px;
  border: 1px solid var(--inv); border-radius: var(--radius-sm); background: var(--inv); color: var(--inv-ink);
  font: 500 var(--text-base)/1 var(--font-sans); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color 0.12s, border-color 0.12s; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
@media (hover: hover) { button:hover:not(:disabled), .button:hover { background: var(--inv-hover); border-color: var(--inv-hover); } }
button.quiet, .button.quiet { background: var(--bg-1); border-color: var(--line-2); color: var(--ink-0); }
@media (hover: hover) { button.quiet:hover:not(:disabled), .button.quiet:hover { background: var(--bg-2); border-color: var(--line-2); } }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 2px; }
button:disabled { opacity: 0.45; cursor: default; }
/* Off until a state of the page: drawn off, not see-through. */
.button.off, .button.off:hover { border-color: var(--bg-3); background: var(--bg-3); color: var(--ink-2); cursor: default; }
button.small { height: 28px; padding: 0 10px; font-size: var(--text-sm); }
.card > button, .card > .button, form > button, #server-actions > button, #server-actions > .button { width: 100%; }
main > button { margin-top: 12px; align-self: flex-start; }

/* A row of actions: full width in a card, side by side below one. */
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions > button, .actions > .button { margin: 0; }
.card > .actions, #server-actions > .actions { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; }
.card > .actions.stack { grid-auto-flow: row; }

/* The status line under a step. An error line has data-tone="err" (set by the page scripts). */
.status { min-height: 21px; color: var(--ink-1); font-size: var(--text-sm); }
.status[data-tone="err"] { color: var(--err); }
main > .status { margin-top: 12px; }
/* The account page: an empty status line takes no room. */
#step-status:empty, .fold-body > #status:empty, #server-more > .status:empty { min-height: 0; margin-top: 0; }
#server[hidden], #server-more[hidden] { display: none; }
#server .status:empty, #server-steps:empty, #server-actions:empty { display: none; }

a { color: var(--ink-1); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2); }
/* Not a link drawn as a button: its colours are the button's, also under the pointer. */
@media (hover: hover) { a:not(.button):hover { color: var(--ink-0); } }
main > p:last-child:has(> a:only-child) { margin-top: 16px; font-size: var(--text-sm); }

/* Passkeys: rows of a Settings list. */
ul.keys { list-style: none; padding: 0 16px; gap: 0; }
ul.keys li { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 8px 0; font-size: var(--text-sm); color: var(--ink-0); }
ul.keys li + li { border-top: 1px solid var(--line); }

/* The delete question and its report. */
.warn { padding: 12px; border-radius: var(--radius-sm); background: var(--bg-0); box-shadow: inset 0 0 0 1px var(--line-2); color: var(--ink-0); }
#server-confirm { display: grid; gap: 8px; }
#server-confirm > button { width: 100%; }
ul.report { margin: 0; padding-left: 18px; color: var(--ink-1); font-size: var(--text-sm); }
#server-report { display: grid; gap: 6px; }

/* While its height changes softly (console.js), the console block shows no part outside it. */
#server.grow { overflow: clip; }

/* The fold of the account page (pages.ts accountFold): ONE closed line under the step, quiet; open, the things of the account in the order of the page before (Subscription, Server,
   Passkeys, Sessions). */
.fold > summary {
  display: flex; align-items: center; gap: 8px; width: fit-content; min-height: 40px; list-style: none;
  border-radius: var(--radius-sm); color: var(--ink-1); font-size: var(--text-sm); font-weight: 500; cursor: pointer;
  user-select: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.fold[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
@media (hover: hover) { .fold > summary:hover { color: var(--ink-0); } }
.fold > summary:focus-visible { outline: 2px solid var(--ink-1); outline-offset: 2px; }
.fold-body { display: flex; flex-direction: column; padding-top: 8px; }
.fold-body > *, #server-more > * { margin: 0; }
.fold-body > * + * { margin-top: 10px; }
.fold-body > p { color: var(--ink-1); }
.fold-body > p strong { color: var(--ink-0); overflow-wrap: anywhere; }
.fold-body > p.muted { margin-top: 12px; color: var(--ink-2); font-size: var(--text-sm); }
.fold-body > h2, .fold-body > #server-more { margin-top: 24px; }
.fold-body > h2 + * { margin-top: 8px; }
.fold-body .head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.fold-body > .head { margin-top: 22px; }
.fold-body .head > * { margin: 0; }
.fold-body > .head + *, #server-more > * + * { margin-top: 8px; }
.fold-body > .status { margin-top: 12px; }
#server-more { display: grid; }
.fold-body .head > .actions { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; }
@media (prefers-reduced-motion: no-preference) {
  .fold > summary { transition: color 0.12s; }
  .fold > summary::after { transition: transform 200ms var(--ease-out, ease); }
  .fold[open] > .fold-body { transition: opacity 220ms var(--ease-out, ease), transform 220ms var(--ease-out, ease); }
  @starting-style { .fold[open] > .fold-body { opacity: 0; transform: translateY(-4px); } }
}

@media (max-width: 480px) { main { padding-top: 32px; } }

/* The Terms and the Privacy Policy: a text to read, with the number of each clause at its left. */
main:has(.legal) { justify-content: flex-start; width: min(680px, 100%); }
.legal > * { margin: 0; }
.legal > h2 { margin-top: 32px; color: var(--ink-0); font-size: var(--text-lg); font-weight: 600; }
.legal > p { position: relative; margin-top: 10px; padding-left: 40px; color: var(--ink-1); overflow-wrap: anywhere; }
.legal .no { position: absolute; left: 0; color: var(--ink-2); font-size: var(--text-sm); line-height: 21px; }
.legal > ul { margin-top: 6px; padding-left: 58px; color: var(--ink-1); overflow-wrap: anywhere; }
.legal li + li { margin-top: 4px; }

/* "Add your phone" (the computer) and "Add this phone" (the phone): a group is one step of the card;
   the picture is DOM SVG (static/qr.js) on white, so a phone can read it in the dark theme too. */
.group { display: grid; gap: 12px; }
.group > * { margin: 0; }
.group > button { width: 100%; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.code { font-family: var(--font-mono); letter-spacing: 0.08em; color: var(--ink-1); }
.big-number { font: 600 48px/1.1 var(--font-mono); letter-spacing: 0.08em; text-align: center; color: var(--ink-0); }
.qr { display: block; width: min(100%, 240px); height: auto; margin: 0 auto; border-radius: 4px; }
/* The wait line before the picture: the console's state line (a small dot that pulses). */
.wait { display: flex; align-items: center; gap: 7px; color: var(--ink-1); font-size: var(--text-sm); }
.wait::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--run); }
@media (prefers-reduced-motion: no-preference) { .wait::before { animation: wait-pulse 1.6s ease-in-out infinite; } }
@keyframes wait-pulse { 50% { opacity: 0.3; } }
/* The time left of the picture: a thin bar under it, as wide as the picture. */
.bar {
  display: block; width: min(100%, 240px); height: 3px; margin: 0 auto; border: 0; border-radius: 2px;
  background: var(--line-2); color: var(--ink-1); overflow: hidden; -webkit-appearance: none; appearance: none;
}
.bar::-webkit-progress-bar { background: transparent; }
.bar::-webkit-progress-value { background: var(--ink-1); }
.bar::-moz-progress-bar { background: var(--ink-1); }
/* The number of the phone: two large boxes, one digit each. */
.digits { display: flex; justify-content: center; gap: 10px; }
.digits > input { width: 48px; height: 56px; padding: 0; text-align: center; font: 600 28px/1 var(--font-mono); }
/* A quiet link that is a button (it changes state, so it is no address). */
button.link, .group > button.link {
  width: auto; height: auto; padding: 0; justify-self: center; border: 0; border-radius: 2px; background: none;
  color: var(--ink-1); font: 400 var(--text-sm)/1.5 var(--font-sans); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--line-2);
}
@media (hover: hover) { button.link:hover:not(:disabled) { background: none; color: var(--ink-0); } }
/* An empty status line in the phone's card takes no row (as in #server). */
#phone-open > .status:empty { display: none; }
/* The title of the phone's passkey view (an h2 is small and grey by default). */
#joins > h2 { font-size: var(--text-lg); font-weight: 600; color: var(--ink-0); }
/* An author display rule beats [hidden]: the ids keep a hidden block hidden, and the computer's
   card while no view shows. */
#phone[hidden], #phone [hidden], #phone-open [hidden] { display: none; }

/* The same step inside the console's card (/phone/frame). The page is clear, so the card shows
   through. No column, no padding: the frame is the place. Each view fits the height that the
   console gives it (picture 340 px, number 180 px, finish 96 px), so the page never scrolls. The
   parts start at the left, as the lines of the console's card. */
html.in-frame, html.in-frame body { background: transparent; }
html.in-frame body { min-height: 0; }
html.in-frame main { width: 100%; padding: 0; justify-content: flex-start; }
#phone[data-mode="frame"] > * { margin: 0; }
#phone[data-mode="frame"] + .status:empty { min-height: 0; margin-top: 0; }
#phone[data-mode="frame"] :is(.qr, .bar) { margin: 0; }
#phone[data-mode="frame"] .digits { justify-content: flex-start; }
#phone[data-mode="frame"] .group > button { width: auto; justify-self: start; }
