/* Auth stage — AI-XiaoPi login / register
   Signature: live booth waveform + oversized brand plane
   Avoids cream/serif, purple glow, and broadsheet defaults */

:root {
  --auth-ink: #0c1a22;
  --auth-muted: #5a6d78;
  --auth-line: #c5d4dc;
  --auth-mist: #e8f0f3;
  --auth-panel: #f7fbfc;
  --auth-panel-top: #f4f8fa;
  --auth-panel-bottom: #eef4f6;
  --auth-input-bg: #ffffff;
  --auth-input-placeholder: #9aadb8;
  --auth-input-hover: #a8c0cb;
  --auth-link: #163049;
  --auth-link-hover-bg: #ffffff;
  --auth-signal: #0f766e;
  --auth-signal-deep: #115e59;
  --auth-booth: #163049;
  --auth-wire: #c45c26;
  --auth-ok: #047857;
  --auth-err: #b91c1c;
  --font-display: "Syne", "Segoe UI", sans-serif;
  --font-body: "Noto Sans SC", "Source Sans 3", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.auth-body {
  font-family: var(--font-body);
  color: var(--auth-ink);
  background: var(--auth-mist);
  min-height: 100vh;
}

.auth-stage {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(320px, 0.95fr);
}

/* —— Left: live booth —— */
.auth-booth {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 20% 80%, rgba(15, 118, 110, 0.35), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 10%, rgba(196, 92, 38, 0.22), transparent 50%),
    linear-gradient(155deg, #0f2433 0%, #163049 48%, #0d3d3a 100%);
  color: #e8f4f2;
  padding: 40px 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  isolation: isolate;
}

.auth-booth::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 244, 242, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 244, 242, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.5), transparent 85%);
  pointer-events: none;
  z-index: 0;
}

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

.auth-booth-top {
  display: flex;
  align-items: center;
  gap: 14px;
}

.auth-mark {
  --mark-size: 48px;
  width: var(--mark-size);
  height: calc(var(--mark-size) * 0.78);
  flex-shrink: 0;
  background: url("./logo-white.svg") center / contain no-repeat;
}

.auth-booth-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.auth-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(232, 244, 242, 0.18);
  background: rgba(12, 26, 34, 0.35);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(232, 244, 242, 0.85);
}

.auth-live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: auth-pulse 1.8s ease-out infinite;
}

@keyframes auth-pulse {
  0% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.5); }
  70% { box-shadow: 0 0 0 10px rgba(52, 211, 153, 0); }
  100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0); }
}

.auth-thesis {
  margin: 36px 0 0;
  max-width: 18em;
}

.auth-thesis h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.4rem, 4.5vw, 3.6rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.auth-thesis h1 em {
  font-style: normal;
  color: #5eead4;
}

.auth-thesis p strong {
  color: #5eead4;
  font-weight: 600;
}

/* Signature: equalizer bars */
.auth-wave {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 72px;
  margin-top: 40px;
}

.auth-wave span {
  display: block;
  width: 8px;
  border-radius: 2px;
  background: linear-gradient(180deg, #5eead4, rgba(15, 118, 110, 0.35));
  transform-origin: bottom;
  animation: auth-bar 1.2s ease-in-out infinite;
}

.auth-wave span:nth-child(1) { height: 28%; animation-delay: 0s; }
.auth-wave span:nth-child(2) { height: 62%; animation-delay: 0.1s; }
.auth-wave span:nth-child(3) { height: 44%; animation-delay: 0.2s; }
.auth-wave span:nth-child(4) { height: 88%; animation-delay: 0.05s; }
.auth-wave span:nth-child(5) { height: 36%; animation-delay: 0.25s; }
.auth-wave span:nth-child(6) { height: 70%; animation-delay: 0.15s; }
.auth-wave span:nth-child(7) { height: 52%; animation-delay: 0.3s; }
.auth-wave span:nth-child(8) { height: 40%; animation-delay: 0.18s; }
.auth-wave span:nth-child(9) { height: 78%; animation-delay: 0.08s; }
.auth-wave span:nth-child(10) { height: 32%; animation-delay: 0.22s; }

@keyframes auth-bar {
  0%, 100% { transform: scaleY(0.45); opacity: 0.65; }
  50% { transform: scaleY(1); opacity: 1; }
}

.auth-booth-foot {
  margin-top: 28px;
  font-size: 0.85rem;
  color: rgba(232, 244, 242, 0.5);
  letter-spacing: 0.02em;
}

/* —— Right: form —— */
.auth-panel-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  background:
    radial-gradient(600px 320px at 100% 0%, rgba(15, 118, 110, 0.08), transparent 60%),
    linear-gradient(180deg, var(--auth-panel-top) 0%, var(--auth-panel) 40%, var(--auth-panel-bottom) 100%);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  animation: auth-rise 0.55s ease-out both;
}

