
/* GoAmpy Waitlist - Main Stylesheet
 * Extracted from team's React implementation
 * November 2024 - Production Ready
 */

/* ============================================
   CSS RESET & BASE
   ============================================ */

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

/* Screen reader only utility */
.sr-only {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: 'JetBrains Mono', monospace;
  background-color: #0B0F11;
  color: #FFFFFF;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   CSS VARIABLES - Design Tokens
   ============================================ */

:root {
  /* Colors */
  --cyan-primary: #00FFFF;
  --cyan-light: #00CFD2;
  --cyan-glow: rgba(0, 255, 255, 0.25);
  --cyan-glow-strong: rgba(0, 255, 255, 0.5);
  
  --dark-bg: #0B0F11;
  --dark-card: rgba(10, 10, 10, 0.95);
  --dark-surface: #1A1A1A;
  --dark-border: rgba(255, 255, 255, 0.08);
  
  --text-primary: #FFFFFF;
  --text-secondary: #E7ECEF;
  --text-muted: #8AA4AD;
  --text-warm: #FFF5E6;
  
  --success-green: #34D399;
  --success-glow: rgba(52, 211, 153, 0.25);
  
  --accent-coral: #FF6B6B;
  
  /* Typography */
  --font-mono: 'JetBrains Mono', monospace;
  --font-size-xs: 11px;
  --font-size-sm: 12px;
  --font-size-base: 15px;
  --font-size-lg: 18px;
  --font-size-xl: 20px;
  --font-size-2xl: 28px;
  
  --line-height-tight: 1.3;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.6;
  
  --letter-spacing-tight: -0.5px;
  --letter-spacing-normal: 0px;
  --letter-spacing-wide: 0.2px;
  --letter-spacing-wider: 1px;
  
  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  
  /* Border Radius */
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 999px;
  
  /* Shadows */
  --shadow-cyan-sm: 0 0 8px rgba(0, 255, 255, 0.3);
  --shadow-cyan-md: 0 0 12px rgba(0, 255, 255, 0.4);
  --shadow-cyan-lg: 0 0 20px rgba(0, 255, 255, 0.5);
  --shadow-green: 0 0 8px rgba(52, 211, 153, 0.25);
  
  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.2s ease;
  --transition-slow: 0.4s ease;
  
  /* Chat Layout (for CTA alignment) */
  --chat-avatar: 48px;   /* match .avatar width */
  --chat-gap: 12px;      /* space between avatar and bubble */
  --bubble-pad: 16px;    /* left padding inside bubble */
}

/* ============================================
   SCROLLBAR STYLING
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: var(--cyan-glow);
  border-radius: 3px;
  transition: background var(--transition-base);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--cyan-glow-strong);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--cyan-glow) rgba(255, 255, 255, 0.05);
}

/* ============================================
   LAYOUT - MAIN STRUCTURE
   ============================================ */

.main-container {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--dark-bg);
  min-height: 0; /* Allow children with overflow:auto to scroll */
}

/* Mobile: Account for top nav + bottom nav */
@media (max-width: 1023px) {
  .main-container {
    height: calc(100dvh - 68px - 70px); /* Account for top nav (70px) + bottom nav (68px) */
  }
}

/* Desktop: Split panel layout - CHAT IS HERO (58% vs 42%) */
@media (min-width: 1024px) {
  .main-container {
    display: grid;
    grid-template-columns: 58% 1fr; /* Chat (58%) | Console (42%) */
    height: calc(100vh - 70px); /* Account for top nav only */
  }
  
  .chat-panel {
    flex: 0 0 58%;
    min-width: 560px;
  }
  
  .console-panel {
    flex: 1;
  }
}

/* ============================================
   NAVIGATION - TOP BAR (Desktop)
   ============================================ */

