:root {
  --bg: #07111d;
  --bg-deep: #040912;
  --panel: rgba(10, 18, 32, 0.76);
  --panel-strong: rgba(9, 16, 28, 0.92);
  --line: rgba(155, 181, 216, 0.16);
  --text: #eef4ff;
  --muted: #9fb1cc;
  --accent: #7ed6ff;
  --accent-strong: #8ff3dd;
  --shadow: 0 36px 120px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 20%, rgba(126, 214, 255, 0.14), transparent 28%),
    radial-gradient(circle at 82% 16%, rgba(143, 243, 221, 0.12), transparent 24%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-deep) 100%);
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 92%);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

code {
  font-family: "Space Grotesk", "Consolas", monospace;
}

.glow,
.grid-noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.glow {
  filter: blur(60px);
  opacity: 0.55;
}

.glow-a {
  background: radial-gradient(circle at 20% 28%, rgba(126, 214, 255, 0.18), transparent 28%);
  animation: drift-a 18s ease-in-out infinite;
}

.glow-b {
  background: radial-gradient(circle at 76% 22%, rgba(143, 243, 221, 0.16), transparent 26%);
  animation: drift-b 24s ease-in-out infinite;
}

.grid-noise {
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 92%);
}

.shell {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 24px;
}

.auth-layout {
  width: min(1220px, 100%);
  min-height: min(780px, calc(100vh - 48px));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.92fr);
  border-radius: 36px;
  overflow: hidden;
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.05), transparent 42%),
    var(--panel);
  backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
}

.auth-copy,
.auth-panel {
  padding: clamp(28px, 4vw, 54px);
}

.auth-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.auth-copy-minimal {
  align-items: flex-start;
}

.eyebrow,
.section-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--accent-strong);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

h1,
.back-link,
.continue-link,
.signout-button,
.hint-box strong,
.signed-in-card strong {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

h1 {
  margin: 0;
  font-size: clamp(48px, 7vw, 88px);
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.hint-box p,
.signed-in-card p {
  color: var(--muted);
  line-height: 1.85;
}
.hint-box,
.signed-in-card,
.clerk-shell {
  padding: 22px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  border-left: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)),
    var(--panel-strong);
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.panel-head h2 {
  margin: 12px 0 0;
  font-size: 30px;
}

.back-link,
.continue-link,
.signout-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 16px;
  border-radius: 16px;
  font-weight: 700;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.back-link,
.signout-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.continue-link {
  color: #051019;
  background: linear-gradient(135deg, var(--accent-strong), #d9fff5);
  box-shadow: 0 18px 42px rgba(143, 243, 221, 0.18);
}

.back-link:hover,
.continue-link:hover,
.signout-button:hover {
  transform: translateY(-2px);
}

.signed-in-shell:empty,
.clerk-shell:empty {
  display: none;
}

.signed-in-card {
  display: grid;
  gap: 14px;
}

.signed-in-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

#clerk-auth {
  min-height: 460px;
}

.clerk-shell > div {
  width: 100%;
}

.clerk-shell .cl-footer > :last-child {
  display: none !important;
}

@keyframes drift-a {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(24px, -12px, 0); }
}

@keyframes drift-b {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(-22px, 16px, 0); }
}

@media (max-width: 980px) {
  .shell {
    min-height: auto;
    padding: 12px;
  }

  .auth-layout {
    min-height: calc(100vh - 24px);
    grid-template-columns: 1fr;
  }

  .auth-panel {
    border-left: 0;
    border-top: 1px solid var(--line);
  }

  h1 {
    font-size: clamp(42px, 14vw, 72px);
  }

  .panel-head {
    flex-direction: column;
    align-items: start;
  }
}
