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

:root {
  /* Primary palette - Professional blue tones */
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;

  /* Semantic colors */
  --success-50: #f0fdf4;
  --success-500: #22c55e;
  --success-600: #16a34a;
  --success-700: #15803d;

  --warning-50: #fffbeb;
  --warning-500: #f59e0b;
  --warning-600: #d97706;
  --warning-700: #b45309;

  --danger-50: #fef2f2;
  --danger-500: #ef4444;
  --danger-600: #dc2626;
  --danger-700: #b91c1c;

  /* 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;

  /* Design tokens */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 300ms ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 20px 16px;
}

/* ========================================
   HEADER
   ======================================== */
header {
  background: linear-gradient(135deg, var(--primary-600) 0%, var(--primary-800) 100%);
  color: white;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-lg);
}

header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
}

header h1 .logo-icon {
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

header .settings-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

header .settings-btn:hover {
  background: rgba(255,255,255,0.25);
}

/* ========================================
   NAVIGATION
   ======================================== */
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  color: var(--primary-600);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 10px 0;
  margin-bottom: 16px;
  transition: var(--transition-fast);
}

.back-btn:hover {
  color: var(--primary-700);
}

.back-btn::before {
  content: '';
  width: 20px;
  height: 20px;
  background: currentColor;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 19l-7-7 7-7'/%3E%3C/svg%3E") center/contain no-repeat;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='currentColor'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 19l-7-7 7-7'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ========================================
   DEVICE BANNER (Boiler/Thermostat)
   ======================================== */
.boiler-banner {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-base);
}

.boiler-banner:hover {
  box-shadow: var(--shadow-md);
}

.boiler-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.boiler-icon {
  width: 44px;
  height: 44px;
  background: var(--primary-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  font-size: 1.3rem;
}

.boiler-info strong {
  display: block;
  font-weight: 600;
  color: var(--gray-800);
}

.boiler-info small {
  color: var(--gray-500);
  font-size: 0.85rem;
}

.btn-small {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  color: var(--gray-700);
  transition: var(--transition-fast);
}

.btn-small:hover {
  background: var(--gray-200);
  border-color: var(--gray-300);
}

/* ========================================
   HOME PAGE
   ======================================== */
.home-subtitle {
  text-align: center;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 28px 0 20px;
  color: var(--gray-800);
  letter-spacing: -0.02em;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 32px;
}

.category-card {
  background: white;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px 14px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-base);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--primary-500);
  transform: scaleX(0);
  transition: var(--transition-base);
}

.category-card:hover {
  border-color: var(--primary-300);
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.category-card:hover::before {
  transform: scaleX(1);
}

.category-card .icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 12px;
  background: var(--primary-50);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  font-size: 1.6rem;
}

.category-card .label {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-800);
}

/* ========================================
   SEARCH SECTION
   ======================================== */
.search-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 24px;
  border: 1px solid var(--gray-100);
}

.search-section h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--gray-800);
}

.search-section p {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input {
  flex: 1;
  padding: 14px 18px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-fast);
  background: var(--gray-50);
}

.search-row input:focus {
  border-color: var(--primary-400);
  background: white;
  box-shadow: 0 0 0 3px var(--primary-100);
}

.search-row input::placeholder {
  color: var(--gray-400);
}

/* ========================================
   BUTTONS
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-600);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-700);
}

.btn-orange {
  background: var(--warning-500);
  color: white;
}

.btn-orange:hover {
  background: var(--warning-600);
}

.btn-danger {
  background: var(--danger-500);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-600);
}

.btn-block {
  width: 100%;
}

/* ========================================
   PROBLEM LIST
   ======================================== */
.problem-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.problem-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition-base);
  border: 1px solid var(--gray-100);
  border-left: 4px solid var(--primary-500);
}

.problem-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-200);
  border-left-color: var(--primary-600);
}

.problem-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-900);
}

.problem-card p {
  font-size: 0.875rem;
  color: var(--gray-500);
  line-height: 1.5;
}

.problem-card .meta {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

/* ========================================
   BADGES
   ======================================== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.badge-easy {
  background: var(--success-50);
  color: var(--success-700);
}

.badge-medium {
  background: var(--warning-50);
  color: var(--warning-700);
}

.badge-hard {
  background: var(--danger-50);
  color: var(--danger-700);
}

/* ========================================
   SOLUTION PAGE
   ======================================== */
.solution-page {
  padding-bottom: 40px;
}

.solution-header {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
  border: 1px solid var(--gray-100);
}

.solution-header h2 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
  color: var(--gray-900);
}