.top-navigation {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: #0C0C0C;
  border-bottom: 1px solid rgba(0, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ampy-logo {
  font-family: 'Space Grotesk', Inter, system-ui, sans-serif;
  font-size: 32px;
  font-weight: 700;
  color: #FF6B3D; /* Ampy Orange */
  letter-spacing: -0.3px;
  line-height: 1;
  text-decoration: none;
  display: inline-block;
  transition: opacity var(--transition-base);
}

.ampy-logo:hover {
  opacity: 0.8;
}

/* Mobile responsive */
@media (max-width: 768px) {
  .ampy-logo {
    font-size: 26px;
  }
}

/* The "!" character - bright yellow with glow */
.ampy-logo-bang {
  position: relative;
  display: inline-block;
  margin-left: 1px;
  color: #F9C72D; /* Signal Yellow */
  filter: drop-shadow(0 0 4px rgba(249, 199, 45, 0.3));
}

/* Creates the glowing teal dot at bottom of "!" */
.ampy-logo-bang::after {
  content: '';
  position: absolute;
  
  /* Positioning */
  left: 50%;
  transform: translateX(-50%);
  bottom: 0.09em; /* Positioned at base of "!" */
  
  /* Size (relative to font size) */
  width: 0.24em;
  height: 0.24em;
  border-radius: 50%; /* Perfect circle */
  
  /* Gradient: Teal to Deep Teal */
  background: radial-gradient(
    circle at 40% 40%,
    #00E6C3 0%,
    #00C7D2 100%
  );
  
  /* Triple-layer glow effect */
  box-shadow:
    0 0 6px rgba(249, 199, 45, 0.45),   /* Inner yellow glow */
    0 0 11px rgba(0, 230, 195, 0.8),    /* Mid teal glow */
    0 0 18px rgba(0, 199, 210, 0.45);   /* Outer teal halo */
  
  pointer-events: none; /* Don't interfere with clicks */
  
  /* Pulse animation */
  animation: ampyPulse 2.4s ease-in-out infinite;
}

/* Pulse keyframes */
@keyframes ampyPulse {
  0%, 100% {
    transform: translateX(-50%) scale(1);
    opacity: 0.88;
    box-shadow:
      0 0 6px rgba(249, 199, 45, 0.45),
      0 0 11px rgba(0, 230, 195, 0.8),
      0 0 18px rgba(0, 199, 210, 0.45);
  }
  50% {
    transform: translateX(-50%) scale(1.18); /* Grows 18% larger */
    opacity: 1;
    box-shadow:
      0 0 8px rgba(249, 199, 45, 0.6),      /* Stronger glow */
      0 0 15px rgba(0, 230, 195, 1),
      0 0 26px rgba(0, 199, 210, 0.6);
  }
}

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
  .ampy-logo-bang::after {
    animation: none;
  }
}

.nav-tagline {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: #9DDDE3;
  white-space: nowrap;
  transition: all 0.3s ease;
  display: none;
}

.nav-center {
  display: none;
  align-items: center;
  gap: 32px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
  text-decoration: none;
  transition: color var(--transition-base);
}

.nav-link:hover {
  color: #FF6B3D;
}

/* Subtle link variant for secondary actions */
.nav-link.subtle {
  color: #9AA3AB;
  text-decoration: underline;
}

.nav-link.subtle:hover {
  color: #DDE1E6;
}

.nav-right {
  display: flex;
  align-items: center;
}

.nav-button {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
  padding: 0;
}

.nav-button:hover {
  color: #FF6B3D;
}

/* Mobile: Pill button style with cyan border */
@media (max-width: 1023px) {
  .nav-button {
    padding: 10px 20px;
    border: 1px solid var(--cyan-primary);
    border-radius: var(--radius-full);
    color: var(--cyan-primary);
    font-size: 13px;
  }
  
  .nav-button:hover {
    background: rgba(0, 255, 255, 0.1);
    color: var(--cyan-primary);
  }
}

/* Show tagline on small screens and up */
@media (min-width: 640px) {
  .nav-tagline {
    display: block;
  }
}

/* Desktop navigation enhancements */
@media (min-width: 1024px) {
  .nav-container {
    padding: 16px 32px;
  }
  
  .nav-center {
    display: flex;
  }
}

/* Mobile adjustments */
@media (max-width: 639px) {
  .nav-container {
    padding: 16px 24px;
  }
}

/* ============================================
   MOBILE BOTTOM NAVIGATION
   ============================================ */

.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  padding-bottom: calc(var(--space-2) + env(safe-area-inset-bottom));
  background: rgba(11, 15, 17, 0.95);
  border-top: 1px solid var(--dark-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 100;
}

.mobile-nav-pill {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--dark-border);
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
}

.mobile-nav-pill svg {
  width: 16px;
  height: 16px;
}

.mobile-nav-pill.active {
  background: var(--cyan-primary);
  border-color: var(--cyan-primary);
  color: #000000;
  box-shadow: var(--shadow-cyan-md);
}

