:root {
  --bg: #06080f;
  --card-bg: rgba(11, 15, 29, 0.88);
  --border: rgba(139, 92, 246, 0.25);
  --border-light: rgba(230, 235, 244, 0.08);
  --border-focus: #8B5CF6;
  --primary: #8B5CF6;
  --primary-hover: #7c3aed;
  --accent-cyan: #38bdf8;
  --accent-green: #4ade80;
  --text: #E6EBF4;
  --text-muted: #9aa3b5;
  --text-dim: #626b7a;
  --font-heading: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Ambient Radial Glow */
.auth-bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse 60% 40% at 20% 30%, rgba(139, 92, 246, 0.15), transparent 70%),
              radial-gradient(ellipse 50% 50% at 80% 70%, rgba(56, 189, 248, 0.1), transparent 60%);
  z-index: 0;
}

canvas#authStars {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

/* Split-Screen Main Container */
.auth-container {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1100px;
  min-height: 640px;
  margin: 30px 20px;
  background: rgba(8, 11, 20, 0.85);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.9), 0 0 40px rgba(139, 92, 246, 0.12);
  backdrop-filter: blur(28px);
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  overflow: hidden;
}

@media (max-width: 900px) {
  .auth-container {
    grid-template-columns: 1fr;
    max-width: 480px;
    margin: 20px;
  }
  .auth-showcase { display: none !important; }
}

/* Left Column: Product Showcase */
.auth-showcase {
  background: linear-gradient(145deg, rgba(139, 92, 246, 0.08) 0%, rgba(6, 8, 15, 0.95) 100%);
  border-right: 1px solid var(--border-light);
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
}

.auth-showcase::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 1px;
  height: 100%;
  background: linear-gradient(180deg, transparent, var(--primary), transparent);
  opacity: 0.4;
}

.showcase-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  margin-bottom: 32px;
}

.brand-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: rgba(139, 92, 246, 0.15);
  border: 1px solid var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.35);
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: white;
}
.brand-text span { color: var(--accent-cyan); }

.showcase-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(139, 92, 246, 0.12);
  border: 1px solid rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-heading);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.showcase-headline {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.25;
  color: white;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.showcase-desc {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 28px;
}

/* Feature List */
.showcase-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 32px;
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: #d1d5db;
}

.feature-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: var(--accent-green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Showcase Voice Card Widget */
.showcase-player-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-light);
  border-radius: 16px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.player-wave {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 20px;
}

.player-wave-bar {
  width: 3px;
  background: var(--primary);
  border-radius: 3px;
  animation: waveMotion 1.2s ease-in-out infinite alternate;
}
.player-wave-bar:nth-child(1) { height: 6px; animation-delay: 0.1s; }
.player-wave-bar:nth-child(2) { height: 16px; animation-delay: 0.3s; }
.player-wave-bar:nth-child(3) { height: 22px; animation-delay: 0.2s; }
.player-wave-bar:nth-child(4) { height: 12px; animation-delay: 0.5s; }
.player-wave-bar:nth-child(5) { height: 18px; animation-delay: 0.4s; }
.player-wave-bar:nth-child(6) { height: 8px; animation-delay: 0.6s; }

@keyframes waveMotion {
  0% { transform: scaleY(0.4); opacity: 0.5; }
  100% { transform: scaleY(1.2); opacity: 1; }
}

/* Right Column: Auth Card */
.auth-panel {
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.auth-header {
  margin-bottom: 24px;
}

.auth-title {
  font-family: var(--font-heading);
  font-size: 26px;
  font-weight: 700;
  color: white;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}

.auth-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* Social Buttons */
.social-btn-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-social {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 13px 18px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
  font-family: var(--font-body);
  width: 100%;
}

.btn-social:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--primary);
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.25);
}

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0 22px;
  color: var(--text-dim);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.auth-divider span { padding: 0 12px; }

/* Form Controls */
.form-group {
  margin-bottom: 16px;
  text-align: left;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-dim);
  pointer-events: none;
  font-size: 15px;
}

.form-input {
  width: 100%;
  background: #090c17;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px 12px 40px;
  color: white;
  font-size: 14px;
  outline: none;
  font-family: var(--font-body);
  transition: all 0.2s;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.35);
  background: #0b0f1e;
}

.toggle-pwd-btn {
  position: absolute;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  padding: 4px;
}
.toggle-pwd-btn:hover { color: var(--text); }

/* Submit Button */
.btn-auth-submit {
  width: 100%;
  background: linear-gradient(135deg, #8B5CF6 0%, #6d28d9 100%);
  color: white;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  padding: 13px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(139, 92, 246, 0.4);
  transition: all 0.2s cubic-bezier(0.2, 0.7, 0.2, 1);
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.02em;
}

.btn-auth-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 25px rgba(139, 92, 246, 0.6);
  background: linear-gradient(135deg, #9061f9 0%, #7c3aed 100%);
}

.btn-auth-submit:active { transform: translateY(0); }

/* Auth State Messages */
.auth-status-msg {
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}
.auth-status-msg.error {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
}
.auth-status-msg.success {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(74, 222, 128, 0.12);
  border: 1px solid rgba(74, 222, 128, 0.3);
  color: #86efac;
}

/* OTP Code Verification Screen */
.otp-screen {
  display: none;
  animation: fadeIn 0.25s ease-out;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.otp-inputs-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 20px 0;
}

.otp-box {
  width: 46px;
  height: 52px;
  background: #090c17;
  border: 1px solid var(--border);
  border-radius: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: white;
  outline: none;
  transition: all 0.15s;
}
.otp-box:focus {
  border-color: var(--primary);
  box-shadow: 0 0 16px rgba(139, 92, 246, 0.5);
  background: #0d1224;
}

/* Footer Switcher */
.auth-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-footer a {
  color: var(--accent-cyan);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.15s;
}
.auth-footer a:hover { color: white; text-decoration: underline; }

.back-home-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 20px;
  color: var(--text-dim);
  font-size: 13px;
  text-decoration: none;
  transition: all 0.15s;
}
.back-home-link:hover {
  color: var(--text);
  transform: translateX(-2px);
}

/* Hide any rogue Clerk watermarks or dev badges */
.cl-dev-overlay, 
.cl-internal-b3fm6y, 
.cl-watermark, 
.cl-attribution, 
[class*="cl-dev"], 
[class*="cl-watermark"],
[class*="cl-badge"],
[data-localization-key*="watermark"],
div:has(> a[href*="clerk.com"]),
div:has(> [href*="clerk.com"]) {
  display: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
  position: absolute !important;
  left: -9999px !important;
}
