@font-face {
  font-family: "Phantom Sans";
  src: url("https://assets.hackclub.com/fonts/Phantom_Sans_0.7/Regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: "Phantom Sans";
  src: url("https://assets.hackclub.com/fonts/Phantom_Sans_0.7/Bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

:root {
  --background: #17171d;
  --surface: #252429;
  --red: #ec3750;
  --text: #f8f8f9;
  --copy: #c5c7cd;
  --muted: #8492a6;
  --rule: #3a3940;
  --error: #ff8c37;
}

* { box-sizing: border-box; }

html { background: var(--background); }

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--background);
  color: var(--text);
  font-family: "Phantom Sans", Inter, Arial, sans-serif;
}

button,
input { font: inherit; }

.signup-shell {
  display: flex;
  width: 100%;
  min-height: 100dvh;
  flex-direction: column;
}

.brand-header {
  position: relative;
  width: 100%;
  max-width: 402px;
  height: 158px;
  flex: 0 0 158px;
  margin: 0 auto;
  overflow: hidden;
}

.brand-header img {
  position: absolute;
  top: 0;
  left: 50%;
  display: block;
  width: 280px;
  height: 158px;
  transform: translateX(-50%);
}

.view-stage {
  display: grid;
  width: 100%;
  flex: 1 0 auto;
}

.view {
  min-width: 0;
  grid-area: 1 / 1;
}

.view[hidden] {
  display: none !important;
}

.page-content {
  display: flex;
  width: 100%;
  max-width: 402px;
  flex: 1 0 auto;
  flex-direction: column;
  margin: 0 auto;
  padding: 8px 32px 0;
}

.intro h1,
.finish-content h1 {
  margin: 0;
  font-size: clamp(31px, 8.5vw, 36px);
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: 0;
}

.intro h1 span,
.finish-content h1 span { color: var(--red); }

.intro p {
  margin: 28px 0 0;
  color: var(--copy);
  font-size: 16px;
  line-height: 1.42;
  letter-spacing: 0;
}

.form-flow { margin-top: 47px; }

.divider {
  width: 100%;
  height: 1px;
  margin-bottom: 20px;
  background: var(--rule);
}

.field-label,
.interest-fieldset legend {
  display: block;
  margin-bottom: 16px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
}

.field-label span { color: var(--red); }

.email-field input {
  width: 100%;
  height: 41px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 5px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.email-field input::placeholder { color: var(--muted); opacity: 1; }
.email-field input:focus { border-color: var(--red); box-shadow: 0 0 0 3px rgb(236 55 80 / 18%); }

.email-field input.is-invalid,
.email-field input.is-invalid:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgb(236 55 80 / 18%);
  animation: field-shake 280ms ease;
}

.email-field > span {
  display: block;
  margin-top: 7px;
  color: #5d636c;
  font-size: 14px;
  font-weight: 700;
}

.error-message,
.form-status {
  min-height: 18px;
  margin: 5px 0 0;
  color: var(--red);
  font-size: 13px;
  line-height: 18px;
}

.form-status:empty {
  min-height: 0;
  margin: 0;
}

.interest-fieldset {
  min-width: 0;
  margin: 20px 0 0;
  padding: 0;
  border: 0;
}

.interest-fieldset legend { margin-bottom: 8px; }

.interest-fieldset label {
  display: flex;
  align-items: center;
  width: fit-content;
  margin: 7px 0;
  color: var(--copy);
  cursor: pointer;
  font-size: 16px;
  line-height: 1.22;
  transition: color 160ms ease, transform 160ms ease;
}

.interest-fieldset label:hover {
  color: var(--text);
  transform: translateX(3px);
}

.interest-fieldset label > span {
  display: inline-flex;
  align-items: center;
}

.interest-fieldset input {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin: 0 8px 0 0;
  appearance: none;
  border: 1px solid var(--copy);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1), transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.interest-fieldset input:checked {
  border-color: var(--red);
  box-shadow: inset 0 0 0 4px var(--background), inset 0 0 0 10px var(--red);
  transform: scale(1.12);
}

.interest-fieldset input:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

.interest-fieldset input:checked + span {
  color: var(--text);
  animation: choice-selected 300ms cubic-bezier(0.22, 1, 0.36, 1);
}

.interest-fieldset.is-invalid {
  animation: field-shake 280ms ease;
}

.is-current[data-view="details"] .interest-fieldset label {
  animation: choice-enter 360ms backwards cubic-bezier(0.22, 1, 0.36, 1);
}

.is-current[data-view="details"] .interest-fieldset label:nth-of-type(2) { animation-delay: 45ms; }
.is-current[data-view="details"] .interest-fieldset label:nth-of-type(3) { animation-delay: 90ms; }
.is-current[data-view="details"] .interest-fieldset label:nth-of-type(4) { animation-delay: 135ms; }

.inline-emoji {
  width: 1.15em;
  height: 1.15em;
  margin-left: 0.3em;
  object-fit: contain;
}

.primary-button {
  width: 100%;
  min-height: 58px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: white;
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  transition: transform 120ms ease, background 120ms ease;
}

.primary-button:hover { background: #f63b57; }
.primary-button:active { transform: translateY(1px); }
.primary-button:disabled { cursor: wait; opacity: 0.7; }
.primary-button:focus-visible { outline: 3px solid white; outline-offset: 3px; }

.form-flow > .primary-button {
  margin-top: 45px;
}

a.primary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.discord-button {
  margin-top: 42px;
  max-width: 250px;
}

.button-row {
  display: grid;
  grid-template-columns: 0.38fr 0.62fr;
  gap: 12px;
  margin-top: 42px;
}

.button-row .primary-button {
  margin-top: 0;
}

.secondary-button {
  min-height: 58px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: transparent;
  color: var(--copy);
  cursor: pointer;
  font-size: 17px;
  font-weight: 700;
  transition: transform 120ms ease, border-color 120ms ease, color 120ms ease;
}

.secondary-button:hover {
  border-color: var(--copy);
  color: var(--text);
}

.secondary-button:active { transform: translateY(1px); }
.secondary-button:disabled { cursor: wait; opacity: 0.55; }
.secondary-button:focus-visible { outline: 3px solid white; outline-offset: 3px; }

.admin-shell {
  width: min(1120px, 100%);
  min-height: 100dvh;
  margin: 0 auto;
  padding: 32px 20px;
}

.admin-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 34px;
}

.admin-header p {
  margin: 0 0 8px;
  color: var(--red);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-header h1 {
  margin: 0;
  font-size: clamp(36px, 7vw, 64px);
  line-height: 1;
}

.admin-logout {
  width: auto;
  min-width: 92px;
  padding: 0 18px;
}

.admin-login {
  max-width: 440px;
}

.admin-login-form {
  padding-top: 8px;
}

.admin-login-form .primary-button {
  margin-top: 22px;
}

.admin-panel {
  animation: view-enter 360ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.admin-toolbar p {
  margin: 0;
  color: var(--copy);
  font-size: 15px;
  font-weight: 700;
}

.admin-actions {
  display: flex;
  gap: 10px;
}

.admin-actions .primary-button,
.admin-actions .secondary-button {
  width: auto;
  min-height: 44px;
  padding: 0 16px;
  font-size: 14px;
}

.admin-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--surface);
}

.admin-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  line-height: 1.35;
  text-align: left;
  vertical-align: top;
}

