@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;700&family=Silkscreen&display=swap');

/* ── Tokens (from autcsi.nz) ──────────────────────────────── */
:root {
  --light-grey:       #a9a9a9;
  --green-dark:       #1ea31e;
  --bg-color:         #101010;
  --panel-bg:         #050505;
  --bg:               #050709;
  --bg-soft:          #0a0e10;
  --bg-card:          #0d1216;
  --neon-green:       #00c230;
  --green-glow:       rgba(0,255,65,0.3);
  --neon-green-dim:   #5cf759;
  --neon-green-faded: #3a8a5a;
  --neon-red:         #ff3344;
  --neon-blue:        #00d4ff;
  --text:             #c8d1c0;
  --text-dim:         #6a7a6e;
  --text-faint:       #3a5a48;
  --term-bg:          #0d0d0d;
  --term-green:       #00ff41;
  --term-text:        #cccccc;
  --term-border:      #333;
  --font-pixel:       'Silkscreen', cursive;
  --font-mono:        var(--font-pixel);
  --r:                0px;
}

/* ── Reset ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

/* ── Page shell ───────────────────────────────────────────── */
body {
  background-color: var(--bg-color);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── Multi-page layer ─────────────────────────────────────── */
.page {
  display: none;
  position: relative;
  min-height: 100vh;
  width: 100%;
  overflow: hidden;
  animation: pageIn .3s ease both;
}
.page--active { display: flex; align-items: center; justify-content: center; }
@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Matrix canvas (behind content) ──────────────────────── */
#matrix-canvas,
#matrix-canvas-ty,
#matrix-canvas-form {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

/* ── Splash pages (intro / thankyou) ─────────────────────── */
.splash-wrap {
  position: relative;
  z-index: 1;
  max-width: 560px;
  width: calc(100% - 48px);
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: rgba(13,13,13,0.82);
  border: 1px solid #009626;
  box-shadow: 0 0 15px rgba(0,0,0,0.8);
}
.splash-wrap--thankyou {
  align-items: center;
  text-align: center;
}

.splash-title {
  font-family: var(--font-pixel);
  font-size: clamp(1.2rem, 4vw, 2rem);
  color: #00c230;
  letter-spacing: 2px;
  text-transform: uppercase;
  line-height: 1.25;
  text-align: center;
  width: 100%;
}

.page-desc {
  font-family: var(--font-pixel);
  font-size: .8rem;
  color: var(--text);
  line-height: 1.9;
  letter-spacing: .05em;
}

.event-slogan {
  font-family: var(--font-pixel);
  font-size: .7rem;
  color: var(--text-dim);
  letter-spacing: .1em;
  text-align: center;
  width: 100%;
  margin-top: -.5rem;
}
.slogan-sep {
  color: var(--text-faint);
}

.splash-meta {
  font-family: var(--font-pixel);
  font-size: .75rem;
  color: var(--text-dim);
  letter-spacing: .08em;
}

/* Intro register button — matches .join-submit */
.splash-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  background: transparent;
  border: 1px solid #009626;
  color: var(--neon-green);
  font-family: var(--font-pixel);
  font-size: .85rem;
  letter-spacing: .12em;
  padding: 16px;
  margin-top: 8px;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s, text-shadow .2s;
}
.splash-btn:hover {
  background: rgba(0,255,65,0.08);
  border-color: #009626;
  text-shadow: 0 0 6px rgba(0,255,65,0.5);
  box-shadow: 0 0 12px rgba(0,255,65,0.15);
}
.splash-btn:active { opacity: .85; }

/* Thank-you check icon */
.thankyou-icon {
  width: 52px;
  height: 52px;
  border: 1px solid #009626;
  background: rgba(13,13,13,0.85);
  color: var(--neon-green);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  font-family: var(--font-pixel);
}

/* ── Form page ────────────────────────────────────────────── */
.form-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

#page-form { align-items: flex-start; }

.form-title {
  font-family: var(--font-pixel);
  font-size: clamp(1rem, 3.5vw, 1.5rem);
  color: #00c230;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
  padding-bottom: 20px;
  line-height: 1.3;
  text-align: center;
  width: 100%;
}

