@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;450;500;600&family=Instrument+Serif:ital@0;1&display=swap");

:root {
  color-scheme: light;

  /* Colour tokens copied from html[data-theme="light"] in design/reference.html */
  --cf-bg: #fafaf9;
  --cf-surface: #ffffff;
  --cf-elev: #f3f3f1;
  --cf-card: #ffffff;
  --cf-border: rgba(0,0,0,.085);
  --cf-border-2: rgba(0,0,0,.16);
  --cf-text: #17171a;
  --cf-text-2: #55555d;
  --cf-muted: #8b8b93;
  --cf-accent: #2f5ccb;
  --cf-accent-ink: #ffffff;
  --cf-accent-soft: rgba(47,92,203,.07);
  --cf-accent-line: rgba(47,92,203,.24);
  --cf-ok: #2f7a55;
  --cf-warn: #8f6718;
  --cf-bad: #ab4a4a;

  /* Font stacks copied from :root in design/reference.html */
  --cf-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --cf-display: 'Instrument Serif', Georgia, serif;

  /* Radius tokens copied from :root in design/reference.html */
  --cf-r-sm: 5px;
  --cf-r-md: 8px;
  --cf-r-lg: 11px;

  /* Border values used throughout design/reference.html */
  --cf-border-width: 1px;
  --cf-border-style: solid;

  /* Motion token copied from :root in design/reference.html */
  --cf-transition: 150ms cubic-bezier(.2,.6,.3,1);
}

/*
 * Auth pages only. No global body, heading, link, input, select or button
 * rules, so the dashboard keeps every declaration from its own stylesheet.
 */
#login-form,
#signup-form {
  font-family: var(--cf-ui);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--cf-text);
  font-feature-settings: "cv11" 1, "ss01" 1;
}

main > h1,
main > h2 {
  font-family: var(--cf-display);
  font-weight: 400;
  letter-spacing: -.01em;
  line-height: 1.15;
  color: var(--cf-text);
}

main > h1 {
  font-size: 27px;
  margin: 0 0 7px;
}

/* The only link on the auth pages is the Log in / Sign up switch link. */
main .switch a {
  color: var(--cf-accent);
  text-decoration: none;
  transition: color var(--cf-transition);
}

main .switch a:hover {
  color: var(--cf-text);
}

#login-form input,
#signup-form input {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--cf-text);
  background: var(--cf-bg);
  border: var(--cf-border-width) var(--cf-border-style) var(--cf-border);
  border-radius: var(--cf-r-sm);
  height: 34px;
  padding: 0 11px;
  transition:
    border-color var(--cf-transition),
    background var(--cf-transition);
}

#login-form input:focus,
#signup-form input:focus {
  outline: none;
  background: var(--cf-card);
  border-color: var(--cf-accent-line);
}

/* Keep room for the existing Show button in signup.html. */
#signup-form .password-field input {
  padding-right: 52px;
}

/*
 * Button classes from the reference. No dashboard element uses these
 * class names, so they cannot overwrite its .primary / .ghost rules.
 */
.btn,
.btn-primary,
.btn-outline,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: var(--cf-border-width) var(--cf-border-style) transparent;
  border-radius: var(--cf-r-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: -.005em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--cf-transition),
    border-color var(--cf-transition),
    color var(--cf-transition);
}

.btn:active {
  transform: translateY(.5px);
}

.btn-primary {
  background: var(--cf-accent);
  color: var(--cf-accent-ink);
  font-weight: 500;
}

.btn-primary:hover {
  filter: brightness(1.06);
}

.btn-outline {
  background: transparent;
  color: var(--cf-text-2);
  border-color: var(--cf-border);
}

.btn-outline:hover {
  background: var(--cf-elev);
  color: var(--cf-text);
  border-color: var(--cf-border-2);
}

.btn-ghost {
  background: var(--cf-elev);
  color: var(--cf-text-2);
  border-color: transparent;
}

.btn-ghost:hover {
  background: var(--cf-border-2);
  color: var(--cf-text);
}

.btn-small {
  height: 28px;
  padding: 0 10px;
  font-size: 12.5px;
}

/* The auth pages cannot gain classes; these IDs are already in the markup. */
#login-form #submit,
#signup-form #submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: var(--cf-border-width) var(--cf-border-style) var(--cf-accent);
  border-radius: var(--cf-r-sm);
  background: var(--cf-accent);
  color: var(--cf-accent-ink);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -.005em;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background var(--cf-transition),
    border-color var(--cf-transition),
    color var(--cf-transition);
}

#login-form #submit:hover,
#signup-form #submit:hover {
  filter: brightness(1.06);
}

#login-form #submit:disabled,
#signup-form #submit:disabled {
  cursor: default;
  filter: none;
}
