/* ============================================================
   marketplace.css — Marketplace-specific components
   Supplements brand.css with components specific to the Django app
   ============================================================ */

/* ---------- Form inputs ---------- */
.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-family: 'Manrope', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}
.input-field:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.input-field::placeholder { color: var(--faint); }
.input-field.error {
  border-color: #DC2626;
}
.input-field.error:focus {
  box-shadow: 0 0 0 3px rgba(220,38,38,.12);
}

/* ---------- Badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge-gray  { background: var(--bg); color: var(--muted); border: 1px solid var(--line); }
.badge-green { background: var(--emerald-tint); color: var(--emerald); border: 1px solid #C4E6D8; }
.badge-blue  { background: var(--brand-tint); color: var(--brand-ink); border: 1px solid var(--brand-tint-2); }
.badge-yellow { background: #FEF3C7; color: #92400E; border: 1px solid #FDE68A; }
.badge-red   { background: #FEE2E2; color: #991B1B; border: 1px solid #FECACA; }

/* ---------- Search bar ---------- */
.search-bar {
  border: 2px solid var(--brand);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 16px;
  width: 100%;
  font-family: 'Manrope', sans-serif;
  color: var(--ink);
  background: var(--surface);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  box-shadow: 0 0 0 4px var(--brand-tint);
}
.search-bar:focus { border-color: var(--brand-strong); }
.search-bar::placeholder { color: var(--faint); }

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--brand); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb .sep { color: var(--faint); }

/* ---------- Pagination ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 32px;
}
.pagination .page-info {
  font-size: 14px;
  color: var(--muted);
}

/* ---------- Price display ---------- */
.price-tag {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 28px;
  color: var(--ink);
}
.price-tag .interval {
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
}
.price-free {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--emerald-tint);
  color: var(--emerald);
  font-weight: 600;
  font-size: 14px;
}

/* ---------- Detail page grid ---------- */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 28px;
}
@media (max-width: 860px) {
  .detail-grid { grid-template-columns: 1fr; }
}

/* ---------- Prose (content text) ---------- */
.prose { color: var(--body); line-height: 1.7; font-size: 16px; }
.prose p { margin-bottom: 16px; }
.prose h2 { font-size: 22px; font-weight: 700; color: var(--ink); margin: 28px 0 12px; }
.prose h3 { font-size: 18px; font-weight: 700; color: var(--ink); margin: 22px 0 10px; }
.prose ul, .prose ol { margin-bottom: 16px; padding-left: 24px; }
.prose li { margin-bottom: 6px; }
.prose code { font-family: 'JetBrains Mono', monospace; font-size: 14px; background: var(--bg); padding: 2px 6px; border-radius: 4px; }