.admin-table th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.admin-table td {
  color: var(--copy);
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-empty {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.page-content--verify { padding-top: 50px; }
.page-content--verify .form-flow { margin-top: 57px; }

.finish-content {
  display: flex;
  width: 100%;
  max-width: 560px;
  flex: 1 0 auto;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: 0 32px 60px;
  text-align: center;
}

.checkmark {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 25px;
  border: 2px solid var(--red);
  border-radius: 50%;
  color: var(--red);
  font-size: 38px;
  font-weight: 700;
  line-height: 1;
  place-items: center;
}

.finish-content h1 { font-size: 42px; }

.finish-content p {
  margin: 22px 0 0;
  color: var(--copy);
  font-size: 17px;
  line-height: 1.45;
}

.finish-content strong { color: var(--text); font-weight: 700; }
.finish-content .finish-note { max-width: none; margin-top: 32px; color: var(--muted); font-size: 14px; }

.page-footer {
  width: 100%;
  max-width: 402px;
  flex: 0 0 auto;
  margin: 0 auto;
  padding: 18px 32px 20px;
  text-align: center;
}

.page-footer > p {
  margin: 0 0 15px;
  color: var(--muted);
  font-size: 12px;
}

.progress-meter {
  display: grid;
  max-width: 330px;
  grid-template-columns: repeat(3, 1fr);
  margin: 0 auto;
  padding: 0;
  list-style: none;
}

.progress-meter li {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  color: #5d636c;
  font-size: 11px;
  line-height: 1;
  text-align: center;
}

.progress-meter li:not(:last-child)::after {
  position: absolute;
  z-index: 0;
  top: 10px;
  right: calc(-50% + 13px);
  left: calc(50% + 13px);
  height: 1px;
  background: var(--rule);
  content: "";
}

.progress-meter li.is-complete::after { background: var(--red); }

.progress-dot {
  position: relative;
  z-index: 1;
  display: grid;
  width: 21px;
  height: 21px;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: var(--background);
  font-size: 11px;
  font-weight: 700;
  place-items: center;
}

.progress-label {
  display: block;
  margin-top: 7px;
  font-weight: 700;
  white-space: nowrap;
}

.progress-meter li.is-active,
.progress-meter li.is-complete { color: var(--red); }
.progress-meter li.is-complete .progress-dot { background: var(--red); color: white; }

.view.is-entering { animation: view-enter 360ms cubic-bezier(0.22, 1, 0.36, 1) both; }
.view.is-leaving { pointer-events: none; animation: view-exit 190ms ease-in both; }

@keyframes view-enter {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes view-exit {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-8px); }
}

@keyframes choice-enter {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes choice-selected {
  0% { transform: translateX(0); }
  50% { transform: translateX(5px); }
  100% { transform: translateX(0); }
}

@keyframes field-shake {
  0%, 100% { transform: translateX(0); }
  30% { transform: translateX(-4px); }
  60% { transform: translateX(4px); }
}

@media (min-width: 700px) {
  .brand-header,
  .page-content,
  .page-footer { max-width: 720px; }

  .page-content,
  .page-footer { padding-right: 48px; padding-left: 48px; }

  .brand-header img { left: 48px; transform: none; }

  .intro h1,
  .finish-content h1 { font-size: 42px; }

  .primary-button { max-width: 420px; }
  .progress-meter { max-width: 390px; }
}

@media (min-width: 960px) {
  .brand-header,
  .page-content,
  .page-footer { max-width: 1180px; }

  .brand-header { height: 176px; flex-basis: 176px; }

  .page-content {
    display: grid;
    grid-template-columns: minmax(300px, 0.85fr) minmax(420px, 1.15fr);
    gap: clamp(72px, 9vw, 148px);
    align-content: start;
    padding-top: 50px;
  }

  .page-content .intro { padding-top: 22px; }
  .page-content .form-flow { width: 100%; margin-top: 0; }
  .page-content .primary-button { max-width: none; }

  .intro h1,
  .finish-content h1 { font-size: clamp(46px, 4.3vw, 58px); }
  .intro p { font-size: 18px; }

  .page-content--verify .form-flow { max-width: 560px; }
  .page-footer { padding-top: 32px; }
}

@media (max-height: 760px) and (max-width: 959px) {
  .brand-header { height: 128px; flex-basis: 128px; }
  .brand-header img { top: -15px; }
  .intro p { margin-top: 18px; }
  .form-flow { margin-top: 28px; }
  .interest-fieldset { margin-top: 8px; }
  .interest-fieldset label { margin: 5px 0; }
  .primary-button { margin-top: 24px; }
}

@media (max-width: 620px) {
  .admin-shell {
    padding: 24px 16px;
  }

  .admin-header,
  .admin-toolbar,
  .admin-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-actions .primary-button,
  .admin-actions .secondary-button,
  .admin-logout {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}
