:root {
  --bg: #F6F6F3;
  --fg: #0E1A2B;
  --muted: #59616e;
  --line: #dddcd6;
  --accent: #E8572A;
  --field: #ffffff;
  --error: #c2410c;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1A2B;
    --fg: #F6F6F3;
    --muted: #a3abb8;
    --line: #22304a;
    --accent: #E8572A;
    --field: #13223a;
    --error: #fb923c;
  }
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  padding: 0 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

/* Top bar */
.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
}
.topbar .home { margin-right: auto; font-size: 14px; font-weight: 600; text-decoration: none; }
.login-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  transition: color .15s, border-color .15s;
}
.login-link:hover, .login-link:focus-visible { color: var(--fg); border-color: var(--muted); }

main {
  align-self: center;
  justify-self: center;
  max-width: 560px;
  width: 100%;
  padding: 48px 0 64px;
}
main.narrow { max-width: 360px; }
main.wide { max-width: 760px; align-self: start; }

/* Admin: contact messages */
.msg { border: 1px solid var(--line); border-radius: 14px; padding: 18px 20px; margin-top: 12px; }
.msg header { display: flex; flex-wrap: wrap; gap: 4px 6px; font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.msg header strong { color: var(--fg); }
.msg time { margin-left: auto; }
.msg p { font-size: 15px; line-height: 1.6; white-space: normal; }

/* Wordmark: the transparent WebP is used as a mask so the colours follow the theme.
   Ink box in the 2000x412 source is x 87-1909, y 86-326; the dot sits at 13.5-20% of it. */
.wordmark {
  --w: min(360px, calc(100vw - 32px));
  width: var(--w);
  aspect-ratio: 1822 / 240;
  margin-bottom: 36px;
  background: linear-gradient(90deg, var(--fg) 13.5%, var(--accent) 13.5% 20%, var(--fg) 20%);
  -webkit-mask: url(/assets/conversion-atlas-wordmark.webp) no-repeat;
  mask: url(/assets/conversion-atlas-wordmark.webp) no-repeat;
  -webkit-mask-size: calc(var(--w) * 2000 / 1822) auto;
  mask-size: calc(var(--w) * 2000 / 1822) auto;
  -webkit-mask-position: calc(var(--w) * -87 / 1822) calc(var(--w) * -86 / 1822);
  mask-position: calc(var(--w) * -87 / 1822) calc(var(--w) * -86 / 1822);
}
.wordmark.small { --w: 200px; margin-bottom: 32px; }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 24px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .dot { animation: none; } }

.lead {
  font-size: clamp(22px, 4vw, 28px);
  font-weight: 500;
  letter-spacing: -0.015em;
  margin-bottom: 12px;
}
.sub {
  font-size: 18px;
  line-height: 1.6;
  color: var(--muted);
}

/* Forms */
.title { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.hint { font-size: 15px; color: var(--muted); margin-bottom: 24px; }
label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
input[type=password] {
  width: 100%;
  font: inherit;
  font-size: 16px;
  color: var(--fg);
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
input[type=password]:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.btn {
  display: inline-block;
  width: 100%;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  border: 0;
  border-radius: 10px;
  padding: 12px 16px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn.ghost {
  width: auto;
  color: var(--muted);
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
}
.error {
  font-size: 14px;
  color: var(--error);
  margin-bottom: 16px;
}

footer {
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
