/* Login / register page */

.auth-page { background: #060806; }

.auth-shell {
  min-height: 100vh;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(420px, .96fr);
}

/* Left visual -------------------------------------------------------------- */

.auth-visual {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: 32px 46px 34px;
  background: #060806 url("/assets/ui/background.webp") center 46% / cover no-repeat;
  color: #f3eee2;
}
.auth-visual::before {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(4, 6, 5, .9) 0%, rgba(4, 6, 5, .55) 52%, rgba(4, 6, 5, .32) 100%),
    linear-gradient(0deg, rgba(4, 6, 5, .86) 0%, transparent 56%),
    linear-gradient(180deg, rgba(4, 6, 5, .55), transparent 30%);
}
.auth-visual::after {
  content: "";
  position: absolute;
  z-index: 0;
  inset: 0;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
.auth-visual > * { position: relative; z-index: 1; }

.auth-visual .brand { color: #f3eee2; }
.auth-visual .brand-mark { border-color: rgba(243, 238, 226, .22); }
.auth-visual .brand-type em { font-size: 23px; }
.auth-visual .brand-cn { border-color: rgba(243, 238, 226, .24); }

.auth-quote {
  max-width: 600px;
  margin: 0 0 4vh;
}
.auth-quote .eyebrow { color: var(--accent); margin-bottom: 18px; }
.auth-quote blockquote {
  margin: 0;
  color: #f5f1e6;
  font: 400 clamp(34px, 4.3vw, 58px)/1.22 var(--serif);
  letter-spacing: -.02em;
}
.auth-quote blockquote em { color: var(--accent); font-style: italic; }
.auth-quote p:last-child {
  max-width: 430px;
  margin: 22px 0 0;
  color: rgba(236, 232, 221, .62);
  font-size: 13.5px;
  line-height: 1.9;
}

.auth-features {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin: 0;
  padding: 0;
  list-style: none;
  color: rgba(236, 232, 221, .52);
  font: 500 9px var(--mono);
  letter-spacing: .06em;
}
.auth-features li { display: inline-flex; align-items: center; gap: 7px; }
.auth-features li::before {
  content: "";
  width: 3px;
  height: 3px;
  background: var(--accent);
  opacity: .8;
}

.auth-visual-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-top: 18px;
  border-top: 1px solid rgba(236, 232, 221, .14);
  color: rgba(236, 232, 221, .38);
  font: 500 8px var(--mono);
  letter-spacing: .16em;
}
.auth-barcode {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  width: 108px;
  height: 13px;
  color: rgba(236, 232, 221, .38);
}
.auth-barcode span { flex: 1; height: 100%; background: currentColor; }
.auth-barcode span:nth-child(2n) { height: 58%; }
.auth-barcode span:nth-child(3n) { height: 82%; }
.auth-barcode span:nth-child(5n) { height: 40%; }

/* Right panel -------------------------------------------------------------- */

.auth-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 27px 52px 24px;
  background: var(--bg);
  color: var(--text);
  transition: background-color .35s ease, color .35s ease;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.auth-back {
  color: var(--muted);
  font: 500 9.5px var(--mono);
  letter-spacing: .04em;
  transition: color .2s ease;
}
.auth-back:hover { color: var(--accent); }
.auth-panel .icon-btn {
  width: 36px;
  height: 36px;
  border-color: var(--line);
  color: var(--text);
}
.auth-panel .icon-btn:hover { border-color: var(--accent); color: var(--accent); }

.auth-box {
  width: min(420px, 100%);
  margin: auto;
  padding: 42px 0 34px;
}

.auth-tabs {
  display: flex;
  align-items: center;
  gap: 25px;
  margin-bottom: 30px;
  border-bottom: 1px solid var(--line);
}
.auth-tab {
  position: relative;
  padding: 0 0 11px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font: 500 11px var(--mono);
  letter-spacing: .06em;
  cursor: pointer;
  transition: color .2s ease;
}
.auth-tab::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform .22s ease;
}
.auth-tab:hover { color: var(--text); }
.auth-tab[aria-selected="true"] { color: var(--text); }
.auth-tab[aria-selected="true"]::after { transform: scaleX(1); transform-origin: left; }

