/* Auth pages (sign in / sign up) — Clash and Collaborate
   Split screen. Left: a disciplined Swiss form column (mono eyebrows,
   hairline rules, one orange action). Right: a raid boss, live in voxels,
   idling and taunting. Orange is reserved for the action and live data. */

:root {
  --bg: #18181b;
  --bg-2: #1d1d21;
  --surface: #1f1f23;
  --line: rgba(255, 255, 255, 0.14);
  --line-soft: rgba(255, 255, 255, 0.08);
  --txt: #f6f6f6;
  --muted: #9b9ba3;
  --orange: #ff7a18;
  --orange-deep: #c85a0e;
  --danger: #e5484d;
  --ok: #46a758;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--txt);
  font-family: "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

.split {
  display: grid;
  grid-template-columns: minmax(420px, 520px) 1fr;
  min-height: 100vh;
}
.pane { position: relative; }

/* ---------------- form pane ---------------- */
.form-pane {
  display: flex;
  flex-direction: column;
  padding: 28px 48px 24px;
  border-right: 1px solid var(--line-soft);
  background: var(--bg);
  z-index: 2;
}
.brand { display: inline-flex; align-items: center; width: fit-content; }
.logo { height: 58px; width: auto; display: block; }

.form-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 380px;
  padding: 32px 0;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.1rem;
}
.eyebrow .dot { width: 6px; height: 6px; background: var(--orange); border-radius: 50%; }

h1 {
  font-size: clamp(2rem, 3.4vw, 2.6rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.02;
  margin: 0 0 0.7rem;
}
.lede { margin: 0 0 2rem; color: var(--muted); line-height: 1.55; font-size: 0.95rem; }

.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }

.field label, .label-row label {
  display: block;
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}
.label-row { display: flex; justify-content: space-between; align-items: baseline; }
.label-row label { margin-bottom: 0.5rem; }
.forgot-link {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.forgot-link:hover { color: var(--txt); border-color: var(--line); }

.field input, .password-wrap input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--txt);
  font: 500 0.97rem "Inter", sans-serif;
  padding: 0.85rem 0.95rem;
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.field input::placeholder { color: rgba(155, 155, 163, 0.55); }
.field input:hover { border-color: rgba(255, 255, 255, 0.22); }
.field input:focus { border-color: var(--orange); background: var(--bg); }
.field input:-webkit-autofill {
  -webkit-text-fill-color: var(--txt);
  -webkit-box-shadow: 0 0 0 1000px var(--bg-2) inset;
  caret-color: var(--txt);
}

.password-wrap { position: relative; }
.password-wrap input { padding-right: 2.9rem; }
.password-toggle {
  position: absolute;
  right: 0.35rem; top: 50%;
  transform: translateY(-50%);
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 0; border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.password-toggle:hover { color: var(--txt); background: rgba(255, 255, 255, 0.06); }
.password-toggle[aria-pressed="true"] { color: var(--orange); }
.password-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 1px; }

.remember {
  display: flex; align-items: center; gap: 0.65rem;
  font-size: 0.86rem; color: var(--muted);
  cursor: pointer; user-select: none;
  margin-top: 0.1rem;
}
.remember input { position: absolute; opacity: 0; width: 0; height: 0; }
.remember .box {
  width: 16px; height: 16px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg-2);
  position: relative;
  transition: border-color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.remember .box::after {
  content: "";
  position: absolute; left: 4px; top: 1px;
  width: 5px; height: 9px;
  border: solid #141414; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.12s;
}
.remember input:checked + .box { background: var(--orange); border-color: var(--orange); }
.remember input:checked + .box::after { transform: rotate(45deg) scale(1); }
.remember input:focus-visible + .box { outline: 2px solid var(--orange); outline-offset: 2px; }
.remember:hover { color: var(--txt); }

.btn-primary {
  text-decoration: none;
  margin-top: 0.6rem;
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: var(--orange);
  color: #141414;
  border: 1px solid var(--orange);
  border-radius: 10px;
  padding: 0.95rem 1.1rem;
  font: 700 0.95rem "Inter", sans-serif;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn-primary .btn-arrow { font-family: var(--mono); transition: transform 0.15s; }
.btn-primary:hover { background: var(--orange-deep); border-color: var(--orange-deep); }
.btn-primary:hover .btn-arrow { transform: translateX(3px); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.btn-primary[disabled] { opacity: 0.6; cursor: wait; }
.btn-primary.loading .btn-arrow { animation: nudge 0.8s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateX(4px); } }

/* two-up name row + password strength (sign up) */
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.8rem; }
.strength { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.55rem; }
.strength.hidden { display: none; }
.strength .track { flex: 1; height: 3px; background: var(--line-soft); border-radius: 2px; overflow: hidden; }
.strength .bar { height: 100%; width: 0; background: var(--danger); transition: width 0.25s, background 0.25s; }
.strength .bar.weak { width: 33%; background: var(--danger); }
.strength .bar.medium { width: 66%; background: var(--orange); }
.strength .bar.strong { width: 100%; background: var(--ok); }
.strength .txt { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; color: var(--muted); white-space: nowrap; }
.strength .txt.strong { color: var(--ok); }
.terms { font-size: 0.74rem; color: var(--muted); line-height: 1.5; margin-top: 0.2rem; }
.terms a { color: var(--txt); text-decoration: none; border-bottom: 1px solid var(--line); }
.terms a:hover { border-color: var(--orange); }

