:root {
  --bg: #12151c;
  --bg-soft: #1a1f2a;
  --panel: rgba(255, 252, 248, 0.04);
  --panel-strong: rgba(255, 252, 248, 0.07);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f4f6fb;
  --muted: #9aa3b5;
  --primary: #8b7cf6;
  --primary-soft: rgba(139, 124, 246, 0.16);
  --accent: #e8b4a8;
  --user-bg: linear-gradient(135deg, #4f6ef7 0%, #7c5cff 100%);
  --assistant-bg: rgba(255, 250, 245, 0.06);
  --danger: #f87171;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 15% 0%, rgba(139, 124, 246, 0.12), transparent 32%),
    radial-gradient(circle at 85% 10%, rgba(232, 180, 168, 0.08), transparent 28%),
    linear-gradient(180deg, #151923 0%, var(--bg) 100%);
}

.app {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--panel);
  backdrop-filter: blur(16px);
}

.header-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.current-user {
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app.is-immersive .header-clear {
  display: none;
}

.app.is-expanded .header-clear {
  display: inline-flex;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

.header h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.main {
  flex: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 0;
  transition: grid-template-columns 0.35s ease, gap 0.35s ease;
}

.app.is-expanded .main {
  grid-template-columns: minmax(300px, 380px) 1fr;
  gap: 22px;
}

.avatar-panel,
.chat-panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 24px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.avatar-panel {
  padding: 0;
  overflow: hidden;
  min-height: 0;
}

.app.is-immersive .avatar-panel {
  border-color: rgba(255, 255, 255, 0.06);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.chat-panel {
  display: none;
  flex-direction: column;
  min-height: 620px;
  overflow: hidden;
}

.app.is-expanded .chat-panel {
  display: flex;
  animation: panelIn 0.32s ease;
}

@keyframes panelIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.immersive-dock {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.app.is-expanded .immersive-dock {
  display: none;
}

.dock-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-size: 0.88rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 124, 246, 0.35);
  transform: translateY(-1px);
}

.dock-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #d8cffa;
  font-size: 0.72rem;
  line-height: 20px;
  text-align: center;
  border: 1px solid rgba(139, 124, 246, 0.22);
}

.dock-badge:empty,
.dock-badge[data-count="0"] {
  display: none;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-close-panel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.btn-close-panel:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.app.is-immersive .avatar-panel-inner {
  min-height: calc(100vh - 140px);
  padding: 36px 24px 32px;
}

.app.is-immersive .avatar-stage {
  width: min(340px, 78vw);
  height: min(400px, 72vh);
}

.app.is-immersive .avatar {
  width: min(260px, 68vw);
}

.app.is-immersive .avatar-frame {
  width: min(260px, 68vw);
  height: calc(min(260px, 68vw) * 1.33);
}

.app.is-immersive .btn-mic {
  width: 80px;
  height: 80px;
}

.app.is-immersive .controls {
  margin-top: 32px;
}

.avatar-panel-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100%;
  padding: 28px 20px 24px;
  background:
    radial-gradient(circle at 50% 20%, rgba(232, 180, 168, 0.1), transparent 45%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.avatar-glow {
  position: absolute;
  top: 18%;
  left: 50%;
  width: 220px;
  height: 220px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(139, 124, 246, 0.18), transparent 70%);
  pointer-events: none;
}

.avatar-stage {
  position: relative;
  width: 280px;
  height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pulse-ring {
  position: absolute;
  inset: 20px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  transform: scale(0.85);
  pointer-events: none;
}

.avatar-stage[data-state="listening"] .pulse-ring {
  animation: pulse 1.6s ease-out infinite;
}

.avatar-stage[data-state="listening"] .ring-2 {
  animation-delay: 0.5s;
}

@keyframes pulse {
  0% {
    opacity: 0.7;
    transform: scale(0.85);
  }
  100% {
    opacity: 0;
    transform: scale(1.15);
  }
}

.avatar {
  position: relative;
  z-index: 1;
  width: 220px;
  transition: transform 0.3s ease;
}

.avatar-frame {
  position: relative;
  width: 220px;
  height: 293px;
  border-radius: 22px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.14);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.38),
    inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  background: #f5f0ea;
}

.avatar-portrait {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: center 42%;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

.mouth-overlay {
  position: absolute;
  left: 47.5%;
  top: 58.5%;
  width: 34px;
  height: 16px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.mouth-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.mouth-group {
  transform: none;
}

/* 待机：轻微呼吸 */
.avatar-stage[data-state="idle"] .avatar-portrait {
  animation: breathe 3.2s ease-in-out infinite;
}

.avatar-stage[data-state="idle"] .mouth-open {
  transform: scaleY(0);
  opacity: 0;
}

.avatar-stage[data-state="idle"] .mouth-overlay {
  opacity: 0;
  visibility: hidden;
}

/* 工作：轻微点头 */
.avatar-stage[data-state="working"] .avatar-portrait {
  animation: workNod 0.7s ease-in-out infinite alternate;
}

/* 说话：显示嘴型层 + 随音频开合 */
.avatar-stage[data-state="speaking"] .mouth-overlay {
  opacity: 1;
  visibility: visible;
}

.avatar-stage[data-state="speaking"] .mouth-open {
  opacity: 1;
  transform: scaleY(var(--mouth-scale, 0.4)) scaleX(calc(0.9 + var(--mouth-scale, 0.4) * 0.15));
  transition: transform 0.06s ease-out, opacity 0.08s ease;
  transform-origin: center top;
}

.avatar-stage[data-state="speaking"] .mouth-lower {
  transform: translateY(calc(var(--mouth-scale, 0.4) * 1px));
  transition: transform 0.06s ease-out;
}

.avatar-stage[data-state="speaking"] .mouth-upper {
  transform: translateY(calc(var(--mouth-scale, 0.4) * -0.4px));
  transition: transform 0.06s ease-out;
}

.avatar-stage[data-state="speaking"] .avatar-portrait {
  animation: speakNod 0.55s ease-in-out infinite alternate;
}

.mouth-open {
  transform: scaleY(0);
  opacity: 0;
  transform-origin: center top;
}

@keyframes breathe {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

@keyframes workNod {
  from { transform: rotate(0deg); }
  to { transform: rotate(1.2deg); }
}

.avatar-shine {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.18) 0%,
    transparent 42%,
    transparent 100%
  );
  pointer-events: none;
}

.thinking-bubble,
.work-sparkles {
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.thinking-bubble {
  position: absolute;
  top: 4px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(8px);
}

.think-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
}

.work-sparkles {
  position: absolute;
  right: -6px;
  top: 38%;
  z-index: 2;
}

.spark {
  position: absolute;
  border-radius: 50%;
}

.spark.s1 {
  width: 8px;
  height: 8px;
  background: #fbbf24;
  top: 0;
  right: 0;
}

.spark.s2 {
  width: 6px;
  height: 6px;
  background: #60a5fa;
  top: 18px;
  right: 12px;
}

.spark.s3 {
  width: 5px;
  height: 5px;
  background: #a78bfa;
  top: 32px;
  right: 2px;
}

.avatar-stage[data-state="thinking"] .avatar {
  animation: thinkSway 1.4s ease-in-out infinite;
}

.avatar-stage[data-state="thinking"] .thinking-bubble {
  opacity: 1;
}

.avatar-stage[data-state="thinking"] .think-dot.dot-1 {
  animation: dotBounce 1.2s ease-in-out infinite;
}

.avatar-stage[data-state="thinking"] .think-dot.dot-2 {
  animation: dotBounce 1.2s ease-in-out 0.15s infinite;
}

.avatar-stage[data-state="thinking"] .think-dot.dot-3 {
  animation: dotBounce 1.2s ease-in-out 0.3s infinite;
}

.avatar-stage[data-state="working"] .avatar {
  animation: workBob 0.55s ease-in-out infinite alternate;
}

.avatar-stage[data-state="working"] .work-sparkles {
  opacity: 1;
}

.avatar-stage[data-state="working"] .spark.s1 {
  animation: sparkle 0.8s ease-in-out infinite;
}

.avatar-stage[data-state="working"] .spark.s2 {
  animation: sparkle 0.8s ease-in-out 0.2s infinite;
}

.avatar-stage[data-state="working"] .spark.s3 {
  animation: sparkle 0.8s ease-in-out 0.4s infinite;
}

.avatar-stage[data-state="working"] .avatar-frame {
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.38),
    0 0 0 2px rgba(91, 124, 250, 0.35),
    0 0 24px rgba(91, 124, 250, 0.25);
}

.avatar-stage[data-state="speaking"] .avatar {
  animation: none;
}

.avatar-stage[data-state="speaking"] .avatar-frame {
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.38),
    0 0 0 2px rgba(52, 211, 153, 0.35),
    0 0 20px rgba(52, 211, 153, 0.2);
}

.avatar-stage[data-state="listening"] .avatar {
  transform: scale(1.03);
}

.avatar-stage[data-state="listening"] .avatar-frame {
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.38),
    0 0 0 2px rgba(91, 124, 250, 0.45),
    0 0 28px rgba(91, 124, 250, 0.22);
}

