/* =====================================================
   QuitCheck Design System
   A clean, professional, trust-building aesthetic
   ===================================================== */

/* CSS Custom Properties */
:root {
  /* Primary palette - Deep indigo/blue for trust */
  --primary-50: #eef2ff;
  --primary-100: #e0e7ff;
  --primary-200: #c7d2fe;
  --primary-300: #a5b4fc;
  --primary-400: #818cf8;
  --primary-500: #6366f1;
  --primary-600: #4f46e5;
  --primary-700: #4338ca;
  --primary-800: #3730a3;
  --primary-900: #312e81;
  
  /* Neutral palette */
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  
  /* Semantic colors */
  --success-50: #ecfdf5;
  --success-500: #10b981;
  --success-600: #059669;
  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --danger-50: #fef2f2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  
  /* Border radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Google Fonts import */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

/* Base styles */
html {
  font-size: 15px;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

html {
  position: relative;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
  margin-bottom: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  /* Ensure overflow is not hidden */
  overflow-x: hidden;
  overflow-y: auto;
}

/* Main content area */
main {
  padding-bottom: 1.5rem;
  flex: 1 0 auto;
}

/* Mobile viewport fix - ensure content is not cut off */
@supports (min-height: 100dvh) {
  body {
    min-height: 100dvh;
  }
}

/* Ensure the flex container allows scrolling on mobile */
@media (max-width: 767.98px) {
  html, body {
    height: auto;
    min-height: 100%;
  }
  
  body.d-flex {
    min-height: 100vh;
    min-height: 100dvh;
  }
}

/* Focus states */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 3px var(--primary-200);
  outline: none;
}

/* Typography enhancements */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.025em;
}

.display-4, .display-5 {
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.lead {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--gray-600);
}

.text-muted {
  color: var(--gray-500) !important;
}

/* Card styling */
.card {
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-xl);
  background: white;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-base), transform var(--transition-base);
  overflow: visible;
}

.card.shadow-sm {
  box-shadow: var(--shadow-md) !important;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

/* Section icons */
.section-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
}

/* Option cards for radio buttons */
.option-card {
  padding: 1rem 1.25rem;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  transition: all var(--transition-fast);
  cursor: pointer;
  margin: 0;
  background: white;
}

.option-card.form-check {
  padding-left: 3rem;
}

.option-card .form-check-input {
  margin-left: -1.75rem;
  margin-top: 0.25rem;
  width: 1.25rem;
  height: 1.25rem;
}

.option-card:hover {
  border-color: var(--primary-400);
  background-color: var(--primary-50);
}

.option-card .form-check-input:checked ~ .form-check-label {
  font-weight: 600;
  color: var(--primary-700);
}

.option-card:has(.form-check-input:checked) {
  border-color: var(--primary-500);
  background-color: var(--primary-50);
  box-shadow: 0 0 0 4px var(--primary-100);
}

/* Button group styling */
.btn-group .btn-outline-secondary {
  border: 2px solid var(--gray-200);
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  transition: all var(--transition-fast);
}

.btn-group .btn-outline-secondary:hover {
  background-color: var(--primary-50);
  border-color: var(--primary-400);
  color: var(--primary-700);
}

.btn-check:checked + .btn-outline-secondary {
  background-color: var(--primary-600);
  border-color: var(--primary-600);
  color: white;
  box-shadow: 0 0 0 4px var(--primary-100);
}

/* Form inputs */
.form-control {
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.form-control:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px var(--primary-100);
}

.form-control::placeholder {
  color: var(--gray-400);
}

/* Input groups */
.input-group-text {
  background-color: var(--gray-100);
  border: 2px solid var(--gray-200);
  border-right: none;
  color: var(--gray-600);
  font-weight: 500;
}

.input-group .form-control {
  border-left: none;
}

.input-group:focus-within .input-group-text {
  border-color: var(--primary-500);
  background-color: var(--primary-50);
  color: var(--primary-600);
}

.input-group:focus-within .form-control {
  border-color: var(--primary-500);
}

/* Verdict badges */
.verdict-badge {
  font-size: 4rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100px;
  height: 100px;
  border-radius: var(--radius-full);
  line-height: 1;
}

.verdict-badge.verdict-caution {
  color: var(--danger-600);
  background: var(--danger-50);
}

.verdict-badge.verdict-warning {
  color: var(--warning-600);
  background: var(--warning-50);
}

.verdict-badge.verdict-success {
  color: var(--success-600);
  background: var(--success-50);
}

.verdict-badge-lg {
  font-size: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  line-height: 1;
}

.verdict-badge-lg.verdict-caution {
  color: var(--danger-600);
  background: var(--danger-50);
}

.verdict-badge-lg.verdict-warning {
  color: var(--warning-600);
  background: var(--warning-50);
}

.verdict-badge-lg.verdict-success {
  color: var(--success-600);
  background: var(--success-50);
}

/* Verdict card borders */
.verdict-card {
  border-left: 5px solid transparent;
  overflow: hidden;
}

.verdict-card.verdict-too-early {
  border-left-color: var(--danger-500);
}

