/* Login / register page. Split brand panel + glass auth card. */

body.auth-page {
  background: var(--bg);
}

/* Language + theme switches float above the form; the login page has no top bar. */
.auth-lang {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: var(--overlay-chip);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* One glass pill around both controls instead of two nested pills. */
.auth-lang .ui-lang {
  padding: 0;
  border: 0;
  background: transparent;
}

.auth-lang .ui-theme-btn {
  border-color: transparent;
  background: transparent;
}

.auth-lang .ui-theme-btn:hover {
  background: rgb(var(--tint-rgb) / 0.1);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  min-height: 100vh;
}

/* ---------- brand panel ---------- */

.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding: 44px 56px 34px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--brand-bg);
}

.auth-brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgb(var(--grid-rgb) / 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgb(var(--grid-rgb) / 0.07) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 24% 14%, #000 16%, transparent 72%);
  mask-image: radial-gradient(ellipse at 24% 14%, #000 16%, transparent 72%);
  pointer-events: none;
}

.auth-brand::after {
  content: "";
  position: absolute;
  top: -180px;
  right: -160px;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  border: 1px solid rgb(var(--accent-rgb) / 0.14);
  box-shadow:
    0 0 0 70px rgb(var(--accent-rgb) / 0.035),
    0 0 0 140px rgb(var(--accent2-rgb) / 0.025);
  pointer-events: none;
}

.auth-brand > * {
  position: relative;
  z-index: 1;
}

.auth-brand .ui-brand {
  align-self: flex-start;
}

.auth-brand .ui-brand-name small {
  color: var(--muted);
}

.auth-pitch {
  max-width: 500px;
  margin-top: 2px;
  animation: ui-rise 0.5s var(--ease) both;
}

.auth-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 5px 13px 5px 10px;
  border: 1px solid var(--accent-line);
  border-radius: 99px;
  background: rgb(var(--accent-rgb) / 0.08);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.auth-eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-3);
  box-shadow: 0 0 10px var(--accent-3);
}

.auth-pitch h1 {
  margin: 20px 0 16px;
  font-size: clamp(30px, 3.4vw, 45px);
  line-height: 1.14;
  letter-spacing: -0.035em;
  font-weight: 720;
}

.auth-pitch h1 em {
  font-style: normal;
  background: var(--headline-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.auth-pitch > p {
  max-width: 450px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.8;
}

.auth-points {
  display: grid;
  gap: 9px;
  max-width: 470px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.auth-points li {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--card-bg-soft);
  box-shadow: inset 0 1px 0 rgb(var(--tint-rgb) / 0.05);
  backdrop-filter: blur(8px);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease), background 0.18s var(--ease);
}

.auth-points li:hover {
  border-color: rgb(var(--accent-rgb) / 0.28);
  background: linear-gradient(180deg, rgb(var(--accent-rgb) / 0.1), rgb(var(--tint-rgb) / 0.015));
  transform: translateX(3px);
}

.auth-points .n {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-top: 0;
  border: 1px solid var(--accent-line);
  border-radius: 9px;
  background: var(--accent-soft);
  color: var(--accent-text);
  font: 11px/1 var(--mono);
}

.auth-points b {
  display: block;
  font-size: 13px;
  font-weight: 620;
}

.auth-points small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.6;
}

.auth-art {
  position: relative;
  margin-top: auto;
  padding: 18px 0 6px;
  animation: ui-rise 0.6s 0.08s var(--ease) both;
}

.auth-art-card {
  position: relative;
  max-width: 372px;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.2);
  border-radius: 18px;
  background: #070c16;
  box-shadow:
    0 40px 80px -30px rgba(0, 0, 0, 0.95),
    0 0 0 1px rgba(255, 255, 255, 0.05),
    0 0 70px -24px rgba(34, 211, 238, 0.45);
  transform: rotate(-1.6deg);
}

.auth-art-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(180deg, rgba(148, 197, 255, 0.07), transparent 46%);
  pointer-events: none;
}