@keyframes thinkSway {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-4px) rotate(-1.5deg); }
}

@keyframes dotBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-5px); opacity: 1; }
}

@keyframes workBob {
  from { transform: translateY(0); }
  to { transform: translateY(-3px); }
}

@keyframes sparkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes speakNod {
  from { transform: translateY(0); }
  to { transform: translateY(2px); }
}

.controls {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.btn-mic {
  width: 68px;
  height: 68px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b7cf6, #6d5ce8);
  color: white;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(109, 92, 232, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-mic:hover {
  transform: translateY(-2px);
}

.btn-mic:active,
.btn-mic.recording {
  transform: scale(0.96);
  box-shadow: 0 0 0 8px rgba(91, 124, 250, 0.25);
}

.btn-mic:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.hint {
  color: var(--muted);
  font-size: 0.82rem;
}

.chat-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.chat-header h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
}

.chat-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
}

.msg-count {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #d8cffa;
  font-size: 0.78rem;
  border: 1px solid rgba(139, 124, 246, 0.22);
}

.chat-list {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}

.chat-list::-webkit-scrollbar {
  width: 6px;
}

.chat-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
}

.welcome-card {
  padding: 22px 20px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(139, 124, 246, 0.1), rgba(232, 180, 168, 0.06));
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.welcome-icon {
  width: 42px;
  height: 42px;
  margin: 0 auto 12px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--accent);
  font-size: 1.1rem;
}