.verdict-card.verdict-borderline {
  border-left-color: var(--warning-500);
}

.verdict-card.verdict-reasonable {
  border-left-color: var(--success-500);
}

/* Blurred preview on paywall */
.blurred-preview {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.blurred-content {
  filter: blur(6px);
  user-select: none;
  color: var(--gray-500);
}

.blur-overlay {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8) 0%, rgba(255, 255, 255, 0.6) 100%);
  backdrop-filter: blur(4px);
}

/* Explanation box */
.explanation-box {
  border-left: 4px solid var(--primary-500);
  background: linear-gradient(135deg, var(--primary-50) 0%, white 100%);
}

/* Primary button enhancements */
.btn-primary {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-700) 100%);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), 0 4px 14px -3px var(--primary-500);
  transition: all var(--transition-base);
  font-weight: 600;
  letter-spacing: 0.01em;
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--primary-700) 0%, var(--primary-800) 100%);
  box-shadow: var(--shadow-lg), 0 6px 20px -3px var(--primary-500);
  transform: translateY(-2px);
}

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

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.125rem;
  border-radius: var(--radius-lg);
}

/* Secondary button */
.btn-outline-primary {
  border: 2px solid var(--primary-600);
  color: var(--primary-600);
  font-weight: 600;
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.btn-outline-primary:hover {
  background: var(--primary-600);
  border-color: var(--primary-600);
  box-shadow: var(--shadow-md);
}

/* Light button for dark backgrounds */
.btn-light {
  background: white;
  color: var(--primary-700);
  font-weight: 600;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
}

.btn-light:hover {
  background: var(--gray-100);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Footer styling */
.footer {
  background: white;
  border-top: 1px solid var(--gray-200);
  padding: 1rem 0;
  margin-top: 1.5rem;
  flex-shrink: 0;
}

/* Form labels */
.form-label {
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.75rem;
  font-size: 0.95rem;
}

/* Navigation enhancements */
.navbar {
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--gray-200);
  padding: 0.75rem 0;
  transition: all var(--transition-base);
  /* Ensure navbar doesn't cause layout issues on mobile */
  position: sticky;
  top: 0;
  z-index: 1030;
}

.navbar-brand {
  font-weight: 800;
  font-size: 1.5rem;
  color: var(--primary-600) !important;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.navbar-brand-icon {
  color: var(--primary-600);
  flex-shrink: 0;
}

.navbar .nav-link {
  font-weight: 500;
  color: var(--gray-600) !important;
  padding: 0.5rem 1rem !important;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  margin: 0 0.25rem;
}

.navbar .nav-link:hover {
  color: var(--primary-600) !important;
  background: var(--primary-50);
}

.navbar .nav-link.active {
  color: var(--primary-700) !important;
  background: var(--primary-100);
}

/* Badge enhancements */
.badge {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.badge.bg-primary-subtle {
  background-color: var(--primary-100) !important;
  color: var(--primary-700) !important;
}

.badge.bg-success-subtle {
  background-color: var(--success-50) !important;
  color: var(--success-600) !important;
}

.rounded-pill {
  border-radius: var(--radius-full) !important;
}

/* Alert enhancements */
.alert {
  border-radius: var(--radius-lg);
  border: none;
}

.alert-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.alert-success {
  background: var(--success-50);
  color: var(--success-600);
}

/* Dividers */
hr {
  border-color: var(--gray-200);
  opacity: 1;
}

/* List group */
.list-group-item {
  border-color: var(--gray-200);
  padding: 1rem 0;
}

/* Background colors */
.bg-light {
  background-color: var(--gray-100) !important;
}

.bg-white {
  background-color: white !important;
}

/* Rounded corners */
.rounded-3 {
  border-radius: var(--radius-lg) !important;
}

.rounded-4 {
  border-radius: var(--radius-xl) !important;
}

/* Responsive adjustments */
@media (max-width: 767.98px) {
  .btn-group {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .btn-group .btn {
    flex: 1 1 auto;
    border-radius: var(--radius-md) !important;
  }
  
  .verdict-badge {
    font-size: 3rem;
    width: 80px;
    height: 80px;
  }
  
  .verdict-badge-lg {
    font-size: 2rem;
    width: 56px;
    height: 56px;
  }
  
  .display-4 {
    font-size: 2rem;
  }
  
  .display-5 {
    font-size: 1.75rem;
  }
  
  .navbar-brand {
    font-size: 1.25rem;
  }
  
  .navbar-brand-icon {
    width: 24px;
    height: 24px;
  }
}

/* Assessment form specific styles */
form.card {
  overflow: visible;
}

form.card .card-body {
  overflow: visible;
}

/* =====================================================
   Landing Page Styles
   ===================================================== */

.hero-section {
  background: linear-gradient(180deg, white 0%, var(--gray-50) 100%);
  padding-top: 5rem;
  padding-bottom: 5rem;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 150%;
  height: 100%;
  background: radial-gradient(ellipse at center top, var(--primary-50) 0%, transparent 70%);
  pointer-events: none;
}

.hero-section h1 {
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.1;
  position: relative;
}

.hero-section .lead {
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  font-size: 1.25rem;
  position: relative;
}

.hero-taglines {
  position: relative;
}

.hero-taglines .badge {
  font-weight: 500;
  font-size: 0.875rem;
  border: 1px solid var(--gray-200);
  background: white !important;
  color: var(--gray-700) !important;
  box-shadow: var(--shadow-xs);
}

/* Section spacing */
section {
  position: relative;
}

section.py-4 {
  padding-top: 2rem !important;
  padding-bottom: 2rem !important;
}

section.py-5 {
  padding-top: 4rem !important;
  padding-bottom: 4rem !important;
}

/* Problem section list */
section ul.list-unstyled li {
  font-size: 1.1rem;
}

/* What this is section */
.col-md-6 h3.text-success {
  color: var(--success-600) !important;
}

.col-md-6 h3.text-danger {
  color: var(--danger-600) !important;
}

/* Pricing section */
.pricing-card {
  position: relative;
  overflow: hidden;
}

.pricing-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-500) 0%, var(--primary-700) 100%);
}

/* FAQ Accordion */
.accordion {
  --bs-accordion-border-color: transparent;
  --bs-accordion-btn-focus-box-shadow: none;
}

.accordion-item {
  background-color: transparent;
  border: none;
}

.accordion-button {
  font-weight: 600;
  color: var(--gray-800);
  background-color: var(--gray-100);
  border-radius: var(--radius-lg) !important;
  padding: 1.25rem 1.5rem;
  border: 1px solid var(--gray-200);
  transition: all var(--transition-fast);
}

.accordion-button:not(.collapsed) {
  background-color: var(--primary-50);
  color: var(--primary-700);
  border-color: var(--primary-200);
  box-shadow: none;
}

.accordion-button:hover {
  background-color: var(--primary-50);
  border-color: var(--primary-300);
}

.accordion-button::after {
  background-size: 1rem;
  width: 1rem;
  height: 1rem;
}

.accordion-button:focus {
  box-shadow: 0 0 0 3px var(--primary-200);
}

.accordion-body {
  padding: 1.25rem 1.5rem;
  color: var(--gray-600);
  background: white;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  border: 1px solid var(--gray-200);
  border-top: none;
  margin-top: -0.5rem;
}

/* CTA styling */
.cta-section {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
  border-radius: var(--radius-2xl);
  position: relative;
  overflow: hidden;
}

.cta-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.cta-section h2,
.cta-section p {
  position: relative;
  z-index: 1;
}

.cta-section .btn {
  position: relative;
  z-index: 1;
}

/* Trust indicators */
.trust-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--gray-500);
  font-size: 0.875rem;
}

