/* Restricted page - standalone (base.css is NOT loaded here; only tokens + seasons).
 * Colours come from tokens.css / seasons.css.  The only hard-coded colours are
 * Discord's brand blurple + white on the sign-in button (allowed brand exception). */

*, *::before, *::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] { display: none !important; }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}

/* ---- Stage + seasonal motif ------------------------------------------------ */

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 72px var(--gutter) 24px;
}

/* Fade the motif towards the edges so it sits behind the card, not over the page. */
.stage.season-decor::before {
  -webkit-mask-image: var(--season-pattern, none), radial-gradient(ellipse at center, #000 0%, #000 35%, transparent 75%);
  -webkit-mask-size: 80px 80px, 100% 100%;
  -webkit-mask-repeat: repeat, no-repeat;
  -webkit-mask-composite: source-in;
          mask-image: var(--season-pattern, none), radial-gradient(ellipse at center, #000 0%, #000 35%, transparent 75%);
          mask-size: 80px 80px, 100% 100%;
          mask-repeat: repeat, no-repeat;
          mask-composite: intersect;
}

/* ---- Appearance switch ------------------------------------------------------ */

.appearance {
  position: absolute;
  top: 16px;
  right: var(--gutter);
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  box-shadow: var(--shadow-1);
  z-index: 2;
}

.appearance-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.appearance-btn .icon { width: 16px; height: 16px; }
.appearance-btn:hover { color: var(--ink); background: var(--surface-2); }
.appearance-btn[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); }
.appearance-btn:focus-visible { outline: none; border-radius: var(--r-pill); box-shadow: var(--ring); }

@media (max-width: 479px) {
  .appearance-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .appearance-btn { width: 36px; padding: 0; justify-content: center; }
}

/* ---- Card -------------------------------------------------------------------- */

.locked {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  padding: 32px 24px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: cardIn var(--t-slow) var(--ease-out) both;
}
@media (min-width: 600px) { .card { padding: 40px 40px 36px; } }

@keyframes cardIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.02em;
}
.brand-mark {
  width: 32px; height: 32px; flex: none;
  border-radius: var(--r);
  background: var(--brand);
  color: var(--brand-ink);
  display: grid; place-items: center;
  font-weight: 800; font-size: 16px;
}
.brand-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.season-slot { margin: 12px 0 0; }

.lock {
  margin-top: 28px;
  width: 56px; height: 56px;
  border-radius: var(--r-lg);
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand-soft-ink);
}
.lock .icon { width: 26px; height: 26px; stroke-width: 1.7; }

.title {
  margin: 20px 0 0;
  font-family: var(--font-display);
  font-size: 24px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -.02em;
}

.line {
  margin: 8px 0 0;
  max-width: 32ch;
  color: var(--ink-2);
  font-size: 15px;
}
.line.small { font-size: 13px; color: var(--muted); }

/* ---- Auth status panel ---------------------------------------------------------
 * One panel per ?auth_error= code.  data-tone picks the soft token pair so it
 * follows light/dark and every season (brand-soft is season-driven). */

.notice {
  --n-bg: var(--brand-soft);
  --n-accent: var(--brand-soft-ink);
  --n-edge: color-mix(in srgb, var(--n-accent) 22%, transparent);
  margin-top: 20px;
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px 14px 12px;
  border-radius: var(--r);
  background: var(--n-bg);
  border: 1px solid var(--n-edge);
  color: var(--ink);
  text-align: left;
  animation: noticeIn var(--t) var(--ease-out) both;
}
.notice[data-tone="warn"] { --n-bg: var(--warn-soft); --n-accent: var(--warn); }
.notice[data-tone="bad"]  { --n-bg: var(--bad-soft);  --n-accent: var(--bad); }

@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  .notice { border-color: var(--line); }
}

@keyframes noticeIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

.notice-icon {
  width: 32px; height: 32px; flex: none;
  border-radius: var(--r);
  display: grid; place-items: center;
  background: var(--surface);
  color: var(--n-accent);
  box-shadow: 0 0 0 1px var(--n-edge);
}
.notice-icon .icon { width: 18px; height: 18px; }

.notice-body { min-width: 0; flex: 1; }

.notice-title {
  margin: 1px 0 0;
  font-size: 14px;
  font-weight: 650;
  line-height: 1.3;
  color: var(--ink);
}
.notice-text {
  margin: 3px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.notice-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.notice-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
.notice-btn .icon { width: 15px; height: 15px; }
.notice-btn:hover { background: var(--surface-2); border-color: var(--ink-2); }
.notice-btn:active { transform: scale(.975); }
.notice-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.notice-btn.primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--on-ink);
}
.notice-btn.primary:hover { background: var(--ink-2); border-color: var(--ink-2); }

/* Subtle "Not in our server yet?" link under the sign-in button. */
.join-hint {
  margin: 2px 0 0;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}
.join-hint-link {
  color: var(--ink-2);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.join-hint-link:hover { color: var(--ink); text-decoration-color: currentColor; }

/* ---- Sign-in ------------------------------------------------------------------ */

.signin {
  margin-top: 28px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.locked[data-state="loading"] .signin { visibility: hidden; }
.locked[data-state="loading"] .line { visibility: hidden; }

.discord-btn {
  appearance: none;
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: var(--r);
  background: #5865f2;
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease);
}
a.discord-btn:hover { background: #4752c4; box-shadow: var(--shadow-1); }
a.discord-btn:active { transform: scale(.975); }
.discord-btn:focus-visible { outline-color: #5865f2; border-radius: var(--r); }

.discord-mark { width: 22px; height: 22px; flex: none; }
.discord-body { fill: #ffffff; }
.discord-eye { fill: #5865f2; }

.discord-btn:disabled,
.discord-btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .5;
  filter: saturate(.55);
}
:root[data-mode="dark"] .discord-btn:disabled { opacity: .42; }

.soon-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
}

/* ---- Footer ------------------------------------------------------------------- */

.foot {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

/* ---- Motion ------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

@media (min-height: 760px) { .stage { padding-top: 24px; } }