.mobile-nav-pill:not(.active):hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
}

@media (min-width: 1024px) {
  .mobile-bottom-nav {
    display: none;
  }
}

/* ============================================
   CHAT PANEL
   ============================================ */

.chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--dark-bg);
  min-height: 0; /* Allow children with overflow:auto to scroll */
}

/* Desktop: Always visible, side-by-side */
@media (min-width: 1024px) {
  .chat-panel {
    display: flex !important; /* Override any .hidden class */
    border-right: 1px solid var(--dark-border);
  }
}

/* Mobile: Full screen panel, can be hidden */
@media (max-width: 1023px) {
  .chat-panel {
    border-right: none;
  }
  
  .chat-panel.hidden {
    display: none;
  }
}

/* ============================================
   CHAT HEADER
   ============================================ */

.chat-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 24px;
  background: linear-gradient(180deg, var(--dark-bg) 0%, rgba(11, 15, 17, 0) 100%);
  border-bottom: 1px solid rgba(0, 255, 255, 0.15);
}

/* Avatar wrapper */
.avatar-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}

/* Avatar image with presence ring */
.chat-header-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 0 0 2px rgba(0, 255, 255, 0.18), 0 0 14px rgba(0, 255, 255, 0.28);
  transition: all 0.2s ease;
}

@media (max-width: 1023px) {
  .chat-header-avatar {
    width: 36px;
    height: 36px;
  }
}

/* Presence dot - real element for reliable rendering */
.presence-dot {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 6px rgba(52, 211, 153, 0.6);
  border: 2px solid #0B0F11;
  transition: all 0.2s ease;
}

/* Header text - with ellipsis on desktop */
.chat-header-text {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 17px;
  line-height: 1.25;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  transition: font-size 0.2s ease;
}

@media (max-width: 640px) {
  .chat-header-text {
    font-size: 15px;
    white-space: normal;
  }
}

.chat-header-text .ampy-name {
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 10px rgba(0, 255, 255, 0.18);
  font-family: 'Space Grotesk', system-ui, sans-serif;
}

.chat-header-text .ampy-role {
  color: var(--cyan-primary);
}

/* Subtle condense on scroll */
.chat-header.is-condensed .chat-header-avatar {
  width: 32px;
  height: 32px;
  box-shadow: 0 0 0 1px rgba(0, 255, 255, 0.18);
}

.chat-header.is-condensed .chat-header-text {
  font-size: 14px;
}

/* ============================================
   CHAT MESSAGES AREA
   ============================================ */

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  min-height: 0; /* Allow overflow:auto to work properly */
  overscroll-behavior-y: contain; /* Prevent scroll chaining */
  gap: var(--space-4);
  scroll-behavior: smooth;
}

/* ============================================
   CHAT MESSAGE
   ============================================ */

.chat-message {
  display: flex;
  gap: var(--space-3);
  animation: messageSlideIn 0.2s ease-out;
}

.chat-message.bot {
  justify-content: flex-start;
}

.chat-message.user {
  justify-content: flex-end;
  animation: messageSlideInRight 0.2s ease-out;
}

