/* ────────────────────────────────────────────────
   POLYMESH · auth.css — sign in / create account
   ──────────────────────────────────────────────── */

.auth-body { min-height: 100svh; overflow-x: hidden; }

.auth-split {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 100svh;
}

/* ═══════════ BRAND SIDE ═══════════ */
.auth-brand {
  position: relative;
  display: flex; flex-direction: column;
  padding: 44px 52px;
  overflow: hidden;
  border-right: 1px solid var(--line);
  background: var(--bg1);
}
/* the aurora reads as luminous colour on dark; on light it needs backing right off or it
   turns into a muddy bruise over white */
.ab-aurora {
  position: absolute; inset: -30% -20% auto -20%; height: 130%;
  background:
    radial-gradient(60% 55% at 30% 25%, rgba(94, 106, 210, 0.07), transparent 62%);
  filter: blur(28px);
  animation: aurora-drift 22s ease-in-out infinite alternate;
}
.ab-aurora {
  background:
    radial-gradient(60% 55% at 30% 25%, rgba(94, 106, 210, 0.14), transparent 62%);
}
@keyframes aurora-drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(4%, -3%, 0) scale(1.12); }
  100% { transform: translate3d(-4%, 4%, 0) scale(1.05); }
}
.ab-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(80% 70% at 40% 45%, #000, transparent 78%);
  -webkit-mask-image: radial-gradient(80% 70% at 40% 45%, #000, transparent 78%);
}

.auth-logo {
  position: relative; z-index: 2;
  display: inline-flex; align-items: center; gap: 11px;
  font-family: var(--font-display); font-weight: 510; font-size: 17px; letter-spacing: -0.02em;
  align-self: flex-start;
}

.ab-body { position: relative; z-index: 2; margin: auto 0; }
.ab-body h2 {
  font-family: var(--font-display);
  font-size: clamp(32px, 3.4vw, 40px);
  font-weight: 510; line-height: 1.1; letter-spacing: -0.035em;
  animation: ab-in 1s var(--ease-out) both;
}
.ab-points { display: flex; flex-direction: column; gap: 14px; margin-top: 34px; max-width: 400px; }
.ab-points li {
  display: flex; align-items: flex-start; gap: 12px;
  font-size: 15.5px; color: var(--ink-dim);
  animation: ab-in 0.9s var(--ease-out) both;
}
.ab-points li:nth-child(1) { animation-delay: 0.14s; }
.ab-points li:nth-child(2) { animation-delay: 0.22s; }
.ab-points li:nth-child(3) { animation-delay: 0.3s; }
.ab-points li b { color: var(--ink); font-weight: 500; }
.ab-points li::before {
  content: ''; width: 18px; height: 18px; flex-shrink: 0; margin-top: 3px;
  background: var(--grad);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m3.5 8.5 3 3 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='m3.5 8.5 3 3 6-6'/%3E%3C/svg%3E") center/contain no-repeat;
}
@keyframes ab-in { from { opacity: 0; transform: translateY(20px); filter: blur(5px); } to { opacity: 1; transform: none; filter: none; } }

.ab-foot {
  position: relative; z-index: 2;
  display: flex; align-items: center; gap: 14px;
  animation: ab-in 0.9s var(--ease-out) 0.42s both;
}
.ab-avatars { display: flex; }
.ab-avatars i {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--bg1);
  margin-right: -10px;
  background: linear-gradient(135deg, hsl(var(--h) 62% 42%), hsl(calc(var(--h) + 40) 68% 26%));
}
.ab-foot p { font-size: 13.5px; color: var(--ink-faint); margin-left: 6px; }
.ab-foot b { color: var(--ink-dim); }

/* ═══════════ FORM SIDE ═══════════ */
.auth-main {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 60px 32px 40px;
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(94, 106, 210, 0.05), transparent 60%),
    var(--bg0);
}
.auth-back {
  position: absolute; top: 32px; right: 36px;
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; font-weight: 500; color: var(--ink-faint);
  padding: 5px 11px; border-radius: var(--r-sm);
  transition: 0.25s;
}
.auth-back:hover { color: var(--ink); background: var(--glass-2); }

