@font-face {
  font-family: "Montserrat";
  src: url("assets/montserrat.ttf") format("truetype");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Source Code Pro";
  src: url("assets/sourcecodepro.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --ink: #203a75;
  --navy: #2b3a67;
  --blue: #3b9cff;
  --pink: #ff7096;
  --green: #47ea90;
  --gray: #ced2d8;
  --light-gray: #eceef1;
  --muted: #66718a;
  --error: #ab294a;
  --sans: "Montserrat", Arial, sans-serif;
  --mono: "Source Code Pro", "Courier New", monospace;
}
* { box-sizing: border-box; }
html { min-width: 280px; }
body {
  margin: 0;
  color: var(--ink);
  background: #a9d3ff;
  font-family: var(--sans);
}
button, input { font: inherit; }
button, input, a { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: wait; }
a { color: inherit; }
[hidden] { display: none !important; }
button:focus-visible, a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.background {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 85% 10%, #a5f5ca 0, transparent 42%),
    radial-gradient(ellipse at 5% 85%, #ffc0d1 0, transparent 45%),
    linear-gradient(130deg, #a9d3ff, #cbe5ff 52%, #c9f9e0);
}
.background canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.background-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgb(203 229 255 / 12%), rgb(32 58 117 / 5%));
}
.page {
  position: relative;
  min-height: 100svh;
  max-width: 1920px;
  margin: auto;
  padding: 40px 64px;
  padding-bottom: 88px;
  display: flex;
  flex-direction: column;
}
.header {
  display: flex;
  align-items: center;
}
.forum-brand {
  max-width: 100%;
  color: var(--navy);
  font-family: var(--sans);
  font-size: clamp(1.0625rem, 2vw, 1.75rem);
  line-height: 1.05;
  letter-spacing: -.025em;
}
.forum-name {
  display: block;
  font-style: italic;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.forum-line {
  display: flex;
  align-items: center;
  gap: .6em;
  margin-top: .08em;
}
.forum-finance { min-width: 0; font-weight: 700; }
.mountain-mark {
  flex: none;
  display: block;
  width: 2.2em;
  height: auto;
}
.motion-toggle {
  position: fixed;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgb(32 58 117 / 16%);
  border-radius: 6px;
  color: var(--ink);
  background: rgb(255 255 255 / 54%);
  backdrop-filter: blur(12px);
  font-family: var(--mono);
  font-size: .875rem;
  transition: background .2s;
}
.motion-toggle:hover { background: rgb(255 255 255 / 78%); }
.play-icon { display: none; }
.motion-toggle[aria-pressed="true"] .pause-icon { display: none; }
.motion-toggle[aria-pressed="true"] .play-icon { display: block; }

.main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 48px 0;
}
.login-card {
  position: relative;
  width: 100%;
  max-width: 440px;
  padding: 38px 36px 36px;
  border: 1px solid rgb(255 255 255 / 82%);
  border-radius: 8px;
  color: var(--navy);
  background: rgb(255 255 255 / 96%);
  backdrop-filter: blur(20px);
  box-shadow: 0 20px 72px -30px rgb(32 58 117 / 28%);
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right,
    var(--blue) 0 33.333%, var(--pink) 33.333% 66.666%, var(--green) 66.666% 100%);
}
.card-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 32px;
}
.card-brand { flex: none; display: block; width: 126px; height: auto; }
h1 {
  margin: 0;
  color: var(--ink);
  font-size: 2.125rem;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.035em;
}
.field-group { margin-bottom: 24px; }
label {
  display: block;
  margin-bottom: 9px;
  font-family: var(--mono);
  font-size: .875rem;
  line-height: 1.5;
  font-weight: 400;
  color: var(--navy);
}
.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 56px;
  border: 1px solid var(--gray);
  border-radius: 4px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap > svg { flex: none; margin-left: 15px; color: #808693; }
.input-wrap:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgb(59 156 255 / 14%);
}
.input-wrap:has(input[aria-invalid="true"], select[aria-invalid="true"]) { border-color: var(--error); box-shadow: none; }
input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 14px 0 12px;
  border: 0;
  border-radius: 4px;
  outline: none;
  background: transparent;
  font-size: 1rem;
  color: var(--navy);
}
input::placeholder { color: var(--muted); opacity: 1; }
.password-toggle {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-right: 5px;
  border: 0;
  border-radius: 3px;
  color: #727d94;
  background: transparent;
}
.password-toggle:hover { background: var(--light-gray); color: var(--ink); }
.password-toggle:focus-visible { outline-offset: 0; }
.eye-closed { display: none; }
.password-toggle[aria-pressed="true"] .eye-open { display: none; }
.password-toggle[aria-pressed="true"] .eye-closed { display: block; }
.password-group { margin-bottom: 30px; }
.field-error, .caps-warning {
  margin: 7px 0 0;
  font-size: .8125rem;
  line-height: 1.5;
  color: var(--error);
}
.caps-warning { color: #8e610e; }
.submit-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  border: 1px solid transparent;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 600;
  transition: background .18s, box-shadow .18s, transform .18s;
}
.submit-button:hover { background: #2b4a8d; box-shadow: 0 6px 18px rgb(32 58 117 / 18%); }
.submit-button:active { transform: translateY(1px); }
.submit-button:disabled { opacity: .7; }
.registration-button {
  width: 100%;
  min-height: 50px;
  margin-top: 12px;
  border: 1px solid rgb(32 58 117 / 24%);
  border-radius: 4px;
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.5;
  font-weight: 600;
  transition: background .18s, border-color .18s;
}
.registration-button:hover { background: #f0f5fc; border-color: var(--ink); }
.registration-button:active { background: #e5eefb; }
.submit-spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgb(255 255 255 / 35%);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
.submit-button[aria-busy="true"] .submit-spinner { display: block; }
.form-status {
  margin: 16px 0 0;
  padding: 13px 14px;
  border: 1px solid var(--gray);
  border-radius: 4px;
  background: #f7f8fb;
  font-size: .875rem;
  line-height: 1.6;
  color: #4c5b7e;
}
.form-status[data-kind="error"] {
  border-color: #f0c8d2;
  background: #fff0f3;
  color: var(--error);
}
.forum-home { text-decoration: none; }
.main.registration-main { align-items: flex-start; }
.login-card.registration-card { max-width: 880px; padding: 40px; }
.registration-card input { padding: 0 16px; }
.registration-card .card-heading { margin-bottom: 18px; }
.form-intro { margin: 0 0 32px; font-size: .875rem; line-height: 1.6; color: var(--muted); }
.required { color: var(--error); }
.optional { color: var(--muted); font-size: .75rem; white-space: nowrap; }
.form-section, .question-group { min-width: 0; padding: 0; border: 0; }
.form-section { margin: 0 0 32px; }
.section-title { padding: 0; margin-bottom: 20px; font-size: 1.125rem; font-weight: 600; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; }
.form-grid .field-group { min-width: 0; margin: 0; }
.field-wide { grid-column: 1 / -1; }
select {
  width: 100%; min-width: 0; height: 100%; padding: 0 14px;
  border: 0; border-radius: 4px; outline: none; background: transparent;
  color: var(--navy); font: inherit; font-size: 1rem;
}
select:invalid { color: var(--muted); }
select option { color: var(--navy); }
.question-group { margin: 0; }
.question-label { padding: 0; font-size: .9375rem; line-height: 1.65; font-weight: 500; }
.choice-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 16px; }
.choice-list { display: grid; gap: 14px; margin-top: 18px; }
.choice {
  display: flex; align-items: flex-start; gap: 12px; margin: 0;
  font-family: var(--sans); font-size: .875rem; line-height: 1.65; font-weight: 400;
  cursor: pointer;
}
.registration-card .choice input {
  flex: none; width: 18px; height: 18px; margin: 3px 0 0; padding: 0;
  accent-color: var(--ink); cursor: pointer;
}
.choice input:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
.choice-inline { min-width: 100px; min-height: 48px; padding: 12px 16px; border: 1px solid var(--gray); border-radius: 4px; }
.choice-inline:has(input:checked) { border-color: var(--ink); background: #edf4ff; }
.previous-events { margin-top: 28px; }
.field-hint { margin: 8px 0 0; color: var(--muted); font-size: .8125rem; line-height: 1.6; }
.other-event-field { margin: 20px 0 0; }
.registration-actions { padding-top: 24px; border-top: 1px solid var(--light-gray); }
.login-link { margin: 20px 0 0; text-align: center; font-size: .875rem; line-height: 1.6; color: var(--muted); }
.login-link a { margin-left: 4px; color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.registration-page .motion-toggle { position: fixed; }
@media (max-width: 640px) {
  .main.registration-main { padding: 32px 0; }
  .login-card.registration-card { padding: 28px 24px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .registration-card .card-heading { flex-direction: column-reverse; align-items: flex-start; gap: 16px; }
  .registration-card .card-brand { align-self: flex-end; width: 112px; }
  .registration-card h1 { font-size: 1.75rem; }
}
@media (max-width: 360px) {
  .login-card.registration-card { padding: 26px 20px; }
  .registration-card .card-brand { width: 100px; }
  .registration-card h1 { font-size: 1.625rem; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (min-width: 1600px) { .page { padding: 48px 88px 96px; } }
@media (max-width: 1100px) {
  .page { padding: 30px 36px 88px; }
}
@media (max-width: 800px) {
  .page { padding: 24px 24px 88px; }
  .header { justify-content: center; }
  .forum-brand {
    font-size: clamp(1rem, 6vw, 1.5625rem);
  }
  .main { padding: 36px 0; }
  .motion-toggle {
    right: max(18px, env(safe-area-inset-right));
    bottom: max(18px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 420px) {
  .page { padding: 20px 18px 88px; }
  .card-brand { width: clamp(92px, 28vw, 112px); }
  .login-card { padding: 32px 24px 28px; }
  .card-heading { margin-bottom: 28px; }
  h1 { font-size: 1.875rem; }
}
@media (max-height: 650px) {
  .motion-toggle { position: absolute; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* --- CTF 365: overrides so the light 365 background shows over the Next app shell --- */
html, body { background: #a9d3ff !important; }
#__next { background: transparent !important; position: static !important; min-height: 100vh; }
.background { z-index: 0; }
.page { position: relative; z-index: 1; }
