/* Sign in.
 *
 * This is the first thing a council officer sees every morning and the only
 * page a stranger ever reaches, so it is held to the same standard as the
 * public site and shares its language: near-white, one blue, system type, a
 * great deal of space.
 *
 * It used to pull in dashboard.css - the whole application stylesheet - for a
 * card and two fields. This is the whole page instead.
 */

:root {
  color-scheme: light dark;

  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-faint: #86868b;
  --bg: #ffffff;
  --card: rgba(255, 255, 255, 0.82);
  --line: rgba(0, 0, 0, 0.11);
  --line-soft: rgba(0, 0, 0, 0.06);
  --accent: #0066cc;
  --accent-hover: #0077ed;
  --on-accent: #ffffff;
  --danger: #b3261e;
  --field: #ffffff;

  --glow-1: #d9ecff;
  --glow-2: #dde3ff;
  --glow-3: #cfe4f7;
  --ground: #f2f7fd;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f5f5f7;
    --ink-soft: #a1a1a6;
    --ink-faint: #86868b;
    --bg: #000000;
    --card: rgba(22, 22, 26, 0.78);
    --line: rgba(255, 255, 255, 0.14);
    --line-soft: rgba(255, 255, 255, 0.08);
    --accent: #2997ff;
    --accent-hover: #6bb6ff;
    --on-accent: #000000;
    --danger: #ff6b6b;
    --field: #101014;

    --glow-1: #10314f;
    --glow-2: #1b2044;
    --glow-3: #0d2a41;
    --ground: #0a1119;
  }
}

*, *::before, *::after { box-sizing: border-box; }

body[data-page="login"] {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 28px 20px 22px;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.47;
  letter-spacing: -0.018em;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(80% 60% at 12% 4%, var(--glow-1) 0%, transparent 60%),
    radial-gradient(70% 60% at 92% 8%, var(--glow-2) 0%, transparent 58%),
    radial-gradient(90% 70% at 50% 104%, var(--glow-3) 0%, transparent 62%),
    var(--ground);
}

.auth-view {
  display: grid;
  place-items: center;
  width: 100%;
}

.auth-card {
  width: 100%;
  max-width: 25rem;
  padding: 40px 36px 34px;
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  background: var(--card);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
  backdrop-filter: saturate(180%) blur(24px);
  box-shadow: 0 12px 44px rgba(20, 40, 70, 0.10);
  animation: card-in 0.7s cubic-bezier(0.16, 0.84, 0.28, 1) both;
}

@keyframes card-in {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

/* The wordmark, painted as a mask so it takes the text colour and follows
   dark mode without a second file. Where masking is unsupported the heading
   stays as live text, which is why the word is in the markup. */
.auth-mark {
  display: block;
  width: 117px;
  height: 37px;
  margin: 0 auto 22px;
  color: var(--ink);
}

@supports ((-webkit-mask-image: url("/static/logo-wordmark.svg")) or (mask-image: url("/static/logo-wordmark.svg"))) {
  .auth-mark {
    background: currentColor;
    -webkit-mask: url("/static/logo-wordmark.svg") no-repeat center / contain;
    mask: url("/static/logo-wordmark.svg") no-repeat center / contain;
    text-indent: -9999px;
    overflow: hidden;
  }
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-align: center;
}

.auth-copy {
  margin: 0 0 26px;
  color: var(--ink-soft);
  font-size: 15px;
  text-align: center;
}

/* Two ways in, side by side, with the chosen one carrying the weight. */
.login-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: 0 0 24px;
  padding: 4px;
  border-radius: 12px;
  background: var(--line-soft);
}

.login-tabs .pill {
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.login-tabs .pill:hover { color: var(--ink); }
.login-tabs .pill.is-active {
  background: var(--field);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.09);
}

.auth-form { display: grid; gap: 16px; }

.auth-form label { display: grid; gap: 7px; }

.auth-form label span {
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
}

.auth-form input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--field);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px or iOS zooms the page on focus */
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}
.auth-form input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3.5px color-mix(in srgb, var(--accent) 18%, transparent);
}

.auth-form button[type="submit"] {
  margin-top: 4px;
  padding: 13px 20px;
  border: 0;
  border-radius: 980px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease;
}
.auth-form button[type="submit"]:hover { background: var(--accent-hover); }
.auth-form button[type="submit"]:active { transform: scale(0.988); }
.auth-form button[type="submit"][disabled] { opacity: 0.55; cursor: default; }

.auth-error {
  margin: 2px 0 0;
  padding: 11px 14px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
  font-size: 14px;
}
.auth-error[hidden] { display: none; }

.auth-aside {
  margin: 22px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line-soft);
  color: var(--ink-faint);
  font-size: 13px;
  text-align: center;
}
.auth-aside a { color: var(--accent); text-decoration: none; }
.auth-aside a:hover { text-decoration: underline; }

.auth-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: baseline;
  justify-content: center;
  margin-top: 30px;
  color: var(--ink-faint);
  font-size: 12px;
}
.auth-footer a { color: var(--ink-soft); text-decoration: none; }
.auth-footer a:hover { text-decoration: underline; }
.auth-footer .footer-links { display: flex; gap: 6px 14px; align-items: baseline; }
.footer-sep { opacity: 0.5; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

@media (prefers-reduced-motion: reduce) {
  .auth-card { animation: none; }
  .auth-form button[type="submit"]:active { transform: none; }
}

@media (max-width: 420px) {
  .auth-card { padding: 32px 24px 28px; border-radius: 18px; }
}