.auth-art-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 13px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(9, 14, 24, 0.92);
  color: #7f93b0;
  font: 10.5px var(--mono);
}

.auth-art-head .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #334155;
}

.auth-art-head .name {
  margin-left: auto;
  color: #cbd5e8;
}

.auth-art-foot {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  padding: 9px 13px;
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  color: #8fa3bf;
  font-size: 10.5px;
}

.auth-art-foot span {
  padding: 1px 8px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 99px;
}

/* Floating status chips around the blueprint card. */
.auth-art-floats {
  position: absolute;
  top: 30px;
  right: 0;
  display: grid;
  gap: 8px;
  justify-items: end;
  pointer-events: none;
}

.auth-float {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  background: var(--float-bg);
  color: var(--text-soft);
  font-size: 11px;
  box-shadow: 0 14px 30px -18px var(--shadow-strong);
  backdrop-filter: blur(14px);
}

.auth-float i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 9px var(--ok);
}

.auth-brand-foot {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  color: var(--faint);
  font-size: 11px;
}

/* ---------- form panel ---------- */

.auth-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
  background:
    radial-gradient(680px 420px at 72% 18%, rgb(var(--accent-rgb) / 0.05), transparent 70%),
    radial-gradient(520px 380px at 30% 92%, rgb(var(--accent2-rgb) / 0.045), transparent 72%);
}

.auth-card {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(432px, 100%);
  min-width: 0;
  max-width: 100%;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--auth-card-bg);
  box-shadow:
    0 40px 90px -40px var(--shadow-strong),
    inset 0 1px 0 rgb(var(--tint-rgb) / 0.08);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
  animation: ui-rise 0.5s 0.04s var(--ease) both;
}

.auth-card::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 28px;
  left: 28px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgb(var(--accent-rgb) / 0.8), transparent);
}

.auth-mobile-brand {
  display: none;
  margin-bottom: 2px;
}

.auth-session {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--accent-line);
  border-radius: 15px;
  background: rgb(var(--accent-rgb) / 0.08);
}

.auth-session .ui-avatar {
  width: 38px;
  height: 38px;
}

.auth-session-body {
  min-width: 0;
  flex: 1;
}

.auth-session-body b {
  display: block;
  font-size: 13px;
}