.solution-header .desc {
  color: var(--gray-500);
  margin-bottom: 16px;
  font-size: 0.95rem;
}

.info-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Section cards */
.tools-section,
.steps-section,
.warning-section,
.tip-section,
.ai-help-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  border: 1px solid var(--gray-100);
}

.tools-section h3,
.steps-section h3,
.warning-section h3,
.tip-section h3,
.ai-help-section h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-800);
}

.section-icon {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.tools-section .section-icon {
  background: var(--gray-100);
}

.steps-section .section-icon {
  background: var(--primary-50);
  color: var(--primary-600);
}

.tools-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tools-list li {
  background: var(--gray-100);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  color: var(--gray-700);
  font-weight: 500;
}

/* Steps list */
.steps-list {
  list-style: none;
  counter-reset: steps;
}

.step-item {
  counter-increment: steps;
  padding: 20px 0 20px 56px;
  position: relative;
  border-bottom: 1px solid var(--gray-100);
}

.step-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.step-item::before {
  content: counter(steps);
  position: absolute;
  left: 0;
  top: 20px;
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: var(--shadow-sm);
}

.step-content {
  margin-bottom: 12px;
}

.step-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--gray-700);
}

.step-tip {
  background: var(--warning-50);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  margin-top: 12px;
  color: var(--warning-700);
  border-left: 3px solid var(--warning-500);
}

.ask-ai-btn {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--primary-700);
  font-weight: 600;
  transition: var(--transition-fast);
}

.ask-ai-btn:hover {
  background: var(--primary-100);
  border-color: var(--primary-300);
}

/* Warning section */
.warning-section {
  border-left: 4px solid var(--danger-500);
  background: var(--danger-50);
}

.warning-section h3 {
  color: var(--danger-700);
}

.warning-section .section-icon {
  background: var(--danger-100);
  color: var(--danger-600);
}

/* Tip section */
.tip-section {
  border-left: 4px solid var(--success-500);
  background: var(--success-50);
}

.tip-section h3 {
  color: var(--success-700);
}

.tip-section .section-icon {
  background: var(--success-100);
  color: var(--success-600);
}

/* AI Help section */
.ai-help-section {
  border-left: 4px solid var(--primary-500);
  background: var(--primary-50);
}

.ai-help-section h3 {
  color: var(--primary-700);
}

.ai-help-section .section-icon {
  background: var(--primary-100);
  color: var(--primary-600);
}

/* ========================================
   ERROR CODE RESULT
   ======================================== */
.error-result {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
  border: 1px solid var(--gray-100);
  border-left: 4px solid var(--warning-500);
  position: relative;
}

.error-result.highlighted {
  border: 2px solid var(--primary-400);
  border-left: 4px solid var(--primary-500);
  box-shadow: var(--shadow-lg);
}

.your-brand-badge {
  position: absolute;
  top: -12px;
  right: 20px;
  background: var(--primary-600);
  color: white;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.error-result h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--gray-900);
}

.error-result .brand-code {
  color: var(--gray-500);
  font-size: 0.9rem;
  margin-bottom: 20px;
}

.error-detail {
  margin-bottom: 16px;
}

.error-detail strong {
  display: block;
  font-size: 0.8rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  font-weight: 600;
}

.error-detail p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--gray-700);
}

.call-tech-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.875rem;
  margin-top: 12px;
}

.call-tech-yes {
  background: var(--danger-50);
  color: var(--danger-700);
}

.call-tech-no {
  background: var(--success-50);
  color: var(--success-700);
}

.no-results {
  text-align: center;
  padding: 48px 24px;
  color: var(--gray-500);
}

.no-results .big-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--gray-100);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.no-results h3 {
  color: var(--gray-700);
  margin-bottom: 8px;
}

/* ========================================
   CATEGORY PAGE HEADER
   ======================================== */
.category-header {
  text-align: center;
  margin-bottom: 24px;
}

.category-header .icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  background: var(--primary-50);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-600);
  font-size: 1.8rem;
}

.category-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.02em;
}

/* ========================================
   BOILER/THERMOSTAT SETUP
   ======================================== */
.setup-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
}

.setup-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--gray-900);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--gray-800);
  font-size: 0.95rem;
}

.brand-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.brand-card {
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 18px 10px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-base);
}

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

.brand-card.selected {
  border-color: var(--primary-500);
  background: var(--primary-50);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.brand-logo {
  font-size: 1.6rem;
  display: block;
  margin-bottom: 6px;
}

.brand-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--gray-700);
}

.full-input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-fast);
  background: var(--gray-50);
}

