/* ClearMind Pro — Landing & Onboarding Master Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&family=Instrument+Serif:ital@0;1&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  --bg-dark: #050714;
  --card-bg: rgba(13, 16, 38, 0.75);
  --card-border: rgba(255, 255, 255, 0.1);
  --accent-purple: #a855f7;
  --accent-fuchsia: #d946ef;
  --accent-cyan: #06b6d4;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
}

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

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
  selection-background-color: var(--accent-purple);
}

/* Ambient glow & mesh background */
.mesh-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: 
    radial-gradient(circle at 15% 15%, rgba(139, 92, 246, 0.15), transparent 40%),
    radial-gradient(circle at 85% 25%, rgba(217, 70, 239, 0.12), transparent 45%),
    radial-gradient(circle at 50% 85%, rgba(6, 182, 212, 0.1), transparent 50%);
  pointer-events: none;
  z-index: 0;
}

/* Glassmorphism */
.glass {
  background: rgba(15, 18, 42, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
}

.glass-strong {
  background: rgba(12, 14, 32, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.glass-interactive {
  background: rgba(18, 22, 50, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(16px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
}

.glass-interactive:hover {
  background: rgba(28, 33, 72, 0.8);
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -10px rgba(168, 85, 247, 0.25);
}

.glass-interactive.selected {
  background: rgba(45, 27, 85, 0.85);
  border-color: #a855f7;
  box-shadow: 0 0 25px rgba(168, 85, 247, 0.35);
}

/* Gradients */
.text-gradient {
  background: linear-gradient(135deg, #ffffff 20%, #c084fc 60%, #38bdf8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-gradient-purple {
  background: linear-gradient(135deg, #e879f9 0%, #a855f7 50%, #6366f1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.btn-primary {
  background: linear-gradient(135deg, #9333ea, #c026d3, #0284c7);
  color: #ffffff;
  font-weight: 700;
  border: none;
  border-radius: 9999px;
  padding: 12px 28px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-shadow: 0 4px 20px rgba(147, 51, 234, 0.4);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-primary:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 28px rgba(192, 38, 211, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 9999px;
  padding: 12px 24px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

/* Priority tags */
.priority-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.priority-high {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
}
.priority-high.active {
  background: #ef4444;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.6);
}

.priority-med {
  background: rgba(245, 158, 11, 0.15);
  color: #fde68a;
  border: 1px solid rgba(245, 158, 11, 0.4);
}
.priority-med.active {
  background: #f59e0b;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
}

.priority-normal {
  background: rgba(59, 130, 246, 0.15);
  color: #93c5fd;
  border: 1px solid rgba(59, 130, 246, 0.4);
}
.priority-normal.active {
  background: #3b82f6;
  color: #ffffff;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.6);
}

/* Bento Grid */
.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

/* Custom scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(5, 7, 20, 0.6);
}
::-webkit-scrollbar-thumb {
  background: rgba(139, 92, 246, 0.3);
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(139, 92, 246, 0.6);
}

/* Modal styling */
.modal-backdrop,
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 4, 15, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex !important;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-backdrop.active,
.modal-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.modal-card {
  width: 100%;
  max-width: 680px;
  background: rgba(10, 14, 35, 0.98);
  border: 1px solid rgba(168, 85, 247, 0.25);
  border-radius: 28px;
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.9), 0 0 50px rgba(6, 182, 212, 0.15);
  overflow: hidden;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
}

/* Auth Modal Universal Scroll Safeguard */
#authModal.modal-backdrop {
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

#authModal .modal-card {
  max-height: 90vh !important;
  max-height: 90dvh !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

#authModal .modal-card::-webkit-scrollbar {
  width: 5px;
}
#authModal .modal-card::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 9999px;
}
#authModal .modal-card::-webkit-scrollbar-thumb {
  background: rgba(6, 182, 212, 0.4);
  border-radius: 9999px;
}
#authModal .modal-card::-webkit-scrollbar-thumb:hover {
  background: rgba(6, 182, 212, 0.7);
}

/* ========================================================================= */
/* ANDROID MOBILE-SPECIFIC NATIVE OVERHAUL (< 640px)                         */
/* ========================================================================= */
@media (max-width: 640px) {
  .modal-backdrop,
  .modal-overlay {
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: stretch !important;
    background: #020617 !important;
  }

  /* Full screen native app experience on Android */
  #onboardingModal .modal-card {
    max-width: 100vw !important;
    width: 100vw !important;
    height: 100dvh !important;
    height: 100vh;
    max-height: 100dvh !important;
    border-radius: 0 !important;
    border: none !important;
    background: #030712 !important;
    box-shadow: none !important;
  }

  /* Material 3 Bottom Sheet for Auth Modal on Android */
  #authModal.modal-backdrop {
    align-items: flex-end !important;
    background: rgba(2, 6, 23, 0.85) !important;
  }

  #authModal .modal-card {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 28px !important;
    border-top-right-radius: 28px !important;
    border-left: none !important;
    border-right: none !important;
    border-bottom: none !important;
    border-top: 1px solid rgba(255, 255, 255, 0.15) !important;
    max-height: 88dvh !important;
    margin-bottom: 0 !important;
    background: #090d24 !important;
  }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.6; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

.animate-pulse-glow {
  animation: pulseGlow 3s infinite ease-in-out;
}

/* Identity Cards (Step 1) & Persona Cards (Step 4) */
.identity-card, .persona-card {
  background: rgba(15, 23, 42, 0.65) !important;
  border: 1.5px solid rgba(255, 255, 255, 0.1) !important;
  border-radius: 16px;
  padding: 14px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.identity-card:hover, .persona-card:hover {
  background: rgba(22, 33, 62, 0.85) !important;
  border-color: rgba(6, 182, 212, 0.4) !important;
  transform: translateY(-2px);
}

.identity-card.selected, .persona-card.selected {
  background: linear-gradient(145deg, rgba(6, 182, 212, 0.18), rgba(15, 23, 42, 0.95)) !important;
  border: 2px solid #06b6d4 !important;
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.35), inset 0 0 15px rgba(6, 182, 212, 0.08) !important;
  transform: translateY(-1px);
}

/* Card Selection Radio / Checkmark Indicator */
.card-radio-indicator {
  width: 22px;
  height: 22px;
  border-radius: 9999px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: rgba(255, 255, 255, 0.04);
  flex-shrink: 0;
  pointer-events: none;
}

.card-radio-indicator .check-mark {
  display: none;
  font-size: 11px;
  font-weight: 900;
  color: #020617;
  line-height: 1;
  pointer-events: none;
}

.identity-card.selected .card-radio-indicator,
.persona-card.selected .card-radio-indicator {
  background: #06b6d4 !important;
  border-color: #06b6d4 !important;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.7);
}

.identity-card.selected .card-radio-indicator .check-mark,
.persona-card.selected .card-radio-indicator .check-mark {
  display: inline-block !important;
}

.speech-bubble {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.12), rgba(139, 92, 246, 0.08));
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 18px;
  position: relative;
  backdrop-filter: blur(12px);
  animation: bubblePop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes bubblePop {
  0% { transform: scale(0.96); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.holographic-glow {
  position: relative;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.9), rgba(12, 16, 36, 0.95));
  border: 1px solid rgba(6, 182, 212, 0.35);
  box-shadow: 0 0 35px rgba(6, 182, 212, 0.15), inset 0 0 25px rgba(6, 182, 212, 0.05);
}

.interactive-chip {
  transition: all 0.2s ease;
  user-select: none;
}

.interactive-chip:hover {
  transform: translateY(-1px);
}

.interactive-chip.active {
  background: rgba(6, 182, 212, 0.2);
  border-color: #06b6d4;
  color: #cffafe;
  box-shadow: 0 0 12px rgba(6, 182, 212, 0.3);
}

/* Android Native Touch & Ergonomics */
button, [role="button"], .identity-card, .persona-card, .style-card, .rhythm-pill, .pacing-pill, .priority-chip {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

/* Touch active scale feedback */
.touch-scale {
  transition: transform 0.15s ease;
}
.touch-scale:active {
  transform: scale(0.97);
}

/* Hide scrollbars on mobile while keeping smooth scroll */
@media (max-width: 640px) {
  .no-scrollbar::-webkit-scrollbar {
    display: none;
  }
  .no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
  }
}