@keyframes messageSlideIn {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.message-bubble {
  position: relative;
  max-width: 85%;
  padding: var(--space-4) var(--space-5);
  border-radius: var(--radius-lg);
  word-wrap: break-word;
}

/* Bot Message Bubble */
.bot-bubble {
  background: var(--dark-card);
  border: 1px solid var(--cyan-primary);
  box-shadow: var(--shadow-cyan-sm);
  border-top-left-radius: var(--radius-sm);
}

/* Muted bot bubble for hints */
.bot-bubble.muted {
  background: rgba(0, 0, 0, 0.3);
  border-color: rgba(0, 255, 255, 0.3);
  box-shadow: none;
}

.bot-bubble.muted .bot-text {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
  opacity: 0.8;
}

/* Speech bubble tail (pointing left toward avatar) */
.bubble-tail-outer {
  position: absolute;
  left: -9px;
  top: 16px;
  width: 0;
  height: 0;
  border-top: 7px solid transparent;
  border-bottom: 7px solid transparent;
  border-right: 9px solid var(--cyan-primary);
}

.bubble-tail-inner {
  position: absolute;
  left: -7px;
  top: 17px;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-right: 8px solid var(--dark-card);
}

/* User Message Bubble */
.user-bubble {
  background: var(--dark-surface);
  border: 2px solid var(--success-green);
  box-shadow: var(--shadow-green);
  border-top-right-radius: var(--radius-sm);
}

/* System Message Bubble */
.system-bubble {
  background: rgba(0, 255, 255, 0.05);
  border-left: 4px dashed var(--cyan-primary);
  border-radius: var(--radius-sm);
}

.message-text {
  margin: 0;
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  letter-spacing: var(--letter-spacing-wide);
  word-break: break-word;
  white-space: pre-wrap;
}

.bot-text {
  font-family: var(--font-mono);
  color: var(--text-warm);
}

.user-text {
  color: var(--text-primary);
}

.system-text {
  font-family: var(--font-mono);
  color: var(--cyan-primary);
  font-style: italic;
}

/* Bubble content styling (used by tour and dashboard) - matches .message-text */
.bubble-content {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  line-height: var(--line-height-relaxed);
  letter-spacing: var(--letter-spacing-wide);
  color: var(--text-warm);
  word-break: break-word;
}

/* Chip Container for Q4 options */
.chip-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip-button {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  padding: 10px 16px;
  background: rgba(0, 255, 255, 0.08);
  border: 1px solid var(--cyan-primary);
  border-radius: var(--radius-full);
  color: var(--cyan-primary);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.chip-button:hover:not(:disabled) {
  background: rgba(0, 255, 255, 0.15);
  box-shadow: 0 0 8px rgba(0, 255, 255, 0.3);
  transform: translateY(-1px);
}

.chip-button:active:not(:disabled) {
  transform: translateY(0);
}

.chip-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

/* Mobile adjustments */
@media (max-width: 767px) {
  .message-bubble {
    max-width: 90%;
    padding: 14px var(--space-4);
  }
  
  .message-text,
  .bubble-content {
    font-size: 14px;
  }

  .chip-button {
    font-size: 13px;
    padding: 8px 14px;
  }
}

/* ============================================
   INLINE ACTIONS & OTP VERIFICATION
   ============================================ */

/* Inline CTA buttons inside a bot bubble */
.inline-actions {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.inline-btn {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  padding: 10px 16px;
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
  font-weight: 500;
}

.inline-btn.primary {
  background: var(--cyan-primary);
  color: #000;
  border: 0;
  box-shadow: var(--shadow-cyan-sm);
}

.inline-btn.primary:hover {
  background: var(--cyan-light);
  box-shadow: 0 0 12px var(--cyan-glow-strong);
  transform: translateY(-1px);
}

.inline-btn.secondary {
  background: transparent;
  color: var(--cyan-primary);
  border: 1px solid var(--cyan-primary);
}

.inline-btn.secondary:hover {
  background: rgba(0, 255, 255, 0.1);
  box-shadow: 0 0 8px var(--cyan-glow);
}

.inline-btn:focus {
  outline: 2px solid var(--cyan-primary);
  outline-offset: 2px;
}

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

/* OTP Input */
.otp-input {
  width: 180px;
  height: 48px;
  padding: 0 14px;
  letter-spacing: 4px;
  text-align: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--cyan-primary);
  background: rgba(10, 10, 10, 0.8);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 18px;
  transition: all var(--transition-fast);
}

.otp-input:focus {
  outline: none;
  box-shadow: 0 0 12px var(--cyan-glow-strong);
  border-color: var(--cyan-light);
}

.otp-help {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.otp-group {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  flex-wrap: wrap;
}

#otpSubmit.inline-btn.primary {
  height: 48px;
  padding: 10px 16px;
}

.resend {
  margin-left: 8px;
  color: var(--cyan-primary);
  background: none;
  border: 0;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  text-decoration: underline;
  transition: opacity var(--transition-fast);
}

.resend:hover:not(:disabled) {
  opacity: 0.8;
}

.resend:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  text-decoration: none;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */

.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--dark-card);
  border: 1px solid var(--cyan-primary);
  box-shadow: var(--shadow-cyan-sm);
  width: fit-content;
}

.typing-indicator .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cyan-primary);
  animation: typingDotBounce 1.4s infinite ease-in-out;
}

.typing-indicator .dot.delay-1 {
  animation-delay: 0.2s;
}

.typing-indicator .dot.delay-2 {
  animation-delay: 0.4s;
}

@keyframes typingDotBounce {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-8px);
    opacity: 1;
  }
}

/* ============================================
   CHAT INPUT
   ============================================ */