.full-input:focus {
  border-color: var(--primary-400);
  background: white;
  box-shadow: 0 0 0 3px var(--primary-100);
}

.upload-area {
  border: 2px dashed var(--gray-300);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-base);
  color: var(--gray-500);
  background: var(--gray-50);
}

.upload-area:hover {
  border-color: var(--primary-400);
  background: var(--primary-50);
  color: var(--primary-600);
}

.upload-icon {
  font-size: 2rem;
  display: block;
  margin-bottom: 10px;
}

/* Model info card */
.model-info-card {
  background: var(--primary-50);
  border: 2px solid var(--primary-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
}

.model-info-card h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary-800);
  margin-bottom: 16px;
}

.model-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.model-specs .spec {
  background: white;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  box-shadow: var(--shadow-sm);
}

.model-specs .spec strong {
  color: var(--gray-500);
}

.manual-preview {
  background: white;
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}

.manual-preview h4 {
  font-size: 0.95rem;
  color: var(--gray-800);
  margin-bottom: 12px;
  font-weight: 600;
}

.manual-preview ul {
  list-style: none;
  font-size: 0.9rem;
  color: var(--gray-600);
}

.manual-preview li {
  padding: 8px 0;
  border-bottom: 1px solid var(--gray-100);
}

.manual-preview li:last-child {
  border-bottom: none;
}

.manual-preview li strong {
  color: var(--gray-700);
}

.no-manual {
  color: var(--warning-600);
  font-size: 0.9rem;
  font-style: normal;
  background: var(--warning-50);
  padding: 12px 16px;
  border-radius: var(--radius-md);
}

/* Manual tip (in problem page) */
.manual-tip {
  background: var(--primary-50);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--primary-800);
}

.manual-tip strong {
  color: var(--primary-700);
}

/* Current boiler info (settings) */
.current-boiler-info {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* ========================================
   SETTINGS
   ======================================== */
.settings-section {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
}

.settings-section h2 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 24px;
  color: var(--gray-900);
}

/* ========================================
   MODAL
   ======================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 200ms ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.modal-content {
  background: white;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 300ms ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-200);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--gray-900);
}

.close-btn {
  background: var(--gray-100);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray-600);
  transition: var(--transition-fast);
}

.close-btn:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

/* ========================================
   CHAT
   ======================================== */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 200px;
  max-height: 50vh;
}

.chat-message {
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  max-width: 85%;
  font-size: 0.95rem;
  line-height: 1.6;
}

.chat-message.system {
  background: var(--gray-100);
  color: var(--gray-700);
  align-self: center;
  text-align: center;
  max-width: 100%;
  border-radius: var(--radius-md);
}

.chat-message.user {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}

.chat-message.assistant {
  background: var(--gray-100);
  color: var(--gray-800);
  align-self: flex-start;
  border-bottom-left-radius: var(--radius-sm);
}

.chat-message.loading {
  font-style: italic;
  color: var(--gray-500);
}

.chat-input-area {
  display: flex;
  gap: 10px;
  padding: 18px 20px;
  border-top: 1px solid var(--gray-200);
  background: var(--gray-50);
}

.chat-input-area input {
  flex: 1;
  padding: 14px 20px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-full);
  font-size: 0.95rem;
  outline: none;
  background: white;
  transition: var(--transition-fast);
}

.chat-input-area input:focus {
  border-color: var(--primary-400);
  box-shadow: 0 0 0 3px var(--primary-100);
}

.chat-input-area .btn {
  border-radius: var(--radius-full);
  padding: 14px 28px;
}

/* ========================================
   FOOTER
   ======================================== */
footer {
  text-align: center;
  padding: 28px 20px;
  color: var(--gray-500);
  font-size: 0.85rem;
}

footer p {
  background: var(--warning-50);
  padding: 14px 20px;
  border-radius: var(--radius-md);
  color: var(--warning-700);
  border: 1px solid var(--warning-200);
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 480px) {
  .container {
    padding: 16px 12px;
  }

  .category-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }

  .category-card {
    padding: 20px 10px;
  }

  .category-card .icon {
    width: 48px;
    height: 48px;
    font-size: 1.4rem;
  }

  .category-card .label {
    font-size: 0.85rem;
  }

  .search-row {
    flex-direction: column;
  }

  .search-row .btn {
    width: 100%;
  }

  header h1 {
    font-size: 1.1rem;
  }

  .brand-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .step-item {
    padding-left: 50px;
  }

  .modal-content {
    max-height: 90vh;
  }

  .chat-messages {
    max-height: 60vh;
  }

  .solution-header,
  .setup-section,
  .settings-section {
    padding: 20px;
  }
}