/* ---------- Alerts ---------- */
.alert {
  padding: 14px 18px;
  border-radius: var(--r-md);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-success { background: var(--emerald-tint); color: var(--emerald); }
.alert-error   { background: #FEE2E2; color: #991B1B; }
.alert-info    { background: var(--brand-tint); color: var(--brand-ink); }

/* ---------- Button extensions ---------- */
.btn-block { width: 100%; justify-content: center; }
.btn-danger {
  background: #FEE2E2;
  color: #991B1B;
  border: 1px solid #FECACA;
}
.btn-danger:hover {
  background: #FECACA;
}

/* ---------- Card padding utility ---------- */
.card-body { padding: 28px 30px; }
.card-body-sm { padding: 20px 22px; }

/* ---------- Stat card ---------- */
.stat-card {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px;
  text-align: center;
  background: var(--surface);
}
.stat-card .stat-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 22px;
  color: var(--ink);
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ---------- Sync messages ---------- */
.sync-message-success {
  background: var(--emerald-tint);
  color: var(--emerald);
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
}
.sync-message-error {
  background: #FEE2E2;
  color: #991B1B;
  border-radius: var(--r-md);
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
}

/* ---------- Home page JS state classes ---------- */
.hidden { display: none !important; }

@keyframes spin {
  to { transform: rotate(360deg); }
}
.animate-spin { animation: spin 1s linear infinite; }

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

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-content { animation: fadeIn 0.3s ease-out; }

.step-active {
  color: var(--brand) !important;
  font-weight: 600;
}
.step-active .step-icon {
  animation: pulse 2s ease-in-out infinite;
  color: var(--brand);
}
.step-complete {
  color: var(--emerald) !important;
}
.step-complete .step-icon {
  color: var(--emerald);
}

.option-card {
  cursor: pointer;
  transition: all 0.2s ease;
  border: 2px solid var(--line);
  background: var(--surface);
  border-radius: var(--r-md);
  padding: 16px;
}
.option-card:hover {
  border-color: var(--faint);
  background: var(--bg);
}
.option-card.selected {
  border-color: var(--brand);
  background: var(--brand-tint);
}
.option-card .checkmark {
  opacity: 0;
  transition: opacity 0.2s ease;
}
.option-card.selected .checkmark {
  opacity: 1;
}

/* ---------- Modal overlay ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  padding: 32px;
  max-width: 480px;
  width: 100%;
  margin: 16px;
}
.modal-box-lg { max-width: 560px; }

/* ---------- Flex / grid utilities ---------- */
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.gap-sm { gap: 12px; }
.gap-md { gap: 18px; }
.gap-lg { gap: 24px; }
.text-center { text-align: center; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12.5px; }
.text-muted { color: var(--muted); }
.text-ink { color: var(--ink); }
.text-body { color: var(--body); }
.text-brand { color: var(--brand); }
.text-emerald { color: var(--emerald); }
.text-red { color: #991B1B; }
.font-bold { font-weight: 700; }
.font-semi { font-weight: 600; }
.mt-sm { margin-top: 12px; }
.mt-md { margin-top: 24px; }
.mt-lg { margin-top: 40px; }
.mb-sm { margin-top: 12px; }
.mb-md { margin-bottom: 24px; }
.mb-lg { margin-bottom: 40px; }
.w-full { width: 100%; }

/* ---------- Grid layouts ---------- */
.grid-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 22px; }
.grid-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
@media (max-width: 860px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ---------- Card list (stacked cards with gap) ---------- */
.card-list { display: grid; gap: 18px; }

/* ---------- Info box (green confirmation) ---------- */
.info-box {
  border-radius: var(--r-md);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.info-box svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.info-box-green {
  background: var(--emerald-tint);
  border: 1px solid #C4E6D8;
}
.info-box-blue {
  background: var(--brand-tint);
  border: 1px solid var(--brand-tint-2);
}
.info-box-red {
  background: #FEE2E2;
  border: 1px solid #FECACA;
}

/* ---------- Section utilities ---------- */
.section-sm { padding: 56px 0; }
.page-header {
  margin-bottom: 32px;
}
.page-header h1 {
  margin-bottom: 8px;
}
.page-header p {
  color: var(--muted);
  font-size: 16px;
}

/* ---------- Review stars ---------- */
.stars { color: var(--amber); letter-spacing: 1px; }

/* ---------- Empty state ---------- */
.empty-state {
  text-align: center;
  padding: 56px 24px;
}
.empty-state svg {
  width: 48px;
  height: 48px;
  color: var(--faint);
  margin: 0 auto 18px;
}
.empty-state h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--muted);
  font-size: 15px;
  margin-bottom: 24px;
}

/* ---------- Spinner ---------- */
.spinner-ring {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 3px solid var(--line);
  border-top-color: var(--brand);
  animation: spin 1s linear infinite;
}

/* ---------- Progress bar ---------- */
.progress-bar-track {
  background: var(--line-soft);
  border-radius: var(--r-pill);
  height: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--brand);
  transition: width .5s ease;
}

/* ---------- Step list (loading modal) ---------- */
.step-list { display: grid; gap: 12px; }
.step-item {
  display: flex;
  align-items: center;
  color: var(--faint);
  font-size: 14px;
}
.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-right: 12px;
  font-weight: bold;
  font-size: 16px;
  transition: all 0.3s ease;
}