.auth-session-body span {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-session .ui-btn {
  flex-shrink: 0;
}

.auth-head {
  margin-top: 2px;
}

.auth-head h1 {
  margin: 4px 0 7px;
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.auth-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.auth-fields {
  display: grid;
  gap: 15px;
}

.auth-fields .ui-field + .ui-field {
  margin-top: 0;
}

.auth-fields .ui-input[aria-invalid="true"] {
  border-color: rgb(var(--danger-rgb) / 0.72);
  box-shadow: 0 0 0 4px rgb(var(--danger-rgb) / 0.12);
}

.auth-submit {
  margin-top: 4px;
  height: 46px;
  border-radius: 13px;
  font-size: 14.5px;
}

.auth-alt {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12.5px;
  text-align: center;
}

.auth-link {
  padding: 0 2px;
  border: 0;
  background: none;
  color: var(--link-soft);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.auth-link:hover {
  text-decoration: underline;
}

.auth-alt-sep {
  margin: 0 7px;
  color: var(--faint);
}

/* Registration: password fields stay above the mandatory binding proof. */
.auth-bind {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
}

.auth-bind-title {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.auth-bind-or {
  margin: 14px 0 10px;
  color: var(--faint);
  font-size: 11.5px;
  text-align: center;
}

.auth-register-note {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid rgb(var(--accent-rgb) / 0.3);
  border-radius: 11px;
  background: rgb(var(--accent-rgb) / 0.08);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.6;
}

.auth-register-hint {
  margin-top: 14px;
  text-align: center;
}

.auth-bootstrap {
  padding: 10px 12px;
  border: 1px solid rgb(var(--warn-rgb) / 0.3);
  border-radius: 11px;
  background: rgb(var(--warn-rgb) / 0.08);
  color: var(--warn-text);
  line-height: 1.6;
}

.auth-legal {
  margin: 4px 0 0;
  color: var(--faint);
  font-size: 11px;
  line-height: 1.7;
  text-align: center;
}

/* ---------- v1.12 phone / third-party sign-in ---------- */

.auth-eyebrow-inline {
  margin-bottom: 12px;
}

.auth-phone {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--input-bg);
}

.auth-phone .ui-input {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.auth-cc {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  padding: 0 14px;
  border-right: 1px solid var(--line);
  background: rgb(var(--tint-rgb) / 0.035);
  color: var(--text-soft);
  font: 13px var(--mono);
}

.auth-code {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.auth-code .ui-input {
  flex: 1;
  min-width: 0;
  letter-spacing: 0.22em;
  font-family: var(--mono);
}

.auth-code-send {
  flex-shrink: 0;
  min-width: 112px;
  white-space: nowrap;
}

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--faint);
  font-size: 11.5px;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.auth-oauth {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgb(var(--tint-rgb) / 0.04);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition:
    border-color 0.18s var(--ease),
    background 0.18s var(--ease),
    transform 0.18s var(--ease);
}

.auth-oauth-btn:hover {
  border-color: var(--accent-line);
  background: rgb(var(--accent-rgb) / 0.11);
  transform: translateY(-1px);
}

/* Three providers: the odd one out spans the full row. */
.auth-oauth-btn:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.auth-oauth-ico {
  display: inline-flex;
  align-items: center;
}

.auth-devcode {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px dashed rgb(var(--warn-rgb) / 0.4);
  border-radius: 10px;
  background: rgb(var(--warn-rgb) / 0.07);
  color: var(--warn-text);
  font: 12px/1.5 var(--mono);
  text-align: center;
}

@media (max-width: 420px) {
  .auth-oauth {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1080px) {
  .auth-brand {
    padding: 36px 40px 30px;
  }

  .auth-art-floats {
    display: none;
  }
}

@media (max-width: 960px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-main {
    min-height: 100vh;
    align-items: flex-start;
    padding: 64px 20px 40px;
  }

  .auth-card {
    padding: 30px;
  }

  .auth-mobile-brand {
    display: flex;
  }
}

/* Tablets have room to centre the card; keep the language switch clear. */
@media (min-width: 641px) and (max-width: 960px) and (min-height: 900px) {
  .auth-main {
    align-items: center;
  }
}

@media (max-width: 640px) {
  /* Scroll away with the card instead of floating over the fields. */
  .auth-lang {
    position: absolute;
    top: 14px;
    right: 14px;
  }

  .auth-main {
    align-items: flex-start;
    padding: 64px 14px 44px;
  }

  .auth-card {
    padding: 24px;
    border-radius: 22px;
  }

  .auth-head h1 {
    font-size: 24px;
  }

  .auth-code-send {
    min-width: 104px;
  }
}

@media (max-width: 380px) {
  .auth-main {
    padding: 60px 10px 36px;
  }

  .auth-card {
    padding: 20px;
  }

  .auth-code {
    flex-direction: column;
  }

  .auth-code-send {
    width: 100%;
  }
}

@media (max-height: 980px) and (min-width: 961px) {
  .auth-brand {
    gap: 20px;
    padding: 32px 48px 24px;
  }

  .auth-pitch h1 {
    margin: 16px 0 12px;
    font-size: clamp(28px, 3.1vw, 40px);
  }

  .auth-pitch > p {
    font-size: 13.5px;
    line-height: 1.7;
  }

  .auth-points {
    margin-top: 20px;
    gap: 8px;
  }

  .auth-points li {
    padding: 10px 13px;
  }

  .auth-art {
    padding: 12px 0 2px;
  }

  .auth-art-card {
    max-width: 340px;
  }

  .auth-brand-foot {
    font-size: 10.5px;
  }
}

@media (max-height: 820px) and (min-width: 961px) {
  .auth-points {
    display: none;
  }

  .auth-brand {
    padding-top: 30px;
    padding-bottom: 26px;
  }

  .auth-art {
    margin-top: auto;
  }
}