@media (min-width: 600px) {
  .modal {
    align-items: center;
  }

  .modal-content {
    border-radius: var(--radius-xl);
    max-height: 70vh;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-muted {
  color: var(--gray-500);
}

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

.text-success {
  color: var(--success-600);
}

.text-warning {
  color: var(--warning-600);
}

.text-danger {
  color: var(--danger-600);
}

.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }

.mb-1 { margin-bottom: 4px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* ========================================
   HEADER ACTIONS (Credits + Settings)
   ======================================== */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.credits-display {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  color: white;
  font-weight: 600;
  font-size: 0.9rem;
}

.credits-display:hover {
  background: rgba(255, 255, 255, 0.25);
}

.credits-display svg {
  opacity: 0.8;
}

/* ========================================
   CREDITS MODAL
   ======================================== */
.credits-modal {
  max-width: 420px;
}

.credits-modal.small {
  max-width: 360px;
}

.credits-modal-body {
  padding: 24px;
}

.credits-intro {
  text-align: center;
  color: var(--gray-600);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

.packages-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.package-card {
  background: var(--gray-50);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  transition: var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

.package-card:hover {
  border-color: var(--primary-400);
  background: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.package-card.popular {
  border-color: var(--primary-500);
  background: var(--primary-50);
}

.package-card.popular:hover {
  border-color: var(--primary-600);
  background: var(--primary-100);
}

.package-badge {
  position: absolute;
  top: -10px;
  right: 16px;
  background: var(--primary-600);
  color: white;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.package-badge.best-value {
  background: var(--success-600);
}

.package-credits {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--gray-800);
}

.package-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-600);
}

.package-savings {
  position: absolute;
  bottom: 6px;
  right: 16px;
  font-size: 0.75rem;
  color: var(--success-600);
  font-weight: 600;
}

.secure-payment {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gray-500);
  font-size: 0.85rem;
  margin-bottom: 16px;
}

.secure-payment svg {
  color: var(--success-600);
}

.payment-methods {
  text-align: center;
  font-size: 0.8rem;
  color: var(--gray-400);
}

.payment-methods span {
  margin-right: 8px;
}

.payment-icons {
  display: inline-flex;
  gap: 8px;
  margin-top: 6px;
}

.payment-icon {
  background: var(--gray-100);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--gray-600);
}

/* No Credits Modal */
.no-credits-icon {
  text-align: center;
  margin-bottom: 16px;
  color: var(--warning-500);
}

.no-credits-icon svg {
  opacity: 0.8;
}

#no-credits-modal .credits-modal-body {
  text-align: center;
}

#no-credits-modal p {
  margin-bottom: 12px;
}

/* ========================================
   LOADING OVERLAY
   ======================================== */
#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.loading-content {
  background: white;
  padding: 32px 48px;
  border-radius: var(--radius-xl);
  text-align: center;
  box-shadow: var(--shadow-xl);
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--gray-200);
  border-top-color: var(--primary-600);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

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

.loading-content p {
  color: var(--gray-600);
  font-size: 0.95rem;
  font-weight: 500;
}

/* ========================================
   AUTH BUTTON & USER MENU
   ======================================== */
.auth-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition-fast);
}

.auth-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}

.auth-btn .user-email {
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* User Menu Dropdown */
.user-menu {
  position: fixed;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  min-width: 200px;
  z-index: 1001;
  overflow: hidden;
  animation: fadeIn 150ms ease;
}

.user-menu-header {
  padding: 14px 18px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  font-size: 0.85rem;
  color: var(--gray-600);
  font-weight: 500;
  word-break: break-all;
}

.user-menu-items {
  padding: 8px;
}

.user-menu-items button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: none;
  border: none;
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition-fast);
  text-align: left;
}

.user-menu-items button:hover {
  background: var(--gray-100);
  color: var(--gray-900);
}

.user-menu-items button svg {
  color: var(--gray-500);
}

/* ========================================
   AUTH MODAL
   ======================================== */
.auth-modal {
  max-width: 400px;
}

.auth-modal-body {
  padding: 24px;
}

.auth-intro {
  text-align: center;
  color: var(--gray-600);
  margin-bottom: 24px;
  font-size: 0.95rem;
}

/* Google Button */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 20px;
  background: white;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: var(--transition-fast);
}

.btn-google:hover {
  background: var(--gray-50);
  border-color: var(--gray-400);
  box-shadow: var(--shadow-sm);
}

.btn-google svg {
  width: 18px;
  height: 18px;
}

/* Auth Divider */
.auth-divider {
  display: flex;
  align-items: center;
  margin: 24px 0;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--gray-200);
}

