/* Floodlit, the subset the OAuth pages need — HAD-11.
 *
 * Imported from `fanmoot/web/src/styles/tokens.css` rather than re-drawn, and
 * cut to what four pages actually use: brand, surfaces, text, the field, the
 * button, the radius and motion scales. A fan who signs in here should not
 * notice they left Fanmoot.
 *
 * Theming follows the same rule as the source file, and the rule matters: every
 * colour gets its value on bare `:root` first, is redefined under the dark media
 * query behind a `:not([data-theme="light"])` guard, and again under an explicit
 * `[data-theme="dark"]`. A colour whose only definition lives inside a media
 * query is a colour that vanishes when the viewer's OS says the other thing.
 *
 * Lato, from this server, with `font-display: swap`: the wordmark is only
 * Fanmoot's in Fanmoot's typeface, but a page whose whole job is to take a
 * password quickly — on a phone, on stadium wifi — must never wait for a font.
 * The text paints at once in the system stack and swaps when Lato lands.
 *
 * The pages are always dark (`data-theme="dark"` on the shell), in the same
 * Floodlit night as `mcp.fanmoot.com`'s home page: two floodlights, blue and
 * green, from the colours of the ball in the icon.
 */

@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/static/fonts/lato-400.woff2') format('woff2');
}

@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/static/fonts/lato-700.woff2') format('woff2');
}

@font-face {
  font-family: 'Lato';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('/static/fonts/lato-900.woff2') format('woff2');
}

:root {
  --fm-blue: #0444c8;
  --fm-blue-deep: #032f8c;
  --fm-blue-soft: #e8eeff;
  --fm-green: #409e46;
  --fm-amber: #f2a73b;
  --fm-red: #d93a3a;

  --fm-bg: #f7f9fc;
  --fm-surface: #ffffff;
  --fm-field: #f7f9fc;
  --fm-accent-2: #0444c8;
  --fm-lime: #4fbf57;
  --fm-line: rgb(11 15 20 / 0.10);
  --fm-line-strong: rgb(11 15 20 / 0.18);
  --fm-text: #0b0f14;
  --fm-text-muted: #5b6672;
  --fm-text-faint: #8a94a0;
  --fm-accent: var(--fm-blue);
  --fm-accent-text: #ffffff;
  --fm-ring: rgb(4 68 200 / 0.45);
  --fm-shadow: 0 1px 2px rgb(11 15 20 / 0.06), 0 8px 24px rgb(11 15 20 / 0.06);

  --fm-font-body: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  --fm-radius: 12px;
  --fm-radius-sm: 8px;
  --fm-radius-lg: 18px;
  --fm-fast: 140ms;
  --fm-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --fm-bg: #070a0f;
    --fm-surface: #121821;
    --fm-field: #0b1017;
    --fm-accent-2: #6f9bff;
    --fm-line: rgb(255 255 255 / 0.10);
    --fm-line-strong: rgb(255 255 255 / 0.20);
    --fm-text: #f7f9fc;
    --fm-text-muted: #9aa6b4;
    --fm-text-faint: #6b7684;
    --fm-blue-soft: rgb(4 68 200 / 0.18);
    --fm-accent: #4d80ff;
    --fm-accent-text: #05132e;
    --fm-ring: rgb(77 128 255 / 0.55);
    --fm-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.35);
  }
}

:root[data-theme='dark'] {
  --fm-bg: #070a0f;
  --fm-surface: #121821;
  --fm-field: #0b1017;
  --fm-accent-2: #6f9bff;
  --fm-line: rgb(255 255 255 / 0.10);
  --fm-line-strong: rgb(255 255 255 / 0.20);
  --fm-text: #f7f9fc;
  --fm-text-muted: #9aa6b4;
  --fm-text-faint: #6b7684;
  --fm-blue-soft: rgb(4 68 200 / 0.18);
  --fm-accent: #4d80ff;
  --fm-accent-text: #05132e;
  --fm-ring: rgb(77 128 255 / 0.55);
  --fm-shadow: 0 1px 2px rgb(0 0 0 / 0.4), 0 12px 32px rgb(0 0 0 / 0.35);
}

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

