/* ============================================================
   Auth — split screen. Path fan on the left, form on the right.
   ============================================================ */

.auth {
  position: relative;
  z-index: 2;
  min-height: 100svh;
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}

/* --- left: the Monte Carlo path fan ------------------------- */
.auth-art {
  position: relative;
  overflow: hidden;
  border-right: 1px solid var(--line-0);
  background: radial-gradient(ellipse 90% 70% at 20% 25%, #0A1128, var(--bg-0) 70%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 2.4rem;
}
#paths-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  /* Weighted up and right: the logo sits top-left and the copy bottom-left,
     so the fan has to clear that corner. */
  mask-image: linear-gradient(#000 52%, transparent 74%);
  -webkit-mask-image: linear-gradient(#000 52%, transparent 74%);
}
.auth-art > * { position: relative; z-index: 1; }

.auth-quote { max-width: 26rem; margin-bottom: 1rem; }
.auth-quote h2 {
  font-size: clamp(1.6rem, 2.3vw, 2.35rem);
  line-height: 1.12;
}
.auth-quote p { color: var(--ink-2); margin-top: 1rem; font-size: .95rem; }
.auth-quote .formula {
  display: block;
  margin-top: 1.6rem;
  padding: .95rem 1.1rem;
  border: 1px solid var(--line-1);
  /* Cyan, not orange: the one orange in this view is the followed path. */
  border-left: 2px solid var(--ir-cyan);
  border-radius: var(--r-sm);
  background: rgba(4, 6, 13, .62);
  backdrop-filter: blur(8px);
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--ink-1);
  letter-spacing: .02em;
  line-height: 1.7;
}
.auth-quote .formula em { color: var(--ink-3); font-style: normal; }
.auth-quote .formula sup { font-size: .78em; }

/* --- right: the form ---------------------------------------- */
.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 3rem clamp(1.5rem, 5vw, 4.5rem);
  background: var(--bg-1);
}
.auth-inner { width: 100%; max-width: 26rem; margin-inline: auto; }
.auth-inner > .mark { margin-bottom: 2.6rem; }
.auth-inner h1 {
  font-size: clamp(1.9rem, 3vw, 2.5rem);
  margin-top: 1rem;
}
.auth-inner .lede { font-size: .95rem; margin-top: .85rem; }

form.auth-form { margin-top: 2.4rem; display: grid; gap: 1.15rem; }

.field { display: grid; gap: .45rem; }
.field label {
  font-family: var(--font-mono);
  font-size: var(--t-micro);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.field input {
  width: 100%;
  padding: .85rem 1rem;
  background: var(--bg-0);
  border: 1px solid var(--line-1);
  border-radius: var(--r-sm);
  color: var(--ink-0);
  font-size: .96rem;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease),
              background .25s var(--ease);
}
.field input::placeholder { color: var(--ink-3); }
.field input:hover { border-color: var(--line-2); }
.field input:focus {
  outline: none;
  border-color: var(--ir-blue-lit);
  background: #05080F;
  box-shadow: 0 0 0 3px rgba(19, 55, 245, .18);
}
.field.code input {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  letter-spacing: .28em;
  text-align: center;
  text-transform: uppercase;
  border-color: color-mix(in srgb, var(--ir-orange) 30%, var(--line-1));
}
.field.code input:focus {
  border-color: var(--ir-orange);
  box-shadow: 0 0 0 3px rgba(255, 102, 0, .16);
}
.field .help { font-size: .78rem; color: var(--ink-3); }
.field .err {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--down);
  letter-spacing: .02em;
}
.field.has-error input { border-color: var(--down); }

.form-error {
  padding: .8rem 1rem;
  border: 1px solid color-mix(in srgb, var(--down) 40%, transparent);
  border-left: 2px solid var(--down);
  border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--down) 9%, transparent);
  color: #FFC9CF;
  font-size: .875rem;
}

.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 460px) { .two-up { grid-template-columns: 1fr; } }

.auth-alt {
  margin-top: 2rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--line-0);
  font-size: .875rem;
  color: var(--ink-3);
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
}
.auth-alt a { color: var(--ir-cyan-lit); }
.auth-alt a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --- responsive ---------------------------------------------
   Keep this block LAST. `.auth-art` sets `display: flex` at the
   same specificity, so an earlier media query loses the cascade
   and the art panel stays visible on phones.
   ------------------------------------------------------------ */
@media (max-width: 940px) {
  .auth { grid-template-columns: 1fr; }
  /* Form first on a phone — the panel art is not worth a screen of scrolling. */
  .auth-art { display: none; }
  .auth-panel { padding: 2.5rem 1.5rem; min-height: 100svh; }
}