.auth-divider span {
  padding: 0 16px;
  color: var(--gray-400);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Auth Form */
#login-form .form-group,
#register-form .form-group {
  margin-bottom: 16px;
}

#login-form input,
#register-form input {
  width: 100%;
  padding: 14px 18px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  font-size: 1rem;
  outline: none;
  transition: var(--transition-fast);
  background: var(--gray-50);
}

#login-form input:focus,
#register-form input:focus {
  border-color: var(--primary-400);
  background: white;
  box-shadow: 0 0 0 3px var(--primary-100);
}

#login-form input::placeholder,
#register-form input::placeholder {
  color: var(--gray-400);
}

/* Auth Switch Link */
.auth-switch {
  text-align: center;
  margin-top: 20px;
  color: var(--gray-500);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--primary-600);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.auth-switch a:hover {
  text-decoration: underline;
}

/* ========================================
   RELATED GUIDES (Error -> Guide Mapping)
   ======================================== */
.related-guides {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-200);
}

.related-guides h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.related-guides h4::before {
  content: '';
  width: 3px;
  height: 14px;
  background: var(--primary-500);
  border-radius: 2px;
}

.related-guides-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-guide-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  transition: var(--transition-fast);
}

.related-guide-card:hover {
  background: var(--primary-50);
  border-color: var(--primary-300);
  transform: translateX(4px);
}

.related-guide-card .guide-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: white;
  border-radius: var(--radius-sm);
  color: var(--primary-600);
  flex-shrink: 0;
}

.related-guide-card .guide-icon svg {
  width: 20px;
  height: 20px;
}

.related-guide-card .guide-info {
  flex: 1;
  min-width: 0;
}

.related-guide-card .guide-title {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--gray-800);
  margin-bottom: 2px;
}

.related-guide-card .guide-difficulty {
  display: inline-block;
}

.related-guide-card .guide-difficulty .badge {
  font-size: 0.7rem;
  padding: 2px 6px;
}

.related-guide-card .arrow-icon {
  color: var(--gray-400);
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.related-guide-card:hover .arrow-icon {
  color: var(--primary-500);
  transform: translateX(2px);
}

/* Error actions */
.error-actions {
  margin-top: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.error-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.error-actions .btn svg {
  width: 16px;
  height: 16px;
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border: 1px solid var(--gray-300);
}

.btn-secondary:hover {
  background: var(--gray-200);
  border-color: var(--gray-400);
}

/* Suggested guides in no-results */
.suggested-guides {
  text-align: left;
  margin-top: 16px;
}

.suggested-guides .related-guides {
  margin-top: 8px;
  padding-top: 0;
  border-top: none;
}

.no-results .btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.no-results .btn-primary svg {
  width: 16px;
  height: 16px;
}

/* ========================================
   ANIMATIONS - Fade In Effects
   ======================================== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes checkmark {
  0% { transform: scale(0); }
  50% { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* Apply fade-in to main sections */
.solution-header {
  animation: fadeInUp 0.4s ease-out;
}

.tools-section {
  animation: fadeInUp 0.4s ease-out 0.05s both;
}

.steps-section {
  animation: fadeInUp 0.4s ease-out 0.1s both;
}

.warning-section {
  animation: fadeInUp 0.4s ease-out 0.15s both;
}

.tip-section {
  animation: fadeInUp 0.4s ease-out 0.2s both;
}

.ai-help-section {
  animation: fadeInUp 0.4s ease-out 0.25s both;
}

/* Category cards fade in */
.category-card {
  animation: fadeInUp 0.35s ease-out both;
}

.category-card:nth-child(1) { animation-delay: 0s; }
.category-card:nth-child(2) { animation-delay: 0.05s; }
.category-card:nth-child(3) { animation-delay: 0.1s; }
.category-card:nth-child(4) { animation-delay: 0.15s; }
.category-card:nth-child(5) { animation-delay: 0.2s; }
.category-card:nth-child(6) { animation-delay: 0.25s; }

/* Problem cards fade in */
.problem-card {
  animation: fadeInUp 0.35s ease-out both;
}

.problem-card:nth-child(1) { animation-delay: 0s; }
.problem-card:nth-child(2) { animation-delay: 0.04s; }
.problem-card:nth-child(3) { animation-delay: 0.08s; }
.problem-card:nth-child(4) { animation-delay: 0.12s; }
.problem-card:nth-child(5) { animation-delay: 0.16s; }
.problem-card:nth-child(6) { animation-delay: 0.2s; }

/* Step items staggered animation */
.step-item {
  animation: slideInRight 0.35s ease-out both;
}

.step-item:nth-child(1) { animation-delay: 0.1s; }
.step-item:nth-child(2) { animation-delay: 0.15s; }
.step-item:nth-child(3) { animation-delay: 0.2s; }
.step-item:nth-child(4) { animation-delay: 0.25s; }
.step-item:nth-child(5) { animation-delay: 0.3s; }
.step-item:nth-child(6) { animation-delay: 0.35s; }
.step-item:nth-child(7) { animation-delay: 0.4s; }
.step-item:nth-child(8) { animation-delay: 0.45s; }

/* ========================================
   ENHANCED STEP ITEMS - Interactive Checkboxes
   ======================================== */
.step-item {
  cursor: pointer;
  transition: var(--transition-base);
}

.step-item:hover {
  background: var(--gray-50);
  border-radius: var(--radius-md);
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 64px;
  padding-right: 8px;
}

.step-item.completed {
  opacity: 0.7;
}

.step-item.completed .step-text {
  text-decoration: line-through;
  color: var(--gray-400);
}

.step-item.completed::before {
  background: linear-gradient(135deg, var(--success-500) 0%, var(--success-600) 100%);
  content: '✓';
}

.step-item.completed::before {
  animation: checkmark 0.3s ease-out;
}

/* Current step - highlighted and clickable */
.step-item.current {
  background: var(--primary-50);
  border-radius: var(--radius-md);
  margin-left: -8px;
  margin-right: -8px;
  padding-left: 64px;
  padding-right: 8px;
  border-left: 3px solid var(--primary-500);
}

.step-item.current::before {
  background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 100%);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

/* Locked steps - not yet available */
.step-item.locked {
  opacity: 0.5;
  cursor: not-allowed !important;
}

.step-item.locked:hover {
  background: transparent;
  margin-left: 0;
  margin-right: 0;
  padding-left: 56px;
  padding-right: 0;
}

.step-item.locked::before {
  background: var(--gray-300);
}

/* Step number enhanced styling */
.step-item::before {
  transition: var(--transition-base);
}

.step-item:hover:not(.locked)::before {
  transform: scale(1.1);
  box-shadow: var(--shadow-md);
}

/* ========================================
   PROGRESS BAR FOR STEPS
   ======================================== */
.steps-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--gray-50);
  border-radius: var(--radius-md);
}