.auth-box h1 {
  margin: 0;
  color: var(--text-strong);
  font-size: clamp(32px, 3vw, 42px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.04em;
}
.auth-sub {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.75;
}

.auth-form { margin-top: 27px; display: grid; gap: 16px; }
.remember-device { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 12px; line-height: 1.5; cursor: pointer; }
.remember-device input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.field { display: grid; gap: 7px; }
.field label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font: 500 9px var(--mono);
  letter-spacing: .05em;
}
.field label a {
  color: var(--faint);
  font-weight: 400;
  transition: color .2s ease;
}
.field label a:hover { color: var(--accent); }
.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
  outline: 0;
  transition: border-color .2s ease, background-color .2s ease;
}
.field input::placeholder { color: var(--faint); }
.field input:focus { border-color: var(--accent); background: var(--bg-elev); }
.field input[aria-invalid="true"] { border-color: var(--danger); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.password-wrap { position: relative; }
.password-wrap input { padding-right: 54px; }
.password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  height: 34px;
  padding: 0 9px;
  border: 0;
  background: transparent;
  color: var(--faint);
  font: 500 9px var(--mono);
  cursor: pointer;
  transform: translateY(-50%);
}
.password-toggle:hover { color: var(--accent); }

.field-error {
  min-height: 0;
  margin: 0;
  color: var(--danger);
  font: 500 9.5px/1.5 var(--sans);
}
.field-error:empty { display: none; }

.invite-wrap[hidden] { display: none; }

.auth-submit {
  width: 100%;
  height: 46px;
  margin-top: 5px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  font: 500 10.5px var(--mono);
  letter-spacing: .12em;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, opacity .2s ease;
}
.auth-submit:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.auth-submit:disabled { opacity: .65; cursor: wait; }

.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 13px;
}
.auth-links button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--faint);
  font: 500 9.5px var(--mono);
  cursor: pointer;
}
.auth-links button:hover { color: var(--accent); }
.auth-links span { color: var(--faint); font: 500 9.5px var(--mono); }
.auth-links a { color: var(--accent); font: 500 9.5px var(--mono); }

.auth-note {
  margin: 25px 0 0;
  color: var(--faint);
  font: 500 9px/1.8 var(--mono);
}
.auth-note strong { color: var(--muted); font-weight: 500; }

.auth-foot {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font: 500 8px var(--mono);
  letter-spacing: .08em;
}

.auth-panel[data-auth-panel] [hidden] { display: none !important; }

/* Success state ------------------------------------------------------------ */

.auth-success {
  padding: 26px 0 12px;
  text-align: center;
}
.success-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin: 0 auto 20px;
  border: 1px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
  font: 500 22px var(--mono);
}
.auth-success h2 {
  margin: 0;
  color: var(--text-strong);
  font-size: 27px;
  font-weight: 600;
  letter-spacing: -.03em;
}
.auth-success p {
  max-width: 320px;
  margin: 11px auto 0;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.8;
}
.auth-success-actions {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 24px;
}
.auth-success-actions a,
.auth-success-actions button {
  padding: 0 0 5px;
  border: 0;
  border-bottom: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  font: 500 10px var(--mono);
  cursor: pointer;
}
.auth-success-actions a:hover,
.auth-success-actions button:hover { color: var(--accent); border-color: var(--accent); }

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1020px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual {
    min-height: 300px;
    padding: 24px 28px 26px;
  }
  .auth-quote { margin: 42px 0 0; }
  .auth-quote blockquote { font-size: clamp(28px, 5.2vw, 42px); }
  .auth-quote p:last-child { max-width: 520px; margin-top: 14px; font-size: 12.5px; }
  .auth-features { display: none; }
  .auth-visual-foot { margin-top: 38px; }
  .auth-panel { min-height: 0; padding: 22px 32px 24px; }
  .auth-box { margin: 28px auto 0; padding: 18px 0 30px; }
}

@media (max-width: 700px) {
  .auth-visual { min-height: 238px; padding: 20px var(--pad) 22px; }
  .auth-visual .brand-type em { font-size: 20px; }
  .auth-visual .brand-cn { font-size: 9px; }
  .auth-quote { margin-top: 30px; }
  .auth-quote .eyebrow { margin-bottom: 11px; }
  .auth-quote blockquote { font-size: 29px; line-height: 1.28; }
  .auth-quote p:last-child { display: none; }
  .auth-visual-foot { margin-top: 26px; font-size: 7px; }
  .auth-barcode { width: 72px; height: 10px; }
  .auth-panel { padding: 16px var(--pad) 20px; }
  .auth-top { padding-bottom: 2px; }
  .auth-box { margin-top: 18px; padding: 8px 0 24px; }
  .auth-tabs { margin-bottom: 22px; gap: 20px; }
  .auth-box h1 { font-size: 32px; }
  .auth-sub { font-size: 12px; }
  .auth-form { margin-top: 21px; gap: 14px; }
  .field-row { grid-template-columns: 1fr; gap: 14px; }
  .auth-foot { flex-direction: column; gap: 7px; }
}
