/* app.css — Mobile-first styles for PrixCI app pages. Extends theme.css tokens. */
:root {
  --bg: #FFF8F0;
  --cream: #FFF8F0;
  --text: #1A0F0A;
  --accent: #C8622A;
  --amber: #E8A84C;
  --green: #2D5016;
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100dvh;
}

::selection {
  background: rgba(200, 98, 42, 0.2);
}

::-webkit-scrollbar { width: 0; }
img { max-width: 100%; display: block; }
a { text-decoration: none; }
section { overflow: hidden; }

.tab-section { min-height: calc(100dvh - 120px); }

/* Price card */
.price-card {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(232,168,76,0.2);
  padding: 14px;
  position: relative;
}

.price-badge-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #2D5016;
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.price-badge-pending {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--amber);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.confirm-progress {
  display: flex;
  gap: 4px;
  margin-top: 6px;
}

.confirm-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5e7eb;
}

.confirm-dot.filled {
  background: var(--accent);
}

.confirm-dot.filled.green {
  background: var(--green);
}

.distance-tag {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
}

.btn-confirm {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-confirm:disabled {
  background: #9ca3af;
  cursor: default;
}

.btn-confirm.verified {
  background: var(--green);
}

/* Upload area */
#upload-area.drag-over {
  border-color: var(--accent);
  background: rgba(200,98,42,0.05);
}

/* Splash screen */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
}

.splash-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
}

.logo-box {
  width: 80px;
  height: 80px;
  background: var(--green);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(45,80,22,0.3);
}

.home-title {
  font-family: 'Playfair Display', serif;
  font-weight: 900;
  font-size: 2.5rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}

.home-subtitle {
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  color: #6b7280;
  font-style: italic;
  margin-bottom: 2rem;
}

.btn-start {
  width: 100%;
  max-width: 280px;
  background: var(--accent);
  color: white;
  font-weight: 700;
  font-size: 1rem;
  padding: 1rem;
  border-radius: 16px;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
}

.btn-start:hover {
  background: #b55626;
  transform: translateY(-1px);
}

/* Popular products grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.product-card {
  background: white;
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  border: 1px solid rgba(232,168,76,0.15);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
}

.product-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.product-img-placeholder {
  width: 60px;
  height: 60px;
  border-radius: 10px;
  background: rgba(232,168,76,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.5rem;
  font-size: 1.5rem;
  font-bold: bold;
  color: var(--accent);
}

.product-name-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
}

/* Store list */
.store-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.store-row {
  background: white;
  border-radius: 16px;
  border: 1px solid rgba(232,168,76,0.2);
  padding: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.store-row.best-price {
  border-left: 4px solid var(--green);
  background: rgba(45,80,22,0.05);
}

.store-logo-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: white;
  flex-shrink: 0;
}

.store-info {
  flex: 1;
}

.store-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}

.store-quartier {
  font-size: 0.75rem;
  color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 99px;
  display: inline-block;
  margin-top: 2px;
}

.store-price {
  text-align: right;
}

.store-price-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent);
}

.store-price-unit {
  font-size: 0.7rem;
  color: #9ca3af;
}

.best-price-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--green);
  color: white;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 99px;
  margin-top: 4px;
}

/* Map placeholder */
.map-placeholder {
  height: 50vh;
  background: #f3f4f6;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(232,168,76,0.15);
}

.map-pin {
  display: flex;
  align-items: center;
  gap: 10px;
  background: white;
  border-radius: 12px;
  padding: 10px 14px;
  border: 1px solid rgba(232,168,76,0.2);
}

.map-pin-price {
  font-weight: 700;
  color: var(--accent);
}

.map-pin-name {
  font-size: 0.85rem;
  color: var(--text);
}

.best-price-card {
  background: rgba(45,80,22,0.08);
  border-radius: 12px;
  padding: 14px;
  border-left: 4px solid var(--green);
}

/* Profile stats */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}

.stat-card {
  background: white;
  border-radius: 12px;
  padding: 0.75rem 0.5rem;
  text-align: center;
  border: 1px solid rgba(232,168,76,0.15);
}

.text-green { color: var(--green); }


/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  display: inline-block;
}

/* ── Semantic utility classes (replaces Tailwind CDN) ─────────────────────── */