.progress-bar {
  flex: 1;
  height: 8px;
  background: var(--gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-600));
  border-radius: var(--radius-full);
  transition: width 0.4s ease-out;
}

.progress-text {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gray-600);
  min-width: 60px;
  text-align: right;
}

/* ========================================
   ENHANCED HOVER EFFECTS
   ======================================== */
/* Category cards */
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.category-card:active {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Problem cards enhanced */
.problem-card:hover {
  transform: translateX(6px);
}

.problem-card:active {
  transform: translateX(3px);
}

/* Buttons pulse on hover */
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

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

/* Ask AI button enhanced */
.ask-ai-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

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

/* Tools list items hover */
.tools-list li {
  transition: var(--transition-fast);
  cursor: default;
}

.tools-list li:hover {
  background: var(--primary-50);
  color: var(--primary-700);
  transform: scale(1.02);
}

/* ========================================
   ENHANCED SECTION HEADERS
   ======================================== */
.section-icon {
  transition: var(--transition-fast);
}

.tools-section:hover .section-icon,
.steps-section:hover .section-icon,
.warning-section:hover .section-icon,
.tip-section:hover .section-icon,
.ai-help-section:hover .section-icon {
  transform: scale(1.1);
}

/* ========================================
   ENHANCED STEP TIP STYLING
   ======================================== */
.step-tip {
  position: relative;
  animation: fadeIn 0.3s ease-out;
}

.step-tip::before {
  content: '💡';
  position: absolute;
  left: -8px;
  top: -8px;
  font-size: 1rem;
  background: white;
  padding: 2px;
  border-radius: var(--radius-full);
}

/* ========================================
   MANUAL TIP ENHANCED
   ======================================== */
.manual-tip {
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
  border: 1px solid var(--primary-200);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-top: 16px;
  font-size: 0.9rem;
  color: var(--primary-800);
  animation: fadeInUp 0.4s ease-out;
  position: relative;
  padding-left: 44px;
}

.manual-tip::before {
  content: '📖';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
}

/* ========================================
   ERROR RESULT ENHANCED ANIMATIONS
   ======================================== */
.error-result {
  animation: fadeInUp 0.4s ease-out;
}

.error-result:nth-child(1) { animation-delay: 0s; }
.error-result:nth-child(2) { animation-delay: 0.08s; }
.error-result:nth-child(3) { animation-delay: 0.16s; }
.error-result:nth-child(4) { animation-delay: 0.24s; }

.error-result:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* Related guide cards enhanced */
.related-guide-card {
  animation: fadeIn 0.3s ease-out;
}

.related-guide-card:hover {
  transform: translateX(6px);
  box-shadow: var(--shadow-sm);
}

/* ========================================
   LOADING STATES
   ======================================== */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.loading-skeleton {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ========================================
   MODAL ANIMATIONS
   ======================================== */
.modal {
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  animation: fadeInUp 0.3s ease-out;
}

/* ========================================
   BOILER SELECTOR ENHANCED
   ======================================== */
.model-btn {
  transition: var(--transition-fast);
}

.model-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

/* ========================================
   CREDITS DISPLAY ENHANCED
   ======================================== */
.credits-display {
  transition: var(--transition-fast);
}

.credits-display:hover {
  transform: scale(1.05);
}

/* ========================================
   SCROLLBAR STYLING
   ======================================== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--gray-100);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}

/* ========================================
   FOCUS STATES FOR ACCESSIBILITY
   ======================================== */
.btn:focus-visible,
.category-card:focus-visible,
.problem-card:focus-visible,
.step-item:focus-visible {
  outline: 2px solid var(--primary-500);
  outline-offset: 2px;
}

/* ========================================
   ONBOARDING
   ======================================== */
.onboarding-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--gray-50) 100%);
}