/* ── Join form (matches autcsi.nz .join-form) ─────────────── */
.join-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
  background: #0d0d0d;
  border: 1px solid #009626;
  padding: 32px;
  box-sizing: border-box;
  box-shadow: 0 0 15px rgba(0,0,0,0.8);
}
/* The inner <form> also needs column flex so fields stack correctly */
.join-form form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Form sections as visual groups inside the card */
.form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding-bottom: 20px;
}
.form-section:last-of-type {
  padding-bottom: 0;
}

.section-title {
  font-family: var(--font-pixel);
  font-size: .7rem;
  color: var(--neon-green);
  letter-spacing: .15em;
  text-transform: uppercase;
  opacity: .75;
}
.section-desc {
  font-family: var(--font-pixel);
  font-size: .72rem;
  color: var(--text-dim);
  letter-spacing: .05em;
  line-height: 1.7;
  margin-top: -10px;
}

/* ── Field wraps ──────────────────────────────────────────── */
.field-wrap { display: flex; flex-direction: column; gap: 8px; }

label {
  font-family: var(--font-pixel);
  font-size: .72rem;
  color: var(--neon-green);
  letter-spacing: .12em;
  text-transform: none;
  font-weight: 400;
  opacity: .85;
}
label::before { content: '> '; }
.req { color: var(--neon-green-dim); margin-left: .1em; }

/* ── Text inputs — matches autcsi.nz .join-form input ─────── */
input[type=text],
input[type=email],
input[type=number],
input[type=tel],
input[type=url],
input[type=date],
input[type=time],
input[type=password],
textarea,
select {
  background: rgba(5,7,9,0.6);
  border: 1px solid #009626;
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: .875rem;
  padding: 12px 14px;
  letter-spacing: .05em;
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  outline: none;
  border-radius: 0;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); font-family: var(--font-pixel); }
input:hover, textarea:hover, select:hover { border-color: #009626; }
input:focus, textarea:focus, select:focus {
  border-color: #009626;
  background: rgba(5,7,9,0.85);
  box-shadow: 0 0 12px rgba(0,255,65,0.15);
}
input.invalid, textarea.invalid, select.invalid {
  border-color: rgba(255,51,68,0.6);
  box-shadow: 0 0 8px rgba(255,51,68,0.15);
}
textarea { resize: vertical; min-height: 90px; }

/* Select custom arrow */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%236a7a6e'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
select option { background: var(--bg-card); color: var(--text); }

/* ── Radio & Checkbox — row style ─────────────────────────── */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid #009626;
}

.radio-label,
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 10px 14px;
  border-bottom: 1px solid #009626;
  cursor: pointer;
  font-family: var(--font-pixel);
  font-size: .82rem;
  color: var(--text-dim);
  letter-spacing: .04em;
  text-transform: none;
  font-weight: 400;
  position: relative;
  transition: background .15s, color .15s;
  background: rgba(5,7,9,0.5);
}
.radio-label:last-child,
.checkbox-label:last-child { border-bottom: none; }
.radio-label:hover,
.checkbox-label:hover {
  background: rgba(0,255,65,0.06);
  color: var(--text);
}
.radio-label::before,
.checkbox-label::before {
  content: '> ';
  color: var(--neon-green);
  opacity: .4;
  margin-right: 4px;
  font-family: var(--font-pixel);
  font-size: .78rem;
  transition: opacity .15s;
  flex-shrink: 0;
}
.radio-label:hover::before,
.checkbox-label:hover::before,
.radio-label.is-checked::before,
.checkbox-label.is-checked::before { opacity: 1; }

/* Hide native inputs, use custom right-side indicator */
.radio-label input[type=radio],
.checkbox-label input[type=checkbox] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.radio-label::after,
.checkbox-label::after {
  content: '';
  flex-shrink: 0;
  margin-left: auto;
  width: 12px;
  height: 12px;
  border: 1px solid #009626;
  background: transparent;
  transition: background .15s, border-color .15s;
}
.radio-label::after { border-radius: 50%; }