.welcome-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.welcome-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.9rem;
}

.msg {
  display: flex;
  gap: 12px;
  max-width: 100%;
  animation: msgIn 0.28s ease;
}

@keyframes msgIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.msg.user {
  align-self: flex-end;
  flex-direction: row-reverse;
  max-width: 88%;
}

.msg.assistant {
  align-self: flex-start;
  max-width: 92%;
}

.msg-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.msg-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.msg-avatar-user {
  display: grid;
  place-items: center;
  background: var(--user-bg);
  color: white;
  font-size: 0.78rem;
  font-weight: 600;
}

.msg-body {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.msg.user .msg-body {
  background: var(--user-bg);
  border-bottom-right-radius: 6px;
  box-shadow: 0 10px 24px rgba(79, 110, 247, 0.22);
}

.msg.assistant .msg-body {
  background: var(--assistant-bg);
  border-bottom-left-radius: 6px;
  border-left: 3px solid rgba(232, 180, 168, 0.55);
}

.msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.msg-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.msg.user .msg-label {
  color: rgba(255, 255, 255, 0.95);
}

.msg-time {
  font-size: 0.72rem;
  color: var(--muted);
}

.msg.user .msg-time {
  color: rgba(255, 255, 255, 0.72);
}

.msg-content {
  font-size: 0.94rem;
  line-height: 1.65;
  word-break: break-word;
}

.msg-paragraph {
  margin: 0;
  white-space: pre-wrap;
}

.msg-bullets {
  margin: 0;
  padding-left: 1.15rem;
  list-style: none;
}

.msg-bullets li {
  position: relative;
  margin-bottom: 0.55rem;
  padding-left: 0.15rem;
}

.msg-bullets li:last-child {
  margin-bottom: 0;
}

.msg-bullets li::before {
  content: "";
  position: absolute;
  left: -1rem;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e8b4a8, #8b7cf6);
  box-shadow: 0 0 0 3px rgba(139, 124, 246, 0.12);
}

.msg-meta {
  display: flex;
  align-items: center;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.btn-replay {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(139, 124, 246, 0.28);
  background: rgba(139, 124, 246, 0.12);
  color: #d8cffa;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.btn-replay svg {
  width: 15px;
  height: 15px;
  display: block;
}

.btn-replay:hover {
  background: rgba(139, 124, 246, 0.22);
  transform: translateY(-1px);
}

.btn-replay.playing {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.12);
}

.msg.error {
  align-self: center;
  max-width: 92%;
}

.msg.error .msg-body {
  background: rgba(248, 113, 113, 0.1);
  color: #fecaca;
  border: 1px solid rgba(248, 113, 113, 0.22);
}

.text-form {
  padding: 16px 18px 18px;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.12);
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 6px 6px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-wrap:focus-within {
  border-color: rgba(139, 124, 246, 0.45);
  box-shadow: 0 0 0 4px rgba(139, 124, 246, 0.1);
}

.text-form input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 10px 0;
  font-size: 0.94rem;
  outline: none;
}