.chat-input-container {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  padding-bottom: calc(var(--space-4) + env(safe-area-inset-bottom));
  background: rgba(11, 15, 17, 0.95);
  border-top: 1px solid var(--dark-border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.chat-input {
  flex: 1;
  height: 48px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  border: 1px solid var(--cyan-primary);
  background: rgba(10, 10, 10, 0.8);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 14px;
  outline: none;
  transition: all var(--transition-base);
}

.chat-input::placeholder {
  color: var(--text-muted);
}

.chat-input:focus {
  border-color: var(--cyan-primary);
  box-shadow: 0 0 6px var(--cyan-glow-strong);
  outline: 2px solid var(--accent-coral);
  outline-offset: 2px;
}

.chat-input:disabled,
.chat-input.chat-input-disabled {
  background: #0A0A0A;
  border-color: #333333;
  color: #666666;
  cursor: not-allowed;
}

.chat-input:disabled::placeholder,
.chat-input.chat-input-disabled::placeholder {
  color: #555555;
  font-style: italic;
}

.send-button {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: var(--cyan-primary);
  color: #000000;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-cyan-sm);
}

.send-button:hover:not(:disabled) {
  background: var(--cyan-light);
  box-shadow: var(--shadow-cyan-md);
  transform: scale(1.05);
}

.send-button:disabled {
  background: rgba(0, 255, 255, 0.3);
  color: rgba(0, 0, 0, 0.4);
  cursor: not-allowed;
  box-shadow: none;
}

.send-button svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   CONSOLE PANEL
   ============================================ */

.console-panel {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--dark-bg);
}

/* Desktop: Always visible, side-by-side */
@media (min-width: 1024px) {
  .console-panel {
    display: flex !important; /* Override any .hidden class */
  }
}

/* Mobile: Can be hidden */
@media (max-width: 1023px) {
  .console-panel.hidden {
    display: none;
  }
}

.console-content {
  flex: 1;
  min-height: 0;
  padding: var(--space-5);
  display: grid;
  grid-template-rows: auto 1fr;
  gap: var(--space-6);
}

/* ============================================
   STATUS BAR
   ============================================ */

.status-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  padding: var(--space-3) var(--space-5) var(--space-4);
  background: linear-gradient(180deg, var(--dark-bg) 0%, rgba(11, 15, 17, 0) 100%);
}

.status-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px var(--space-3);
  border-radius: var(--radius-full);
  border: 1px solid var(--dark-border);
  background: transparent;
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  white-space: nowrap;
}

.chip strong {
  font-weight: 700;
  color: var(--text-secondary);
}

.live-chip {
  border-color: var(--cyan-primary);
  color: var(--cyan-primary);
  box-shadow: var(--shadow-cyan-md);
}

.live-dot {
  font-size: 10px;
  animation: livePulse 2s infinite;
}

