:root {
  --bg: #f6f3ec;
  --card: #fffdf8;
  --ink: #1d2233;
  --muted: #646979;
  --line: #e2dbcd;
  --field: #fbf9f4;
  --accent: #222a45;
  --accent-ink: #f4ebda;
  --glow: #c98a1e;
  --err: #b42318;
  --ok: #1f7a4d;
  --serif: ui-serif, "New York", "Iowan Old Style", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12141c;
    --card: #1a1d29;
    --ink: #ece6da;
    --muted: #a3a5b3;
    --line: #2d3142;
    --field: #141720;
    --accent: #f4ebda;
    --accent-ink: #1d2233;
    --glow: #f2b04a;
    --err: #f97066;
    --ok: #4ade80;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 var(--sans);
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 28px 24px 24px;
}
.card.wide { max-width: 600px; }

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
}
.brand img { width: 34px; height: 34px; border-radius: 8px; }

h1 {
  font-family: var(--serif);
  font-size: 23px;
  line-height: 1.25;
  font-weight: 600;
  margin: 0 0 6px;
}
h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  margin: 26px 0 6px;
}
p { margin: 0 0 12px; }
.sub { color: var(--muted); font-size: 15px; margin-bottom: 18px; }
a { color: inherit; text-underline-offset: 2px; }
code {
  font: 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  overflow-wrap: anywhere;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin: 14px 0 6px;
}
input {
  width: 100%;
  padding: 12px;
  font: 16px var(--sans); /* 16px keeps iPhone from zooming in */
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
}
input:focus { border-color: var(--glow); box-shadow: 0 0 0 3px color-mix(in srgb, var(--glow) 25%, transparent); }

button, .button {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 13px 16px;
  font: 600 16px var(--sans);
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  cursor: pointer;
}
.primary { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); margin-top: 10px; }
button:disabled { opacity: 0.55; cursor: default; }

.links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 18px;
  font-size: 14px;
  color: var(--muted);
}

.msg { margin: 16px 0 0; font-size: 14px; }
.msg:empty { display: none; }
.msg.err { color: var(--err); }
.msg.ok { color: var(--ok); }

ul.plain { padding-left: 20px; margin: 0 0 12px; }
ul.plain li { margin-bottom: 4px; }
.fine { color: var(--muted); font-size: 14px; margin-top: 22px; }