/* Checked state — CSS :has() + .is-checked JS fallback */
.radio-label:has(input:checked)::after,
.checkbox-label:has(input:checked)::after,
.radio-label.is-checked::after,
.checkbox-label.is-checked::after {
  background: var(--neon-green);
  border-color: #009626;
  box-shadow: 0 0 6px rgba(0,255,65,0.4);
}
.radio-label:has(input:checked),
.checkbox-label:has(input:checked),
.radio-label.is-checked,
.checkbox-label.is-checked {
  color: var(--text);
  background: rgba(0,255,65,0.06);
}
.radio-label:has(input:checked)::before,
.checkbox-label:has(input:checked)::before,
.radio-label.is-checked::before,
.checkbox-label.is-checked::before { opacity: 1; }

/* ── Range ────────────────────────────────────────────────── */
.range-wrap { display: flex; align-items: center; gap: 12px; }
input[type=range] {
  flex: 1;
  accent-color: var(--neon-green);
  padding: 0;
  border: none;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}
.range-val {
  font-family: var(--font-pixel);
  font-size: .8rem;
  color: var(--neon-green);
  min-width: 2.5ch;
}

/* ── Divider & Info ───────────────────────────────────────── */
.field-divider {
  border: none;
  border-top: 1px solid #009626;
  margin: 4px 0;
}
.info-block {
  font-family: var(--font-pixel);
  font-size: .8rem;
  color: var(--text-dim);
  line-height: 1.7;
  padding: 10px 14px;
  border-left: 2px solid #009626;
  background: rgba(5,7,9,0.5);
  letter-spacing: .04em;
}
/* BBCode list output */
.page-desc ul, .page-desc ol,
.section-desc ul, .section-desc ol,
.info-block ul, .info-block ol {
  margin: .5rem 0 .5rem 1.4rem;
  padding: 0;
}
.page-desc li, .section-desc li, .info-block li {
  margin-bottom: .25rem;
}

/* ── Other text input reveal ──────────────────────────────── */
.other-input {
  display: none;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding: 0 14px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: rgba(5,7,9,0.6);
  color: var(--text);
  font-family: var(--font-pixel);
  font-size: .875rem;
  letter-spacing: .04em;
  pointer-events: none;
  transition: max-height .22s ease, opacity .18s ease, padding .18s ease;
}
.other-input--visible {
  display: block;
  max-height: 3.2rem;
  opacity: 1;
  padding: 12px 14px;
  pointer-events: auto;
}
.other-input:hover,
.other-input:focus,
.other-input--visible:focus {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: rgba(5,7,9,0.85);
}
.other-input.invalid { outline: 1px solid rgba(255,51,68,0.6) !important; }

/* ── Submit button — matches autcsi.nz .join-submit ──────── */
.join-submit {
  background: transparent;
  border: 1px solid #009626;
  color: var(--neon-green);
  font-family: var(--font-pixel);
  font-size: .85rem;
  letter-spacing: .12em;
  padding: 16px;
  margin-top: 8px;
  cursor: pointer;
  transition: background .2s, border-color .2s, box-shadow .2s, text-shadow .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
}
.join-submit:hover:not(:disabled) {
  background: rgba(0,255,65,0.08);
  border-color: #009626;
  text-shadow: 0 0 6px rgba(0,255,65,0.5);
  box-shadow: 0 0 12px rgba(0,255,65,0.15);
}
.join-submit:disabled { opacity: .5; cursor: not-allowed; }
.btn-spinner { animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Form message ─────────────────────────────────────────── */
.form-msg {
  font-family: var(--font-pixel);
  font-size: .8rem;
  letter-spacing: .05em;
  padding: 12px 14px;
  margin-bottom: 4px;
  line-height: 1.6;
  white-space: pre-line;
  border-left: 2px solid;
}
.form-msg.success { color: var(--neon-green); border-color: #009626; background: rgba(0,255,65,0.05); }
.form-msg.error   { color: var(--neon-red);   border-color: var(--neon-red);   background: rgba(255,51,68,0.05); }

/* ── Blinking cursor (from autcsi.nz) ────────────────────── */
.cursor {
  display: inline-block;
  width: 8px;
  height: 2px;
  background-color: var(--neon-green);
  margin-left: 3px;
  margin-top: 10px;
  animation: blink 1s infinite;
  vertical-align: middle;
}
@keyframes blink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 600px) {
  .form-container { padding: 40px 16px 60px; }
  .join-form      { padding: 24px 16px; }
  .splash-wrap    { padding: 36px 20px; }
}