.trust-indicator i {
  color: var(--success-500);
}

/* Feature icons */
.feature-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-lg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

/* Mobile landing page adjustments */
@media (max-width: 767.98px) {
  .hero-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  .hero-section h1 {
    font-size: 1.875rem;
    line-height: 1.2;
  }
  
  .hero-section .lead {
    font-size: 1.0625rem;
  }
  
  .hero-taglines .badge {
    display: block;
    margin-bottom: 0.5rem;
    margin-right: 0 !important;
  }
  
  section.py-5 {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
  }
  
  .accordion-button {
    padding: 1rem 1.25rem;
    font-size: 0.9375rem;
  }
  
  .accordion-body {
    padding: 1rem 1.25rem;
  }
}

/* =====================================================
   Paywall Page Specific Styles
   ===================================================== */

.paywall-card {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
  position: relative;
  overflow: hidden;
}

.paywall-card::before {
  content: '';
  position: absolute;
  top: -100px;
  right: -100px;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  pointer-events: none;
}

.paywall-card h1,
.paywall-card h2,
.paywall-card h3,
.paywall-card h4,
.paywall-card h5,
.paywall-card h6 {
  color: inherit;
}

.paywall-card .btn-light {
  font-size: 1.125rem;
  padding: 1rem 2rem;
}

/* =====================================================
   Results Page Specific Styles
   ===================================================== */

.results-factors {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
}

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

.factor-card {
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  text-align: center;
  transition: all var(--transition-fast);
}

.factor-card:hover {
  background: var(--primary-50);
  transform: translateY(-2px);
}

.factor-card i {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  display: block;
}

/* =====================================================
   Utility Classes
   ===================================================== */

.text-gradient {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.border-gradient {
  border: 2px solid transparent;
  background: linear-gradient(white, white) padding-box,
              linear-gradient(135deg, var(--primary-400), var(--primary-600)) border-box;
}

/* Smooth scrolling anchor offset */
[id] {
  scroll-margin-top: 80px;
}

/* Selection color */
::selection {
  background: var(--primary-200);
  color: var(--primary-900);
}

/* Container max-width override for better readability */
@media (min-width: 1200px) {
  .container {
    max-width: 1140px;
  }
}

/* Subtle animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.5s ease-out forwards;
}

/* Print styles */
@media print {
  .navbar,
  .footer,
  .btn {
    display: none !important;
  }
  
  .card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
  }
}