@keyframes auth-rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.auth-card-kicker {
  margin: 0 0 8px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--auth-signal);
  font-weight: 600;
}

.auth-card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.auth-card-lead {
  margin: 10px 0 28px;
  color: var(--auth-muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 16px;
}

.auth-field span {
  font-size: 0.86rem;
  color: var(--auth-muted);
  font-weight: 500;
}

.auth-field input {
  font: inherit;
  font-size: 1rem;
  color: var(--auth-ink);
  border: 1.5px solid var(--auth-line);
  border-radius: 6px;
  padding: 12px 14px;
  background: var(--auth-input-bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-field input::placeholder {
  color: var(--auth-input-placeholder);
}

.auth-field input:hover {
  border-color: var(--auth-input-hover);
}

.auth-field input:focus {
  outline: none;
  border-color: var(--auth-signal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.18);
}

.auth-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.auth-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-btn-secondary {
  flex: 0 0 auto;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1.5px solid var(--auth-line);
  border-radius: 6px;
  padding: 0 14px;
  background: var(--auth-panel);
  color: var(--auth-link);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.auth-btn-secondary:hover:not(:disabled) {
  border-color: var(--auth-signal);
  color: var(--auth-signal-deep);
  background: #fff;
}

.auth-btn-secondary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.auth-btn-secondary:focus-visible {
  outline: 2px solid var(--auth-signal);
  outline-offset: 2px;
}

.auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 8px;
}

.auth-actions button {
  font: inherit;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.02em;
  border: none;
  border-radius: 6px;
  padding: 12px 22px;
  background: linear-gradient(145deg, var(--auth-signal), var(--auth-signal-deep));
  color: #fff;
  cursor: pointer;
  transition: transform 0.15s ease, filter 0.15s ease;
}

.auth-actions button:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.auth-actions button:active {
  transform: none;
}

.auth-actions button:focus-visible {
  outline: 2px solid var(--auth-signal);
  outline-offset: 3px;
}

.auth-actions a {
  font: inherit;
  color: var(--auth-link);
  text-decoration: none;
  padding: 10px 12px;
  border-radius: 5px;
  border: 1px solid transparent;
}

.auth-actions a:hover {
  border-color: var(--auth-line);
  background: var(--auth-link-hover-bg);
}

.auth-actions a:focus-visible {
  outline: 2px solid var(--auth-signal);
  outline-offset: 2px;
}

.auth-msg {
  min-height: 1.35em;
  margin: 14px 0 0;
  font-size: 0.92rem;
  color: var(--auth-signal);
}

.auth-msg.err { color: var(--auth-err); }
.auth-msg.ok { color: var(--auth-ok); }

.auth-note {
  margin: 22px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--auth-line);
  font-size: 0.86rem;
  color: var(--auth-muted);
  line-height: 1.5;
}

.auth-note strong {
  color: var(--auth-ink);
  font-weight: 600;
}

@media (max-width: 860px) {
  .auth-stage {
    grid-template-columns: 1fr;
  }
  .auth-booth {
    min-height: auto;
    padding: 28px 24px 32px;
  }
  .auth-thesis h1 {
    font-size: clamp(1.9rem, 8vw, 2.4rem);
  }
  .auth-wave { height: 48px; margin-top: 24px; }
  .auth-panel-wrap { padding: 28px 20px 40px; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .auth-live-dot,
  .auth-wave span,
  .auth-card {
    animation: none;
  }
  .auth-actions button:hover { transform: none; }
}