body {
  position: relative;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  isolation: isolate;
  /* Mobile-first, and the 16px gutter is not decorative: this page is reached
   * from a phone far more often than from a laptop. */
  padding: 28px 16px 48px;
  background:
    radial-gradient(110% 60% at 100% 0%, #0f2560 0%, rgb(7 10 15 / 0) 60%),
    radial-gradient(90% 50% at 0% 100%, #0d2c16 0%, rgb(7 10 15 / 0) 62%),
    var(--fm-bg);
  color: var(--fm-text);
  font-family: var(--fm-font-body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.shell {
  max-width: 28rem;
  margin: 0 auto;
}

/* The floodlights: two soft pools of the ball's own blue and green. */
.flood {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
}

.flood--a {
  width: 460px;
  height: 460px;
  right: -160px;
  top: -200px;
  background: #1f5cff;
  opacity: 0.42;
}

.flood--b {
  width: 380px;
  height: 380px;
  left: -180px;
  bottom: -220px;
  background: #2f9e3a;
  opacity: 0.28;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 4px 22px;
}

.brand__icon {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  filter: drop-shadow(0 6px 18px rgb(31 92 255 / 0.35));
}

.brand__lockup {
  display: grid;
  line-height: 1.1;
}

.brand__word {
  font-weight: 900;
  font-size: 1.6rem;
  letter-spacing: -0.015em;
  color: var(--fm-text);
}

.brand__word span {
  color: var(--fm-accent-2);
}

.brand__tagline {
  margin-top: 3px;
  color: var(--fm-text-muted);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.card {
  position: relative;
  overflow: hidden;
  background: var(--fm-surface);
  border: 1px solid var(--fm-line);
  border-radius: var(--fm-radius-lg);
  box-shadow: var(--fm-shadow);
  padding: 28px 22px 24px;
}

/* The ball's two colours across the top of the card, like a club's sash. */
.card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--fm-blue) 0%, #2b6bff 45%, var(--fm-green) 100%);
}

h1 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: -0.015em;
}

.lede {
  margin: 0 0 20px;
  color: var(--fm-text-muted);
}

label {
  display: block;
  margin: 0 0 6px;
  font-weight: 700;
  font-size: 0.9rem;
}

.field {
  margin-bottom: 16px;
}

.hint {
  margin: 6px 0 0;
  color: var(--fm-text-faint);
  font-size: 0.82rem;
}

input[type='text'],
input[type='email'],
input[type='password'],
input[type='date'] {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--fm-text);
  background: var(--fm-field);
  border: 1px solid var(--fm-line-strong);
  border-radius: var(--fm-radius-sm);
  font: inherit;
  color-scheme: dark;
  transition: border-color var(--fm-fast) var(--fm-ease),
    box-shadow var(--fm-fast) var(--fm-ease);
}

input:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: none;
  border-color: var(--fm-accent);
  box-shadow: 0 0 0 3px var(--fm-ring);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  /* 48px, so the primary action is a comfortable target on a phone. */
  min-height: 48px;
  width: 100%;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: linear-gradient(135deg, #2b6bff 0%, #0444c8 55%, #032f8c 100%);
  box-shadow: 0 12px 28px -12px rgb(43 107 255 / 0.8), inset 0 1px 0 rgb(255 255 255 / 0.22);
  color: #fff;
  font: inherit;
  font-weight: 900;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform var(--fm-fast) var(--fm-ease),
    box-shadow var(--fm-fast) var(--fm-ease), filter var(--fm-fast) var(--fm-ease);
}

.btn:hover {
  filter: brightness(1.08);
  box-shadow: 0 16px 34px -12px rgb(43 107 255 / 0.95), inset 0 1px 0 rgb(255 255 255 / 0.28);
}

.btn:active {
  transform: translateY(1px);
}

.btn--quiet {
  background: transparent;
  box-shadow: none;
  color: var(--fm-text-muted);
  border-color: var(--fm-line-strong);
  font-weight: 700;
}

.btn--danger {
  background: transparent;
  box-shadow: none;
  color: var(--fm-red);
  border-color: var(--fm-red);
  width: auto;
  min-height: 40px;
  font-size: 0.9rem;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.alert {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--fm-radius-sm);
  border: 1px solid var(--fm-red);
  /* Not colour alone: the border, the icon and the word carry it too, so the
   * message still reads on a monochrome screen or to a colour-blind fan. */
  background: rgb(217 58 58 / 0.08);
  font-size: 0.92rem;
}

.alert--ok {
  border-color: var(--fm-green);
  background: rgb(64 158 70 / 0.10);
}

.alert--warn {
  border-color: var(--fm-amber);
  background: rgb(242 167 59 / 0.12);
}

.scopes {
  margin: 0 0 4px;
  padding: 0;
  border: 0;
}

.scopes legend {
  padding: 0;
  margin-bottom: 10px;
  font-weight: 700;
  font-size: 0.9rem;
}

.scope {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--fm-line);
  border-radius: var(--fm-radius-sm);
  background: var(--fm-bg);
}

.scope input[type='checkbox'] {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--fm-accent);
  flex: 0 0 auto;
}

.scope__text {
  min-width: 0;
}

.scope__summary {
  display: block;
  font-weight: 700;
  margin: 0;
}

.scope__detail {
  display: block;
  margin: 2px 0 0;
  color: var(--fm-text-muted);
  font-size: 0.86rem;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--fm-blue-soft);
  color: var(--fm-accent);
  font-size: 0.74rem;
  font-weight: 700;
  vertical-align: 2px;
}

.app-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.app {
  padding: 16px 0;
  border-top: 1px solid var(--fm-line);
}

.app:first-child {
  border-top: 0;
}

.app__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.app__name {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.app__meta {
  margin: 4px 0 8px;
  color: var(--fm-text-faint);
  font-size: 0.82rem;
}

.app__scopes {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--fm-text-muted);
  font-size: 0.88rem;
}

.foot {
  margin: 20px 4px 0;
  color: var(--fm-text-faint);
  font-size: 0.8rem;
  text-align: center;
}

.foot a,
.inline-link {
  color: var(--fm-accent);
}

a {
  color: var(--fm-accent);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 22px;
  border: 1px solid var(--fm-line);
  border-radius: 999px;
  background: var(--fm-field);
}

.tab {
  flex: 1 1 0;
  text-align: center;
  padding: 9px 10px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--fm-text-muted);
  font-weight: 700;
  font-size: 0.92rem;
  transition: color var(--fm-fast) var(--fm-ease), background var(--fm-fast) var(--fm-ease);
}

.tab:hover {
  color: var(--fm-text);
}

.tab[aria-current='page'] {
  background: var(--fm-blue);
  color: #fff;
  box-shadow: 0 6px 16px -8px rgb(43 107 255 / 0.9);
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ── The privacy and terms pages (S7-12) ─────────────────────────────────── */
.legal h2 {
  margin: 24px 0 8px;
  font-size: 1.05rem;
}

.legal p,
.legal li {
  color: var(--fm-text-muted);
  line-height: 1.55;
}

.legal ul {
  margin: 0;
  padding-left: 1.2em;
}

.legal li + li {
  margin-top: 6px;
}