.onboarding-content {
  max-width: 400px;
  width: 100%;
  text-align: center;
  animation: fadeInUp 0.5s ease-out;
}

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

.onboarding-icon {
  width: 100px;
  height: 100px;
  margin: 0 auto 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
  border-radius: 50%;
  color: white;
  box-shadow: 0 10px 40px rgba(37, 99, 235, 0.3);
}

.onboarding-icon svg {
  width: 48px;
  height: 48px;
}

.onboarding-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 12px;
  line-height: 1.2;
}

.onboarding-description {
  font-size: 1rem;
  color: var(--gray-600);
  line-height: 1.6;
  margin-bottom: 32px;
}

.onboarding-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
}

.onboarding-dots .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gray-300);
  cursor: pointer;
  transition: all 0.2s ease;
}

.onboarding-dots .dot.active {
  background: var(--primary-500);
  transform: scale(1.2);
}

.onboarding-dots .dot:hover:not(.active) {
  background: var(--gray-400);
}

.onboarding-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.onboarding-actions .btn {
  min-width: 120px;
  padding: 14px 28px;
  font-size: 1rem;
}

.onboarding-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.onboarding-skip {
  background: none;
  border: none;
  color: var(--gray-500);
  font-size: 14px;
  cursor: pointer;
  padding: 8px 16px;
  text-decoration: underline;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.onboarding-skip:hover {
  opacity: 1;
  color: var(--gray-700);
}

.onboarding-dontshow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--gray-500);
  font-size: 0.875rem;
  cursor: pointer;
  padding: 8px;
}

.onboarding-dontshow input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-500);
}

.onboarding-dontshow span {
  user-select: none;
}

.onboarding-dontshow:hover {
  color: var(--gray-700);
}

/* ========================================
   TOAST NOTIFICATIONS
   ======================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: white;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  max-width: 360px;
  pointer-events: auto;
  animation: toastSlideIn 0.3s ease-out;
  border-left: 4px solid var(--gray-400);
}

.toast.toast-success {
  border-left-color: var(--success-500);
  background: var(--success-50);
}

.toast.toast-error {
  border-left-color: var(--danger-500);
  background: var(--danger-50);
}

.toast.toast-warning {
  border-left-color: var(--warning-500);
  background: var(--warning-50);
}

.toast.toast-info {
  border-left-color: var(--primary-500);
  background: var(--primary-50);
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
}

.toast-success .toast-icon { color: var(--success-600); }
.toast-error .toast-icon { color: var(--danger-600); }
.toast-warning .toast-icon { color: var(--warning-600); }
.toast-info .toast-icon { color: var(--primary-600); }

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-900);
  margin-bottom: 2px;
}

.toast-message {
  font-size: 0.85rem;
  color: var(--gray-600);
  line-height: 1.4;
}

.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--gray-400);
  transition: color 0.2s;
}

.toast-close:hover {
  color: var(--gray-600);
}

.toast.toast-exit {
  animation: toastSlideOut 0.2s ease-in forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100%);
  }
}

@media (max-width: 480px) {
  .toast-container {
    top: auto;
    bottom: 20px;
    right: 10px;
    left: 10px;
  }

  .toast {
    max-width: 100%;
  }

  @keyframes toastSlideIn {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes toastSlideOut {
    from {
      opacity: 1;
      transform: translateY(0);
    }
    to {
      opacity: 0;
      transform: translateY(100%);
    }
  }
}

/* ========================================
   QUICK QUESTION BOX (Homepage)
   ======================================== */
