/* BusinessPlanner-AI — Base Styles */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #dbeafe;
  --success: #16a34a;
  --success-light: #dcfce7;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #dc2626;
  --danger-light: #fee2e2;
  --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;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1), 0 4px 6px rgba(0,0,0,0.05);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--gray-50);
  color: var(--gray-800);
  line-height: 1.6;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Container */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; }
.container-sm { max-width: 480px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem; border-radius: var(--radius);
  font-size: 0.875rem; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--gray-300); color: var(--gray-700); }
.btn-outline:hover { background: var(--gray-100); }
.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.8rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; }
.btn-block { width: 100%; justify-content: center; }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.375rem; color: var(--gray-700); }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 0.625rem 0.75rem; border: 1px solid var(--gray-300);
  border-radius: var(--radius); font-size: 0.875rem; transition: border-color 0.15s;
  background: #fff; color: var(--gray-800);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-textarea { min-height: 100px; resize: vertical; }
.form-checkbox { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; }
.form-checkbox input { width: 1.125rem; height: 1.125rem; accent-color: var(--primary); }
.form-error { color: var(--danger); font-size: 0.8rem; margin-top: 0.25rem; }
.form-hint { color: var(--gray-500); font-size: 0.8rem; margin-top: 0.25rem; }

/* Card */
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 1.5rem; border: 1px solid var(--gray-200);
}
.card-header { font-size: 1.125rem; font-weight: 600; margin-bottom: 1rem; padding-bottom: 0.75rem; border-bottom: 1px solid var(--gray-200); }

/* Alert */
.alert {
  padding: 0.75rem 1rem; border-radius: var(--radius); font-size: 0.875rem;
  margin-bottom: 1rem;
}
.alert-error { background: var(--danger-light); color: var(--danger); border: 1px solid var(--danger); }
.alert-success { background: var(--success-light); color: var(--success); border: 1px solid var(--success); }
.alert-warning { background: var(--warning-light); color: var(--warning); border: 1px solid var(--warning); }

/* Navbar */
.navbar {
  background: #fff; border-bottom: 1px solid var(--gray-200);
  padding: 0.75rem 0; position: sticky; top: 0; z-index: 100;
}
.navbar .container { display: flex; align-items: center; justify-content: space-between; }
.navbar-brand { font-size: 1.25rem; font-weight: 700; color: var(--gray-900); }
.navbar-brand:hover { text-decoration: none; color: var(--primary); }
.navbar-nav { display: flex; align-items: center; gap: 1rem; }
.navbar-user { font-size: 0.875rem; color: var(--gray-500); }

/* Grid */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }

/* Progress bar */
.progress-bar {
  width: 100%; height: 8px; background: var(--gray-200); border-radius: 4px; overflow: hidden;
}
.progress-fill {
  height: 100%; background: var(--primary); border-radius: 4px; transition: width 0.3s ease;
}

/* Steps */
.steps-nav { display: flex; gap: 0.5rem; overflow-x: auto; padding-bottom: 0.5rem; }
.step-btn {
  white-space: nowrap; padding: 0.5rem 1rem; border-radius: var(--radius);
  font-size: 0.8rem; border: 1px solid var(--gray-200); background: #fff;
  cursor: pointer; transition: all 0.15s; color: var(--gray-600);
}
.step-btn:hover { border-color: var(--primary); color: var(--primary); }
.step-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.step-btn.completed { background: var(--success-light); color: var(--success); border-color: var(--success); }

/* Tip box */
.tip-box {
  background: var(--warning-light); border: 1px solid var(--warning);
  border-radius: var(--radius); padding: 1rem; margin-bottom: 1.5rem;
  font-size: 0.875rem;
}
.tip-box strong { color: var(--warning); }

/* Offer card */
.offer-card {
  border: 2px solid var(--gray-200); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; transition: all 0.2s;
}
.offer-card:hover { border-color: var(--primary); box-shadow: var(--shadow-lg); }
.offer-card.recommended { border-color: var(--primary); background: var(--primary-light); }
.offer-card h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.offer-card .price { font-size: 2rem; font-weight: 700; color: var(--primary); margin: 1rem 0; }
.offer-card .price small { font-size: 0.875rem; font-weight: 400; color: var(--gray-500); }
.offer-card ul { list-style: none; text-align: left; margin: 1rem 0; }
.offer-card ul li { padding: 0.375rem 0; font-size: 0.875rem; }
.offer-card ul li::before { content: '✓'; color: var(--success); font-weight: 700; margin-right: 0.5rem; }

/* Table */
.table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.table th, .table td { padding: 0.75rem; text-align: left; border-bottom: 1px solid var(--gray-200); }
.table th { font-weight: 600; color: var(--gray-600); background: var(--gray-50); }

/* Utility */
.text-center { text-align: center; }
.text-sm { font-size: 0.875rem; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 2rem; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

/* Loading */
.spinner {
  width: 24px; height: 24px; border: 3px solid var(--gray-200);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Chart bars */
.chart-bar-container { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.5rem; }
.chart-bar-label { width: 180px; font-size: 0.8rem; text-align: right; color: var(--gray-600); }
.chart-bar-track { flex: 1; height: 24px; background: var(--gray-100); border-radius: 4px; overflow: hidden; }
.chart-bar-fill { height: 100%; border-radius: 4px; display: flex; align-items: center; padding: 0 0.5rem; font-size: 0.75rem; color: #fff; font-weight: 500; transition: width 0.5s ease; }

/* x-cloak */
[x-cloak] { display: none !important; }
/* Hide alerts by default — Alpine overrides via x-show */
.alert-error, .alert-success { display: none; }
