/* Sign in / create account. Builds on the tokens in base.css.
   The older token names below are aliases, so this sheet stays readable while the
   rest of the site uses the base.css names. */
:root {
  --canvas: var(--paper);
  --rule-strong: var(--rule-2);
  --panel: var(--wash);
  --signal: var(--action);
  --font-display: var(--display);
  --font-body: var(--sans);
  --font-mono: var(--mono);
}
.mono { font-family: var(--mono); font-size: 0.6875rem; letter-spacing: 0.1em; text-transform: uppercase; }

.auth-body { min-height: 100svh; padding-top: 0; }   /* no floating nav on this page */
.auth { min-height: 100svh; display: grid; grid-template-columns: minmax(320px, 5fr) 7fr; }

/* ---------- brand panel ---------- */
.auth__brand {
  position: relative; overflow: hidden;
  background: var(--canvas); color: var(--ink);
  padding: clamp(24px, 3vw, 44px) clamp(24px, 4vw, 56px);
  display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
}
.auth__brand-rules { position: absolute; inset: 0; pointer-events: none; }
.auth__brand-rules i { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--rule); transform-origin: top; animation: rule-in 1.4s var(--ease-io) both; }
.auth__brand-rules i:nth-child(1) { left: 25%; animation-delay: 0.05s; }
.auth__brand-rules i:nth-child(2) { left: 50%; animation-delay: 0.15s; }
.auth__brand-rules i:nth-child(3) { left: 75%; animation-delay: 0.25s; }
@keyframes rule-in { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.auth__home { position: relative; display: inline-flex; align-items: center; align-self: flex-start; }
.auth__home img { width: auto; height: 22px; transition: opacity 0.4s var(--ease); }
.auth__home:hover img { opacity: 0.82; }
.auth__brand-copy { position: relative; display: flex; flex-direction: column; gap: 18px; }
.auth__brand-copy h1 { font-size: clamp(2.2rem, 3.6vw, 4rem); letter-spacing: -0.04em; line-height: 0.98; max-width: 11ch; }
.auth__brand-copy p { max-width: 34ch; }
.auth__facts { position: relative; display: flex; flex-direction: column; border-top: 1px solid var(--rule); }
.auth__facts li { display: grid; grid-template-columns: 1fr 1.4fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--rule); }
.auth__facts b { font-weight: 500; color: var(--ink); }
.auth__facts span { color: var(--ink-3); text-transform: none; letter-spacing: 0.02em; font-size: 0.78rem; }

/* ---------- form panel ---------- */
.auth__panel {
  display: flex; flex-direction: column;
  padding: clamp(24px, 3vw, 44px) clamp(24px, 6vw, 96px);
  border-left: 1px solid var(--rule);
}
.auth__switch { position: relative; display: inline-flex; align-self: flex-start; border-bottom: 1px solid var(--rule); margin-bottom: clamp(32px, 6vh, 64px); }
.auth__switch button { padding: 14px clamp(16px, 2vw, 28px); color: var(--ink-3); transition: color 0.35s; }
.auth__switch button[aria-selected="true"], .auth__switch button:hover { color: var(--ink); }
.auth__indicator { position: absolute; bottom: -1px; left: 0; height: 2px; width: 0; background: var(--ink); transition: left 0.6s var(--ease), width 0.6s var(--ease); }
.auth__indicator::after { content: ""; position: absolute; right: 0; top: -2px; width: 6px; height: 6px; border-radius: 50%; background: var(--signal); }