@keyframes livePulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.progress-track {
  height: 6px;
  border-radius: var(--radius-full);
  background: #0F1417;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, #00C7D2 0%, #00E6C3 100%);
  box-shadow: 0 0 10px rgba(0, 199, 210, 0.5);
  transition: width var(--transition-slow) cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   CONSOLE CARD
   ============================================ */

.console-card {
  padding: var(--space-6);
  border-radius: var(--radius-md);
  border: 1px solid var(--dark-border);
  background: rgba(26, 26, 26, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.card-kicker {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--cyan-primary);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-wider);
  margin-bottom: var(--space-2);
}

.card-title {
  font-family: var(--font-mono);
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
  margin: 0 0 var(--space-3) 0;
  line-height: var(--line-height-tight);
}

.card-description {
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  color: var(--text-muted);
  line-height: var(--line-height-relaxed);
  margin: 0 0 var(--space-6) 0;
}

.console-button {
  width: 100%;
  padding: var(--space-4) var(--space-6);
  border-radius: var(--radius-md);
  border: none;
  background: var(--accent-coral);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: var(--font-size-base);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.console-button:hover {
  background: #FF8585;
  box-shadow: 0 0 30px rgba(255, 107, 107, 0.5);
  transform: translateY(-2px);
}

/* Ghost button variant */
.console-button.ghost {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #DDE1E6;
  box-shadow: none;
}

.console-button.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: none;
  transform: translateY(0);
}

.console-button.success {
  background: var(--success-green);
  box-shadow: 0 0 20px var(--success-glow);
}

.console-button.success:hover {
  background: #4AE0A8;
}

/* Make console card less loud than chat */
.console-card.stage-card {
  opacity: 0.85;
}

.card-footnote {
  margin-top: var(--space-3);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  text-align: center;
}

.card-footnote a {
  color: #9AA3AB;
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color var(--transition-base);
}

.card-footnote a:hover {
  color: #DDE1E6;
}

/* ============================================
   TERMINAL OUTPUT
   ============================================ */

.terminal-output {
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  background: #000000;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-4);
  background: #1A1A1A;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.terminal-dots {
  display: flex;
  gap: 6px;
}

.terminal-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.terminal-dots .dot.red {
  background: #FF5F56;
}

.terminal-dots .dot.yellow {
  background: #FFBD2E;
}

.terminal-dots .dot.green {
  background: #27C93F;
}

.terminal-title {
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.terminal-content {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-relaxed);
}

.terminal-line {
  margin-bottom: var(--space-2);
}

.terminal-line.cyan {
  color: var(--cyan-primary);
}

.terminal-line.green {
  color: var(--success-green);
}

.terminal-line.coral {
  color: var(--accent-coral);
}

.terminal-line.muted {
  color: var(--text-muted);
}

.terminal-line.pulse {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ============================================
   RESIZE HANDLE (Desktop)
   ============================================ */

.resize-handle {
  position: relative;
  width: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: col-resize;
  user-select: none;
  flex-shrink: 0;
}

.resize-line {
  position: absolute;
  inset-y: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.2s ease;
}

.resize-handle:hover .resize-line,
.resize-handle.resizing .resize-line {
  background: var(--cyan-primary);
}

.resize-grip {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  height: 40px;
  width: 16px;
  border-radius: 6px;
  background: rgba(26, 26, 26, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  opacity: 0;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.resize-handle:hover .resize-grip,
.resize-handle.resizing .resize-grip {
  opacity: 1;
  background: var(--cyan-primary);
  border-color: var(--cyan-primary);
  color: #000000;
}

@media (min-width: 1024px) {
  .resize-handle {
    display: flex;
  }
}

@media (max-width: 1023px) {
  .resize-handle {
    display: none !important;
  }
}

/* ============================================
   CTA SHELL - Two rows: CTA (auto width), Rewards (full width)
   ============================================ */

.cta-shell { 
  display: grid; 
  row-gap: 12px; 
  width: 100%;
}

.cta-row { 
  width: max-content;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cta-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  background: #FF6B3D;
  color: #000000;
  border-radius: 12px;
  border: none;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
  box-shadow: 0 4px 16px rgba(255, 107, 61, 0.4);
  min-height: 52px;
  white-space: nowrap;
}

.cta-primary:hover {
  background: #FF8560;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 61, 0.5);
}

@media (prefers-reduced-motion: reduce){
  .cta-primary{ 
    transition: none; 
  }
  .cta-primary:hover{ 
    transform: none;
    box-shadow: 0 4px 16px rgba(255, 107, 61, 0.4);
  }
}

.cta-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
  font-family: var(--font-mono);
}

.cta-link {
  font-size: 14px;
  color: var(--cyan-primary);
  text-decoration: none;
  font-family: var(--font-mono);
  transition: all 0.2s ease;
}

.cta-link:hover {
  text-decoration: underline;
}

.cta-button-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  background: #FF6B3D;
  color: #000000;
  border-radius: 12px;
  border: none;
  font-family: var(--font-mono);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 16px rgba(255, 107, 61, 0.4);
  min-height: 52px;
  width: 100%;
}

.cta-button-primary:hover {
  background: #FF8560;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 61, 0.5);
}

.cta-arrow {
  font-size: 20px;
  transition: transform 0.3s ease;
}

.cta-button-primary:hover .cta-arrow {
  transform: translateX(4px);
}

/* Secondary button variant - link-like style */
.cta-button-secondary.linklike {
  background: none;
  border: 0;
  color: #9AA3AB;
  text-decoration: underline;
  padding: 8px 0;
  font-size: 14px;
  cursor: pointer;
  transition: color var(--transition-base);
}

.cta-button-secondary.linklike:hover {
  color: #DDE1E6;
}

.cta-footnote {
  font-size: 12px;
  color: var(--text-muted);
  margin: 8px 0 0 0;
  text-align: center;
}

.cta-button-secondary {
  font-size: 14px;
  color: var(--cyan-primary);
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--font-mono);
  text-align: center;
  transition: all 0.2s ease;
  padding: 8px;
}

.cta-button-secondary:hover {
  text-decoration: underline;
}

@media (min-width: 1024px) {
  .cta-button-primary {
    width: auto;
  }
}

/* ============================================
   REWARDS (inline, under Join CTA)
   ============================================ */

.rewards-strip { display: none !important; } /* legacy off */

#rewardsInline { 
  width: 100%; 
  align-self: stretch; 
  margin-top: 4px; 
}