.btn-send,
.btn-ghost {
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.btn-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b7cf6, #6d5ce8);
  color: white;
  flex-shrink: 0;
}

.btn-send:disabled,
.btn-ghost:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
}

.btn-ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 900px) {
  .app {
    padding: 16px;
  }

  .app.is-expanded .main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .app.is-expanded .chat-panel {
    min-height: 48vh;
  }

  .app.is-immersive .avatar-panel-inner {
    min-height: calc(100vh - 120px);
  }

  .immersive-dock {
    gap: 10px;
  }

  .dock-btn {
    padding: 9px 14px;
    font-size: 0.84rem;
  }
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-shell {
  width: min(420px, 100%);
}

.auth-card {
  padding: 28px 24px 24px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.auth-avatar {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  object-fit: cover;
  object-position: center top;
  border: 2px solid rgba(255, 255, 255, 0.12);
}

.auth-brand h1 {
  margin: 0;
  font-size: 1.1rem;
}

.auth-brand p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 18px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
}

.auth-tab {
  border: none;
  border-radius: 10px;
  padding: 10px 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
}

.auth-tab.active {
  background: rgba(139, 124, 246, 0.2);
  color: var(--text);
}

.auth-tab:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.auth-form {
  display: none;
  flex-direction: column;
  gap: 14px;
}

.auth-form.is-active {
  display: flex;
}

[hidden] {
  display: none !important;
}

.auth-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-form label span {
  font-size: 0.82rem;
  color: var(--muted);
}

.auth-form input {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  padding: 12px 14px;
  font-size: 0.94rem;
  outline: none;
}

.auth-form input:focus {
  border-color: rgba(139, 124, 246, 0.45);
  box-shadow: 0 0 0 4px rgba(139, 124, 246, 0.1);
}

.auth-error {
  margin: 0;
  color: #fecaca;
  font-size: 0.84rem;
  background: rgba(248, 113, 113, 0.12);
  border: 1px solid rgba(248, 113, 113, 0.22);
  border-radius: 10px;
  padding: 10px 12px;
}

.auth-error.auth-success {
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.22);
}

.auth-submit {
  margin-top: 4px;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #8b7cf6, #6d5ce8);
  color: white;
  font-size: 0.95rem;
  cursor: pointer;
}

.auth-submit:hover {
  filter: brightness(1.05);
}