.app-body { background: var(--bg); color: var(--text); font-family: 'DM Sans', sans-serif; min-height: 100dvh; }
.app-main { padding-bottom: 80px; }
.app-padded { padding: 1rem 1rem 0; }
.app-section-title { font-size: 1.25rem; font-weight: 700; margin-bottom: 1rem; }
.app-text-sm { font-size: 0.875rem; }
.app-text-xs { font-size: 0.75rem; }
.app-text-muted { color: #6b7280; }
.app-text-faint { color: #9ca3af; }
.app-text-accent { color: var(--accent); }
.app-text-green { color: var(--green); }
.app-text-amber { color: var(--amber); }
.app-text-amber-mid { color: rgba(232,168,76,0.5); }
.app-font-bold { font-weight: 700; }
.app-font-semibold { font-weight: 600; }
.app-font-xl { font-size: 1.25rem; }
.app-font-mono { font-family: monospace; }
.app-text-center { text-align: center; }
.app-py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.app-mb-1 { margin-bottom: 0.25rem; }
.app-mb-4 { margin-bottom: 1rem; }
.app-mb-6 { margin-bottom: 1.5rem; }
.app-mt-2 { margin-top: 0.5rem; }
.app-label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; }
.app-label-muted { font-size: 0.75rem; font-weight: 600; color: #6b7280; margin-bottom: 0.75rem; }
.app-space-y > * + * { margin-top: 0.75rem; }
.app-empty-state { text-align: center; padding: 2.5rem 0; color: #9ca3af; }
.app-empty-state p { font-size: 0.875rem; }

/* Header */
.app-header { background: white; border-bottom: 1px solid rgba(232,168,76,0.2); padding: 0.75rem 1rem; display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30; }
.app-header-brand { display: flex; align-items: center; gap: 0.5rem; }
.app-header-logo { width: 32px; height: 32px; border-radius: 8px; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.app-header-logo-letter { color: white; font-weight: 700; font-size: 0.875rem; }
.app-header-title { font-weight: 600; font-size: 1.125rem; color: var(--text); }
.app-nav-link { color: var(--accent); font-size: 0.875rem; font-weight: 500; }

/* Bottom nav */
.app-bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; background: white; border-top: 1px solid rgba(232,168,76,0.2); z-index: 40; display: flex; }
.tab-btn { flex: 1; padding: 0.75rem 0; display: flex; flex-direction: column; align-items: center; gap: 0.25rem; border: none; background: none; cursor: pointer; color: #9ca3af; font-size: 0.75rem; font-weight: 500; border-top: 2px solid transparent; }
.tab-btn svg { width: 20px; height: 20px; }
.tab-btn-active { color: var(--accent); border-top-color: var(--accent); background: rgba(232,168,76,0.05); }

/* Inputs & buttons */
.app-input { width: 100%; padding: 0.75rem 1rem; border-radius: 12px; background: white; border: 1px solid rgba(232,168,76,0.2); font-size: 0.875rem; font-family: 'DM Sans', sans-serif; color: var(--text); display: block; }
.app-input:focus { outline: none; border-color: var(--accent); }
.app-input-search { flex: 1; }
.app-btn-accent { padding: 0.75rem 1rem; background: var(--accent); color: white; border: none; border-radius: 12px; font-weight: 600; font-size: 0.875rem; cursor: pointer; white-space: nowrap; }
.app-btn-locate { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--accent); font-weight: 500; padding: 0.5rem 0.75rem; background: rgba(200,98,42,0.1); border-radius: 8px; border: none; cursor: pointer; }
.app-btn-locate svg { width: 16px; height: 16px; }
.app-btn-primary-full { width: 100%; padding: 0.75rem; background: var(--accent); color: white; border: none; border-radius: 12px; font-weight: 600; font-size: 1rem; cursor: pointer; margin-top: 1rem; }
.app-location-status { font-size: 0.75rem; color: #9ca3af; }

/* Search row */
.search-row { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.location-row { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 1rem; }

/* Upload area */
.upload-area { border: 2px dashed rgba(232,168,76,0.4); border-radius: 16px; padding: 2rem; text-align: center; margin-bottom: 1rem; cursor: pointer; background: white; transition: border-color 0.15s; }
.upload-area:hover { border-color: var(--accent); }
.upload-preview-img { max-height: 192px; margin: 0 auto; border-radius: 12px; }

/* Form fields */
.form-fields { display: flex; flex-direction: column; gap: 0.75rem; }

/* Results hero */
.results-hero-card { background: white; border-radius: 16px; padding: 1rem; margin-bottom: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,0.05); }
.results-hero-inner { display: flex; gap: 0.75rem; }
.results-hero-info { flex: 1; }

/* Map placeholder inner */
.map-placeholder-inner { text-align: center; }

/* Profile header */
.profile-header { text-align: center; margin-bottom: 1.5rem; }
.profile-avatar { width: 80px; height: 80px; border-radius: 50%; background: rgba(200,98,42,0.1); display: flex; align-items: center; justify-content: center; margin: 0 auto 0.75rem; }

/* Stat value */
.app-stat-value { font-size: 1.5rem; font-weight: 700; }

/* Hidden utility */
.hidden { display: none !important; }

/* Price card layout */
.price-card-row { display: flex; justify-content: space-between; align-items: flex-start; }
.price-card-bottom { margin-top: 0.75rem; align-items: flex-end; }

/* Price amount display */
.price-amount-display { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.app-text-base { font-size: 1rem; }
.mt-1 { margin-top: 0.25rem; }

/* Loading spinner */
.app-loading { text-align: center; padding: 1.5rem 0; color: #9ca3af; }
.app-loading p { font-size: 0.875rem; margin-top: 0.5rem; }
.spinner-accent { border-top-color: var(--accent); }

/* Error message */
.app-error-msg { text-align: center; font-size: 0.875rem; color: #dc2626; padding: 1rem 0; }

/* Submit status */
.app-submit-status { text-align: center; font-size: 0.875rem; margin-top: 0.5rem; }
.app-submit-success { color: #16a34a; font-weight: 500; }
.app-submit-error { color: #dc2626; }

/* Font utilities */
.font-normal { font-weight: 400; }