.rewards-inline{
  padding: 14px;
  border: 1px solid rgba(0,255,255,.28);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(0,255,255,.06), rgba(0,255,255,.03));
  box-shadow: 0 0 0 1px rgba(0,255,255,.06) inset, 0 6px 24px rgba(0,0,0,.30);
}

.rewards-header{
  margin: 0 0 10px;
  font: 600 12px/1 var(--font-sans, "Space Grotesk", system-ui, sans-serif);
  letter-spacing: .08em; 
  text-transform: uppercase;
  color: var(--cyan-primary, #00FFFF);
  opacity: .85;
}

.rewards-grid{ 
  display: grid; 
  gap: 10px; 
  grid-template-columns: repeat(3, minmax(0,1fr)); 
}

@media (max-width:1024px){ 
  .rewards-grid{ grid-template-columns: repeat(2,1fr); } 
}

@media (max-width:560px){  
  .rewards-grid{ grid-template-columns: 1fr; } 
}

.reward-item{
  display:flex; 
  align-items:center; 
  gap:10px;
  padding:12px 14px;
  border:1px solid rgba(0,255,255,.18);
  border-radius:10px; 
  background: rgba(0,35,35,.28);
  transition: transform 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
}

.reward-item:hover{ 
  transform: translateY(-1px); 
  border-color: rgba(0,255,255,.38); 
  box-shadow: 0 6px 18px rgba(0,255,255,.08); 
}

.reward-ico{ 
  width:18px; 
  height:18px; 
  fill:#FF6B3D; 
  flex:0 0 18px; 
}

.reward-title{ 
  font: 600 13px/1.35 var(--font-sans, "Space Grotesk", system-ui, sans-serif); 
  color: var(--warm-white, #FFF5E6); 
}

@media (prefers-reduced-motion: reduce){
  .reward-item{ transition:none; }
  .reward-item:hover{ transform:none; box-shadow:none; }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.hidden {
  display: none !important;
}

.visible {
  display: flex !important;
}

.text-center {
  text-align: center;
}

.text-cyan {
  color: var(--cyan-primary);
}

.text-muted {
  color: var(--text-muted);
}

/* ============================================
   ONBOARDING UI CONTROL
   ============================================ */

/* Hide onboarding-only UI until chat starts */
[data-onboarding-only] {
  display: none;
}

/* ============================================
   MOBILE STICKY START BUTTON
   ============================================ */

.sticky-start {
  position: fixed;
  bottom: 72px; /* Above mobile bottom nav */
  left: 0;
  right: 0;
  padding: 0 var(--space-4);
  z-index: 30;
  display: none;
}

@media (max-width: 1023px) {
  .sticky-start {
    display: block;
  }
  
  /* Hide sticky button when onboarding starts */
  body.onboarding .sticky-start {
    display: none;
  }
}

@media (min-width: 1024px) {
  .sticky-start {
    display: none;
  }
}

/* ============================================
   NO JAVASCRIPT FALLBACK
   ============================================ */

.noscript {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: var(--space-6);
  background: var(--dark-card);
  border: 1px solid var(--cyan-primary);
  border-radius: var(--radius-md);
  text-align: center;
  font-family: var(--font-mono);
  color: var(--text-primary);
  z-index: 1000;
}

.noscript a {
  color: var(--cyan-primary);
  text-decoration: underline;
}

.noscript a:hover {
  color: var(--cyan-light);
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Focus visible */
*:focus-visible {
  outline: 2px solid var(--cyan-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Print styles */
@media print {
  .mobile-bottom-nav,
  .send-button {
    display: none;
  }
}

/* ============================================
   IMPROVED CTA BLOCK STYLES
   ============================================ */

/* CTA block aligned to bot bubble outer edge */
.chat-message.bot .cta-block {
  margin-left: calc(var(--chat-avatar) + var(--chat-gap));
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 360px;
  padding: 8px 0;
}

/* Tidy vertical rhythm */
.chat-message.bot + .chat-message.bot .cta-block { 
  margin-top: 8px; 
}

/* Primary button */
.btn.btn-primary.btn-lg {
  --btn-bg: #ff6b6b;      /* coral */
  --btn-fg: #0b0f14;      /* dark text for contrast */
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 0;
  height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 6px 18px rgba(255,107,107,.24);
  transition: transform .06s ease, box-shadow .2s ease, background .2s ease;
  cursor: pointer;
}

.btn.btn-primary.btn-lg:hover { 
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(255,107,107,.30);
}

.btn.btn-primary.btn-lg:active { 
  transform: translateY(0); 
}

.btn.btn-primary.btn-lg:focus-visible {
  outline: 2px solid #ffd2d2;
  outline-offset: 3px;
}

/* Arrow micro-interaction */
.btn-arrow { 
  transition: transform .15s ease; 
}

.btn:hover .btn-arrow { 
  transform: translateX(2px); 
}

/* Loading state */
.btn.loading {
  pointer-events: none;
  opacity: .95;
}

.btn.loading .btn-label { 
  opacity: .9; 
}

.btn.loading::after {
  content: "";
  width: 16px; 
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,.25);
  border-top-color: rgba(0,0,0,.75);
  margin-left: 8px;
  animation: spin .7s linear infinite;
}

@keyframes spin { 
  to { transform: rotate(360deg); } 
}

/* Note + secondary link */
.cta-note { 
  color: rgba(255,255,255,.7); 
  font-size: 14px; 
  line-height: 20px; 
  margin: 0;
}

.link-skip {
  display: inline-flex;
  min-height: 44px; /* touch target */
  align-items: center;
  color: #9aa3ab;
  text-decoration: underline;
  width: fit-content;
  cursor: pointer;
}

.link-skip:hover { 
  color: #c0c7ce; 
}

/* Smooth fade when CTA is dismissed */
#ctaBubble.is-exiting { 
  opacity: 0; 
  transform: translateY(4px); 
  transition: opacity .18s ease, transform .18s ease;
}

/* Mobile adjustments for chat layout */
@media (max-width: 640px) {
  :root { 
    --chat-avatar: 48px; /* avatar stays 48px on mobile */
    --chat-gap: 8px; 
    --bubble-pad: 14px; 
  }
}

/* ============================================
   ACCESS CARD HUD (Live Companion)
   ============================================ */

/* Access card HUD */
.status-kicker{ color: var(--cyan-400,#00FFFF); font: 600 12px/1 var(--font-sans,"Space Grotesk"); letter-spacing:.08em; text-transform:uppercase; margin:0 0 8px; }
.status-title{ margin:0 0 8px; font: 700 clamp(22px,2.4vw,34px)/1.15 var(--font-sans,"Space Grotesk"); color: var(--text-primary,#fff); }
.status-sub{ margin:0 0 12px; color: var(--text-muted,#9cc); font: 15px/1.6 var(--font-mono,"JetBrains Mono"); }

.status-checklist{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:0 0 14px; padding:0; list-style:none; }
.status-checklist li{ display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid rgba(0,255,255,.18); background:rgba(0,35,35,.25); border-radius:10px; color:#FFF5E6; font:600 13px/1.3 var(--font-sans,"Space Grotesk"); }
.status-checklist .dot{ width:10px; height:10px; border-radius:50%; box-shadow: inset 0 0 0 2px rgba(0,255,255,.5); }
.status-checklist li[data-done="true"] .dot{ background:#00FFFF; box-shadow:none; }

.status-actions{ display:flex; gap:12px; align-items:center; }
.btn.ghost{ border:1px solid rgba(0,255,255,.35); background:transparent; color:#FFF5E6; padding:12px 16px; border-radius:999px; font:600 14px var(--font-sans,"Space Grotesk"); }
.btn.link{ background:none; border:0; color:#00FFFF; padding:8px 0; font:600 14px var(--font-sans,"Space Grotesk"); }

.btn[disabled]{ opacity:.5; cursor:not-allowed; }
@media (max-width:900px){ .status-checklist{ grid-template-columns:repeat(2,1fr);} }
@media (max-width:560px){ .status-checklist{ grid-template-columns:1fr;} }
@media (prefers-reduced-motion:reduce){ .status-checklist *{ transition:none!important; } }