.quick-question-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(135deg, var(--primary-50) 0%, var(--primary-100) 100%);
  border: 2px solid var(--primary-200);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 24px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.quick-question-box:hover {
  border-color: var(--primary-400);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.15);
}

.quick-question-icon {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  background: var(--primary-500);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.quick-question-content {
  flex: 1;
}

.quick-question-content strong {
  display: block;
  font-size: 1.1rem;
  color: var(--gray-900);
  margin-bottom: 4px;
}

.quick-question-content small {
  color: var(--gray-600);
  font-size: 0.9rem;
}

.quick-question-arrow {
  flex-shrink: 0;
  color: var(--primary-500);
}

/* ========================================
   QUICK CHAT PAGE
   ======================================== */
.quick-chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 70px);
  padding-bottom: 0 !important;
}

.quick-chat-header {
  text-align: center;
  padding: 16px 0;
}

.quick-chat-header h2 {
  margin: 0 0 8px 0;
  font-size: 1.5rem;
}

.quick-chat-header p {
  color: var(--gray-600);
  margin: 0;
}

.quick-chat-devices {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.device-tag {
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: 20px;
  padding: 6px 12px;
  font-size: 0.85rem;
  color: var(--gray-700);
}

.quick-chat-warning {
  display: flex;
  gap: 12px;
  background: var(--warning-50);
  border: 1px solid var(--warning-200);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
}

.warning-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.warning-content strong {
  display: block;
  color: var(--warning-700);
  margin-bottom: 4px;
}

.warning-content p {
  color: var(--warning-600);
  font-size: 0.9rem;
  margin: 0 0 12px 0;
}

.warning-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.warning-actions .btn {
  font-size: 0.85rem;
  padding: 8px 12px;
}

.quick-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.quick-chat-input-area {
  border-top: 1px solid var(--gray-200);
  padding: 12px 0 20px;
  background: var(--gray-50);
  margin: 0 -20px;
  padding-left: 20px;
  padding-right: 20px;
}

.credits-info {
  text-align: center;
  margin-bottom: 8px;
  font-size: 0.8rem;
  color: var(--gray-500);
}

.quick-chat-input {
  display: flex;
  gap: 8px;
}

.quick-chat-input input {
  flex: 1;
  padding: 14px 16px;
  border: 2px solid var(--gray-200);
  border-radius: 12px;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.quick-chat-input input:focus {
  outline: none;
  border-color: var(--primary-400);
}

.quick-chat-input .btn {
  padding: 14px 18px;
  border-radius: 12px;
}

/* ========================================
   COOKIE BANNER
   ======================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gray-900);
  color: white;
  padding: 16px 20px;
  z-index: 9999;
  display: flex;
  justify-content: center;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.cookie-content {
  max-width: 800px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cookie-content p {
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--gray-300);
}

.cookie-content a {
  color: var(--primary-400);
  text-decoration: none;
}

.cookie-content a:hover {
  text-decoration: underline;
}

.cookie-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.cookie-btn {
  padding: 10px 20px;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  border: none;
  transition: var(--transition-fast);
}

.cookie-btn.accept {
  background: var(--primary-500);
  color: white;
}

.cookie-btn.accept:hover {
  background: var(--primary-600);
}

.cookie-btn.reject {
  background: transparent;
  color: var(--gray-300);
  border: 1px solid var(--gray-600);
}

.cookie-btn.reject:hover {
  background: var(--gray-800);
}

@media (min-width: 600px) {
  .cookie-content {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .cookie-buttons {
    flex-shrink: 0;
  }
}

/* ========================================
   FOOTER LEGALE
   ======================================== */
.legal-footer {
  text-align: center;
  padding: 20px;
  margin-top: 40px;
  border-top: 1px solid var(--gray-200);
  color: var(--gray-500);
  font-size: 0.85rem;
}

.legal-footer a {
  color: var(--gray-600);
  text-decoration: none;
  margin: 0 8px;
}

.legal-footer a:hover {
  color: var(--primary-600);
  text-decoration: underline;
}

.legal-footer .separator {
  color: var(--gray-300);
}

/* ========================================
   REDUCED MOTION PREFERENCE
   ======================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