/* status line at the top of the form */
.error-line {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  line-height: 1.5;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--bg-2);
  color: var(--txt);
}
.error-line.error { border-left-color: var(--danger); color: #ffb4b6; }
.error-line.success { border-left-color: var(--ok); color: #b9efc6; }
.error-line .success-icon { margin-right: 0.5rem; color: var(--ok); }

.alt {
  margin-top: 1.6rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--line-soft);
  display: flex; gap: 0.5rem; align-items: baseline;
  font-size: 0.88rem; color: var(--muted);
}
.alt a { color: var(--txt); text-decoration: none; font-weight: 600; border-bottom: 1px solid var(--line); }
.alt a:hover { border-color: var(--orange); }

.pane-foot {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.pane-foot a { color: inherit; text-decoration: none; }
.pane-foot a:hover { color: var(--txt); }

/* ---------------- password reset states ---------------- */
.state { display: none; }
.state.on { display: block; }
.state .auth-form { margin-top: 0; }

.sent {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-2);
  padding: 1.1rem 1.15rem;
}
.sent .sent-row {
  display: flex; align-items: center; gap: 0.8rem;
  font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--muted);
}
.sent .sent-row .tick {
  width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ok); color: #141414;
  font-size: 0.8rem; font-weight: 800; flex-shrink: 0;
}
.sent .sent-email {
  margin: 0.8rem 0 0;
  font: 600 1rem "Inter", sans-serif;
  color: var(--txt);
  word-break: break-all;
}
.sent .sent-note { margin: 0.5rem 0 0; font-size: 0.84rem; color: var(--muted); line-height: 1.55; }

.actions { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 1.2rem; }
.btn-ghost {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%;
  background: transparent;
  color: var(--txt);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.9rem 1.1rem;
  font: 600 0.9rem "Inter", sans-serif;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.15s, background 0.15s;
}
.btn-ghost:hover { border-color: rgba(255, 255, 255, 0.3); background: rgba(255, 255, 255, 0.03); }
.btn-ghost[disabled] { opacity: 0.5; cursor: default; }
.btn-ghost .btn-arrow { font-family: var(--mono); color: var(--muted); }
.btn-ghost .countdown { font-family: var(--mono); font-size: 0.7rem; color: var(--orange); }

.rules { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem 1rem; }
.rules li {
  font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em;
  color: var(--muted); display: flex; align-items: center; gap: 0.4rem;
}
.rules li::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--line); }
.rules li.ok { color: var(--txt); }
.rules li.ok::before { background: var(--ok); }

.match-note { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.06em; margin-top: 0.5rem; min-height: 1em; }
.match-note.bad { color: #ffb4b6; }
.match-note.good { color: var(--ok); }

.checking { display: flex; align-items: center; gap: 0.7rem; color: var(--muted); font-size: 0.9rem; }
.checking .spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--line); border-top-color: var(--orange);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------------- stage pane ---------------- */
.stage-pane { overflow: hidden; background: #0e0e11; }
.scene { position: absolute; inset: 0; opacity: 0; transition: opacity 0.9s ease; }
.scene.on { opacity: 1; }
.scene canvas { display: block; }
.stage-fade {
  position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(24, 24, 27, 0.85) 0%, rgba(24, 24, 27, 0) 22%);
}

.stage-caption {
  position: absolute;
  left: 40px; bottom: 34px;
  z-index: 3;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.85);
}
.cap-eyebrow { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted); }
.cap-name { font-size: clamp(1.6rem, 3vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; margin-top: 0.3rem; }
.cap-epithet { color: var(--muted); font-size: 0.86rem; }
.cap-hint { margin-top: 0.7rem; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.08em; color: var(--orange); }

/* floating text spawned by the stage — unused here but harmless */
.dmg-num { position: fixed; pointer-events: none; font-family: var(--mono); font-weight: 700; color: var(--orange); }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  body { overflow: auto; }
  .split { grid-template-columns: 1fr; min-height: 100vh; }
  .stage-pane { display: none; }
  .form-pane { border-right: 0; padding: 22px 24px 20px; min-height: 100vh; }
  .form-col { max-width: 440px; padding: 24px 0; }
  .field-row { grid-template-columns: 1fr; }
  .logo { height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
