/*
 * The customer-facing pages' stylesheet (issue #182): the trial page, the
 * billing-link pages and the error pages on the public listener.
 *
 * It mirrors telekin-site/src/styles/global.css (the product site at
 * telekin.ai): the tokens, .btn, .card, the focus outlines, the top bar
 * and the footer. Keep the two in sync: when the site's tokens or those
 * components change, change them here too. Only what the public pages need
 * is ported. Light only (color-scheme: light), no web fonts, no framework
 * and no third-party requests, like the site. The admin console does not
 * use this file; it keeps style.css.
 */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --line: #ebe6dc;
  --line-strong: #cfc9bd;
  --line-input: #8f897d;  /* 3.33:1 on --bg, 3.48:1 on --surface */
  --ink: #1d1b18;
  --ink-2: #4a463f;
  --ink-3: #6e695f;      /* muted text; check AA on --bg */
  --accent: #6b4fd8;
  --accent-ink: #ffffff;
  --serif: 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 10px;
  --max: 64rem;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1.0625rem/1.55 var(--sans); min-height: 100vh; display: flex; flex-direction: column; }
h1, h2, h3, .brand { font-family: var(--serif); font-weight: 600; line-height: 1.15; }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1rem; width: 100%; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Buttons. The pages' plain <button> and a.button look like the site's .btn. */
.btn, button, a.button { display: inline-block; font: inherit; font-weight: 600; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 8px; padding: .65rem 1.1rem; text-decoration: none; cursor: pointer; }
.btn:hover, button:hover, a.button:hover { filter: brightness(1.08); }
.btn.ghost { background: var(--surface); color: var(--accent); }

/* Top bar: the brand, linking to the product site (the site's TopBar). */
.bar { display: flex; align-items: center; padding-top: 1rem; padding-bottom: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .5rem; font-size: 1.3rem; color: var(--ink); text-decoration: none; }
.brand img { width: 1.6rem; height: 1.6rem; display: block; }

/* The page. */
.page { flex: 1; padding-top: 2rem; padding-bottom: 3rem; color: var(--ink-2); }
.page > * { max-width: 42rem; }
.page > h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); margin: 0 0 1rem; color: var(--ink); }
.muted { color: var(--ink-3); font-size: .95rem; }
.error, .notice { margin: 1rem 0; padding: .75rem 1rem; border: 1px solid var(--line-strong); border-left-width: 4px; border-radius: var(--radius); background: var(--surface); color: var(--ink); }
.error { border-left-color: #b3261e; }
.notice { border-left-color: var(--accent); }
code, .link { font-family: ui-monospace, monospace; word-break: break-all; }
form { margin: 1.25rem 0; }
label { display: block; margin: .6rem 0 .25rem; font-weight: 600; }
input[type=text], input[type=email] { width: 100%; max-width: 28rem; padding: .6rem .7rem; font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line-input); border-radius: 8px; }
/* The status line the signup script fills (issue #181); nothing shows while it is empty. */
[role=status] { margin: 1rem 0; color: var(--ink-2); font-weight: 600; }
[role=status]:empty { display: none; }

/* The period choice: two cards that are still real radio inputs. */
fieldset.periods { border: 0; margin: 0 0 1rem; padding: 0; min-width: 0; }
fieldset.periods legend { padding: 0; margin: 0 0 .5rem; font-weight: 600; }
.period-cards { display: flex; flex-wrap: wrap; gap: 1rem; }
label.period { display: block; margin: 0; flex: 1 1 12rem; font-weight: 400; cursor: pointer; }
label.period input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.period-card { display: flex; flex-direction: column; gap: .15rem; height: 100%; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 1rem; }
label.period input:checked + .period-card { border: 2px solid var(--accent); padding: calc(1rem - 1px); }
label.period input:focus-visible + .period-card { outline: 3px solid var(--accent); outline-offset: 2px; }
.period-name { font-family: var(--serif); font-weight: 600; font-size: 1.3rem; color: var(--ink); }
.period-price { color: var(--ink-3); }
.period-price strong { font-family: var(--serif); font-size: 2rem; color: var(--ink); }
.period-save { font-size: .9rem; color: var(--ink-2); }

/* Footer (the site's Footer: Terms, Privacy, Contact and the operator). */
.foot { border-top: 1px solid var(--line); padding: 1.5rem 0 2rem; font-size: .9rem; color: var(--ink-3); }
.foot ul { list-style: none; margin: 0 0 1rem; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.foot a { color: var(--ink-2); }
.foot p { margin: 0; }

/* The analytics consent banner (issue #197); hidden until analytics.js opens it. */
.consent { position: fixed; z-index: 50; left: 1rem; right: 1rem; bottom: 1rem; margin: 0 auto; max-width: 40rem; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; padding: .75rem 1rem; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 6px 24px rgb(0 0 0 / .12); font-size: .9rem; line-height: 1.4; }
.consent[hidden], .consent [hidden] { display: none; }
.consent p { margin: 0; flex: 1 1 16rem; }
.consent a { color: var(--ink-2); white-space: nowrap; }
.consent .actions { display: flex; gap: .5rem; }
.consent button { min-height: 44px; }
.consent button.ghost { background: var(--surface); color: var(--accent); }