.auth-card {
  width: 100%; max-width: 412px;
  animation: card-in 0.8s var(--ease-out) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

/* tabs */
.auth-tabs {
  position: relative;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
  padding: 4px;
  background: var(--glass); border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 30px;
}
.atab {
  position: relative; z-index: 2;
  padding: 10px; border-radius: var(--r-sm);
  font-size: 14px; font-weight: 500; color: var(--ink-faint);
  transition: color 0.25s;
}
.atab.on { color: var(--on-brand); }
.atab-glide {
  position: absolute; z-index: 1; top: 4px; left: 4px;
  width: calc(50% - 6px); height: calc(100% - 8px);
  border-radius: var(--r-sm);
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px var(--brand-edge);
  transition: transform 0.4s var(--ease-spring);
}
.atab-glide.right { transform: translateX(calc(100% + 4px)); }

.auth-head { margin-bottom: 26px; }
.auth-head h1 {
  font-family: var(--font-display); font-size: 28px; font-weight: 510; letter-spacing: -0.035em;
  margin-bottom: 7px;
}
.auth-head p { font-size: 14.5px; color: var(--ink-dim); }

/* fields */
.auth-form { display: flex; flex-direction: column; gap: 17px; }
.afield { display: flex; flex-direction: column; gap: 8px; animation: card-in 0.5s var(--ease-out); }
.afield-row { display: flex; align-items: center; justify-content: space-between; }
.afield label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-faint);
}
.afield input {
  width: 100%;
  background: var(--bg1);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  padding: 14px 16px;
  font-size: 15px; color: var(--ink);
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.afield input::placeholder { color: var(--ink-faint); }
.afield input:focus {
  outline: none;
  border-color: rgba(94, 106, 210, 0.6);
  box-shadow: 0 0 0 3px rgba(94, 106, 210, 0.22);
  background: rgba(94, 106, 210, 0.04);
}
.afield input { background: var(--glass); border-color: var(--line); }
.afield.bad input { border-color: var(--err); box-shadow: 0 0 0 3px var(--err-wash); }

.ainput-wrap { position: relative; }
.ainput-wrap input { padding-right: 48px; }
.aeye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-faint); transition: 0.2s;
}
.aeye:hover { color: var(--ink); background: var(--glass-2); }
.aeye.on { color: var(--accent-ink); }

.pw-meter { display: flex; align-items: center; gap: 5px; margin-top: 2px; }
.pw-meter i {
  flex: 1; height: 3px; border-radius: 3px;
  background: var(--glass-2);
  transition: background 0.3s;
}
.pw-meter span {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em;
  color: var(--ink-faint); text-transform: uppercase; min-width: 52px; text-align: right;
}
.pw-meter[data-level="1"] i:nth-child(1) { background: var(--err); }
.pw-meter[data-level="2"] i:nth-child(-n+2) { background: var(--warn); }
.pw-meter[data-level="3"] i { background: var(--ok); }

.alink {
  font-size: 12.5px; font-weight: 500; color: var(--ink-faint);
  transition: color 0.2s;
}
.alink:hover { color: var(--accent-ink); }
.alink.strong {
  font-size: 14px;
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}

.auth-error {
  display: flex; align-items: center; gap: 9px;
  padding: 11px 14px; border-radius: var(--r-sm);
  background: var(--err-wash);
  border: 1px solid color-mix(in srgb, var(--err) 34%, transparent);
  color: var(--err-ink); font-size: 13.5px; font-weight: 500;
  animation: shake 0.45s ease;
}
.auth-error::before { content: '!'; font-family: var(--font-mono); font-weight: 500; color: var(--err); }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(2px); }
}

.auth-submit { width: 100%; justify-content: center; margin-top: 4px; position: relative; overflow: hidden; }
.auth-submit:disabled { opacity: 0.65; cursor: not-allowed; transform: none !important; }
.auth-submit.busy::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.06) 50%, transparent 60%);
  animation: shimmer 1.3s ease infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

.auth-terms { font-size: 12px; color: var(--ink-faint); line-height: 1.6; text-align: center; }
.auth-terms a { color: var(--ink-dim); text-decoration: underline; text-underline-offset: 2px; }
.auth-terms a:hover { color: var(--accent-ink); }

.auth-swap {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 26px; padding-top: 22px;
  border-top: 1px solid var(--line);
  font-size: 14px; color: var(--ink-faint);
}

.auth-demo {
  margin-top: 34px; max-width: 380px; text-align: center;
  font-size: 10.5px; line-height: 1.7; color: var(--ink-faint); opacity: 0.75;
}

/* ═══════════ TOASTS (shared shape with studio) ═══════════ */
.toasts {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  z-index: 200; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; border-radius: var(--r-md);
  background: var(--overlay);
  border: 1px solid var(--overlay-line);
  color: var(--overlay-ink);
  backdrop-filter: blur(16px);
  font-size: 13.5px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.45s var(--ease-spring);
}
.toast.out { animation: toast-out 0.35s ease forwards; }
.toast i { font-style: normal; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(10px) scale(0.96); } }

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 900px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand {
    border-right: none; border-bottom: 1px solid var(--line);
    padding: 28px 26px 34px;
  }
  .ab-body { margin: 30px 0 26px; }
  .ab-body h2 { font-size: 30px; }
  .ab-body h2 br { display: none; }
  .ab-points { gap: 10px; margin-top: 22px; }
  .ab-points li { font-size: 14px; }
  .ab-foot { display: none; }
  .auth-main { padding: 44px 22px 40px; }
  .auth-back { top: auto; bottom: 14px; right: 50%; transform: translateX(50%); }
  .auth-demo { margin-bottom: 30px; }
}
@media (max-width: 460px) {
  .auth-brand { padding: 22px 20px 26px; }
  .ab-body h2 { font-size: 27px; }
  .auth-head h1 { font-size: 25px; }
}
