/*
 * Palette taken from the app's ThemeData (lib/main.dart): cyan primary on deep
 * navy text in light mode, the same cyan on the near-black navy of the dark
 * theme. Kept in sync by hand, which is fine for four colours that have not
 * moved in the app's lifetime.
 */
:root {
  color-scheme: light dark;

  --primary: #71d2d7;         /* colorScheme.primary */
  --primary-dim: #54b2b9;     /* colorScheme.primaryFixedDim */
  --on-primary: #153b6f;      /* colorScheme.onPrimary */

  --bg: #f2f2f5;              /* scaffoldBackgroundColor */
  --card: #ffffff;            /* cardColor */
  --surface: #f7f7f7;         /* colorScheme.surface */
  --text: #153b6f;            /* colorScheme.onSurface */
  --muted: #888888;           /* hintColor */
  --border: #224488bb;        /* dividerColor */
  --border-alpha: 0.14;
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #71d2d7;
    --primary-dim: #4da5ab;
    --on-primary: #10111f;

    --bg: #10111f;            /* dark scaffoldBackgroundColor */
    --card: #1a1f2f;          /* dark cardColor */
    --surface: #131427;       /* dark colorScheme.surface */
    --text: #ffffffbf;        /* dark bodyMedium, 75% white */
    --muted: #ffffff80;       /* dark hintColor, 50% white */
    --border: #88bbff;        /* dark dividerColor */
    --border-alpha: 0.16;
  }
}

* {
  box-sizing: border-box;
}

/* `display: block` on the buttons would otherwise beat the user agent's
   `[hidden] { display: none }`, leaving every optional button on screen. */
[hidden] {
  display: none !important;
}

body {
  margin: 0;
  padding: 32px 16px 48px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  display: flex;
  justify-content: center;
}

main {
  width: 100%;
  max-width: 420px;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 20px;
}

.brand img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.brand span {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.card {
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--border) calc(var(--border-alpha) * 100%), transparent);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(21, 59, 111, 0.06);
}

.kicker {
  margin: 0 0 4px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary-dim);
}

h1 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
}

.entity {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
}

p {
  margin: 0 0 16px;
  color: var(--muted);
}

/* Two mutually exclusive states, switched by link.js through
   `body[data-state]`. The launching one is the default in the markup, so a
   visitor with the app never sees the buttons flash up first. With JavaScript
   disabled neither state is ever set and the buttons show, which is the safe
   way round. */
.launching,
body[data-state="fallback"] .launching {
  display: none;
}

body[data-state="launching"] .launching {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0 2px;
  color: var(--muted);
}

body[data-state="launching"] .fallback {
  display: none;
}

.spinner {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--primary) 30%, transparent);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .spinner {
    animation-duration: 2.4s;
  }
}

a.button {
  display: block;
  margin-bottom: 10px;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--border) calc(var(--border-alpha) * 100%), transparent);
  background: var(--surface);
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  color: var(--text);
}

a.button:hover {
  border-color: var(--primary);
}

a.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
}

a.button.primary:hover {
  background: var(--primary-dim);
  border-color: var(--primary-dim);
}

a.button.debug {
  border-style: dashed;
  font-weight: 500;
  color: var(--muted);
}

footer {
  margin-top: 20px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--primary);
}
