/* Enough style to be legible and no more. The marketing site is a later
   step; this is the account plumbing. */

:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --ink: #16202c;
  --muted: #5d6b7a;
  --line: #dde3ea;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --ok: #14713d;
  --error: #b4232c;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11161c;
    --card: #182029;
    --ink: #e8edf3;
    --muted: #9aa8b6;
    --line: #2b3742;
    --accent: #4c8dff;
    --ok: #4ad38a;
    --error: #ff8a8a;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 2rem 1rem;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.card {
  max-width: 34rem;
  margin: 0 auto;
  padding: 1.75rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.4rem;
}

h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.panel {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

label {
  display: block;
  margin-bottom: 0.9rem;
  font-weight: 600;
  font-size: 0.9rem;
}

input {
  display: block;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.6rem 0.7rem;
  font: inherit;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
}

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

button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  border: 1px solid transparent;
}

button:disabled {
  opacity: 0.55;
  cursor: progress;
}

.primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.link {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent);
  text-decoration: underline;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.tab {
  background: transparent;
  color: var(--muted);
  border-color: var(--line);
}

.tab-active {
  background: var(--bg);
  color: var(--ink);
  border-color: var(--accent);
}

.plan {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
  font-weight: 600;
}

.muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.hint {
  display: block;
  margin-top: 0.3rem;
  font-weight: 400;
  font-size: 0.8rem;
  color: var(--muted);
}

.status {
  margin: 1rem 0 0;
  min-height: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

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

.status-error {
  color: var(--error);
}

[hidden] {
  display: none !important;
}

/* The privacy policy page (/privacy), rendered from docs/privacy.md by
   apps/web/scripts/render-privacy.mjs. Everything here is scoped to .policy
   because it styles whatever Markdown emits — headings the account pages do
   not use, code spans, and several tables — and none of that should reach the
   sign-in and account forms. */

.policy {
  /* Wider than the account card: this is a document, not a form, and the
     tables do not fit in 34rem. */
  max-width: 46rem;
  /* URLs and file paths in the prose are long enough to push the card wide on
     a phone if they are allowed to stay whole. */
  overflow-wrap: break-word;
}

.crumb {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
}

.policy h1 {
  margin: 0 0 1.25rem;
  font-size: 1.5rem;
}

/* h2 elsewhere is a small uppercase section label; here it is a real heading. */
.policy h2 {
  margin: 2rem 0 0.6rem;
  font-size: 1.2rem;
  text-transform: none;
  letter-spacing: normal;
  color: var(--ink);
}

.policy h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 1rem;
}

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

.policy li {
  margin-bottom: 0.4rem;
}

.policy code {
  padding: 0.1em 0.3em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  /* An endpoint URL in a code span is longer than a phone is wide; let it
     break anywhere rather than overflow the card. */
  overflow-wrap: anywhere;
}

.policy pre {
  margin: 1rem 0;
  padding: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
}

.policy pre code {
  padding: 0;
  background: none;
  border: 0;
  overflow-wrap: normal;
}

/* Tables scroll inside their own box. Squeezing three columns of file paths
   into a phone's width makes them unreadable, so give the table a floor and
   let the wrapper scroll instead of the page. */
.policy .table-wrap {
  margin: 1rem 0;
  overflow-x: auto;
}

.policy table {
  min-width: 26rem;
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.policy th,
.policy td {
  padding: 0.4rem 0.6rem;
  text-align: left;
  vertical-align: top;
  border: 1px solid var(--line);
}

.policy th {
  background: var(--bg);
}