.auth__views { flex: 1; position: relative; max-width: 460px; width: 100%; }
.view { display: none; flex-direction: column; gap: 22px; }
.view.is-active { display: flex; animation: view-in 0.7s var(--ease) both; }
@keyframes view-in { from { clip-path: inset(0 0 100% 0); transform: translateY(-8px); } to { clip-path: inset(0 0 0% 0); transform: none; } }
.view__head { display: flex; flex-direction: column; gap: 8px; }
.view__head h2 { font-size: clamp(1.8rem, 2.6vw, 2.6rem); letter-spacing: -0.035em; }
.view__head p b { font-weight: 500; color: var(--ink); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  min-height: 52px; padding: 0 22px; border: 1px solid var(--ink);
  font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase;
  position: relative; overflow: hidden; isolation: isolate;
  transition: color 0.4s var(--ease), border-color 0.4s, transform 0.5s var(--spring);
}
.btn::before { content: ""; position: absolute; inset: 0; background: var(--ink); z-index: -1; transform: scaleY(0); transform-origin: bottom; transition: transform 0.5s var(--ease); }
.btn--primary { color: #f5f3ee; }
.btn--primary::before { transform: scaleY(1); }
.btn--primary:hover::before { transform-origin: top; transform: scaleY(0.94); }
.btn--primary:hover { color: #f5f3ee; }
.btn--primary:active { transform: scale(0.985); }
.btn--ghost { color: var(--ink); border-color: var(--rule-strong); }
.btn--ghost:hover { border-color: var(--ink); }
.btn--ghost:hover::before { transform: scaleY(1); }
.btn--ghost:hover { color: #f5f3ee; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn[disabled] { opacity: 0.6; pointer-events: none; }
.btn.is-loading span { opacity: 0; }
.btn.is-loading .spinner { opacity: 1; }
.spinner { position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid currentColor; border-right-color: transparent; opacity: 0; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btn--primary .spinner { border-right-color: var(--signal); }

.sso { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--ink-3); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--rule); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.field { display: flex; flex-direction: column; gap: 8px; }
.field label, .field__row label { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.field label em { font-style: normal; color: var(--ink-3); margin-left: 6px; }
.field__row { display: flex; justify-content: space-between; align-items: baseline; }
.field__aside { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); transition: color 0.3s; }
.field__aside:hover { color: var(--signal); }
.field input, .field select {
  width: 100%; min-height: 50px; padding: 0 14px; background: transparent; color: var(--ink);
  border: 1px solid var(--rule-strong); border-radius: 0; font: inherit; outline: none;
  transition: border-color 0.35s, box-shadow 0.35s;
  appearance: none; -webkit-appearance: none;
}
.field input:focus, .field select:focus { border-color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.field input:-webkit-autofill { -webkit-box-shadow: inset 0 0 0 100px var(--canvas); -webkit-text-fill-color: var(--ink); }
.field.is-invalid input, .field.is-invalid select { border-color: var(--signal); box-shadow: inset 0 -2px 0 var(--signal); }
.field__wrap { position: relative; }
.field__wrap input { padding-right: 48px; }
.field__wrap--select::after { content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px; border-right: 1px solid var(--ink); border-bottom: 1px solid var(--ink); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.field__wrap--select select { padding-right: 40px; cursor: pointer; }
.field__error { display: none; color: var(--signal); font-size: 0.85rem; }
.field.is-invalid .field__error { display: block; }
.field__hint { color: var(--ink-3); font-size: 0.66rem; }
.field__hint[hidden] { display: none; }
.mono-input { font-family: var(--font-mono) !important; letter-spacing: 0.1em; text-transform: uppercase; }
.mono-input::placeholder { text-transform: none; letter-spacing: 0.1em; color: var(--ink-3); }

.eye { position: absolute; right: 0; top: 0; bottom: 0; width: 48px; display: grid; place-items: center; color: var(--ink-3); transition: color 0.3s; }
.eye:hover { color: var(--ink); }
.eye::before { content: ""; width: 16px; height: 10px; border: 1.5px solid currentColor; border-radius: 100% / 100%; transition: transform 0.4s var(--spring); }
.eye::after { content: ""; position: absolute; width: 5px; height: 5px; border-radius: 50%; background: currentColor; transition: transform 0.4s var(--spring), opacity 0.3s; }
.eye[aria-pressed="true"]::after { transform: scale(0); opacity: 0; }
.eye[aria-pressed="true"]::before { transform: scaleY(0.25); }

.strength { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength i { height: 2px; background: var(--rule); transition: background-color 0.4s; }
.strength[data-score="1"] i:nth-child(-n+1), .strength[data-score="2"] i:nth-child(-n+2) { background: var(--signal); }
.strength[data-score="3"] i:nth-child(-n+3), .strength[data-score="4"] i:nth-child(-n+4) { background: var(--ink); }

.check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: 0.95em; color: var(--ink-2); }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box { flex: none; width: 16px; height: 16px; margin-top: 3px; border: 1px solid var(--rule-strong); position: relative; transition: border-color 0.3s, background-color 0.3s; }
.check__box::after { content: ""; position: absolute; left: 4px; top: 1px; width: 5px; height: 9px; border-right: 1.5px solid #f5f3ee; border-bottom: 1.5px solid #f5f3ee; transform: rotate(45deg) scale(0); transition: transform 0.35s var(--spring); }
.check input:checked + .check__box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .check__box::after { transform: rotate(45deg) scale(1); }
.check input:focus-visible + .check__box { box-shadow: 0 0 0 2px var(--canvas), 0 0 0 3px var(--ink); }
.check a { text-decoration: underline; text-underline-offset: 3px; }
.check.is-invalid .check__box { border-color: var(--signal); }

.form__error { padding: 12px 14px; border-left: 2px solid var(--signal); background: var(--panel); color: var(--ink); font-size: 0.95em; }
.form__error[hidden] { display: none; }

.alt { display: flex; flex-wrap: wrap; gap: 12px 24px; }
.link { display: inline-flex; align-items: baseline; gap: 10px; font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); }
.link span { background-image: linear-gradient(currentColor, currentColor); background-size: 100% 1px; background-repeat: no-repeat; background-position: left 100%; padding-bottom: 2px; transition: color 0.3s, background-size 0.4s var(--ease); }
.link:hover span { color: var(--ink); }
.link em { font-style: normal; color: var(--ink-3); }
.link[disabled] { pointer-events: none; opacity: 0.5; }
.back { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); align-self: flex-start; transition: color 0.3s; }
.back:hover { color: var(--ink); }
.back svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fine { color: var(--ink-3); }

.otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.otp input { width: 100%; min-width: 0; min-height: 60px; text-align: center; font-family: var(--font-display); font-size: 1.6rem; border: 1px solid var(--rule-strong); background: transparent; color: var(--ink); outline: none; transition: border-color 0.3s, box-shadow 0.3s; }
.otp input:focus { border-color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
.otp.is-invalid input { border-color: var(--signal); }

.view--state { gap: 16px; }
.state__pip { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); position: relative; margin-bottom: 8px; }
.state__pip::after { content: ""; position: absolute; inset: -6px; border-radius: 50%; border: 1px solid var(--ink); animation: pulse 2s ease-out infinite; }
.state__pip--warn { background: var(--signal); }
.state__pip--warn::after { border-color: var(--signal); }
@keyframes pulse { 0% { transform: scale(0.6); opacity: 1; } 100% { transform: scale(1.8); opacity: 0; } }
.view--state h2 { font-size: clamp(1.8rem, 2.6vw, 2.6rem); letter-spacing: -0.035em; }
.view--state .btn { align-self: flex-start; }
.ellipsis::after { content: ""; animation: dots 1.4s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

.auth__foot { display: flex; gap: 24px; flex-wrap: wrap; color: var(--ink-3); padding-top: 32px; margin-top: 32px; border-top: 1px solid var(--rule); }
.auth__foot a { transition: color 0.3s; }
.auth__foot a:hover { color: var(--ink); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth__brand { gap: 28px; padding-bottom: 28px; }
  .auth__brand-copy h1 { font-size: clamp(1.8rem, 7vw, 2.6rem); }
  .auth__brand-copy p { display: none; }
  .auth__facts { display: none; }
  .auth__panel { border-left: 0; border-top: 1px solid var(--rule); padding-top: 24px; }
  .auth__views { max-width: none; }
  .sso { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .view.is-active, .auth__brand-rules i, .state__pip::after { animation: none !important; }
}

/* ---------- the left panel is the black side of the palette ----------
   Declared last so it wins over the neutral .auth__brand block above. */
.auth__brand { background: var(--ink); color: var(--white); }
.auth__brand-rules i { background: rgba(255, 255, 255, 0.16); }
.auth__facts, .auth__facts li { border-color: rgba(255, 255, 255, 0.16); }
.auth__brand .label { color: rgba(255, 255, 255, 0.5); }
.auth__brand p { color: rgba(255, 255, 255, 0.6); }
.auth__facts b { color: var(--white); }
.auth__facts span { color: rgba(255, 255, 255, 0.45); }
.auth__brand-copy h1 { font-family: var(--display); font-weight: 400; letter-spacing: -0.035em; }
.auth__panel .view__head h2 { font-family: var(--display); font-weight: 400; }
