/* ================================================================
   SÓ UM SERVICINHO - Design System (Mobile-First PWA)
   ================================================================ */

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Cores principais */
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #DBEAFE;
  --secondary: #0F172A;
  --accent: #F59E0B;
  
  /* Status */
  --success: #10B981;
  --warning: #F59E0B;
  --danger: #EF4444;
  --info: #3B82F6;
  
  /* Neutros */
  --white: #FFFFFF;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --text: #1E293B;
  --text-light: #64748B;
  --text-muted: #94A3B8;
  
  /* Layout */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.05);
  
  /* Spacing */
  --nav-height: 60px;
  --bottom-nav: 70px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;
  background: var(--gray-50);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
img { max-width: 100%; height: auto; display: block; }
input, button, textarea, select { font: inherit; }

/* ── Tipografia ────────────────────────────────────────────── */
h1 { font-size: 1.75rem; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
h2 { font-size: 1.375rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
h3 { font-size: 1.125rem; font-weight: 600; line-height: 1.4; }
h4 { font-size: 1rem; font-weight: 600; }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--text-muted); }
.text-light { color: var(--text-light); }
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }

/* ── Layout ────────────────────────────────────────────────── */
.container { width: 100%; max-width: 480px; margin: 0 auto; padding: 0 16px; }
.container-lg { width: 100%; max-width: 768px; margin: 0 auto; padding: 0 16px; }
.page-content { padding-top: calc(var(--nav-height) + 12px); padding-bottom: calc(var(--bottom-nav) + 20px); }
.page-content.no-nav { padding-top: 0; }
.page-content.no-bottom { padding-bottom: 20px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 4px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 12px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 12px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.p-3 { padding: 16px; }
.p-4 { padding: 20px; }
.w-full { width: 100%; }

/* ── Top Navigation Bar ────────────────────────────────────── */
.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  padding: 0 16px;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.92);
}
.top-nav .logo {
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-nav .logo span { color: var(--primary); }
.top-nav-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.top-nav-actions .nav-icon {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--gray-600);
  position: relative;
  transition: background 0.15s;
}
.top-nav-actions .nav-icon:hover { background: var(--gray-100); }
.nav-badge {
  position: absolute;
  top: 4px; right: 4px;
  width: 18px; height: 18px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

/* ── Bottom Navigation ─────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav);
  background: var(--white);
  border-top: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding-bottom: var(--safe-bottom);
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(255,255,255,0.95);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--gray-400);
  font-size: 10px;
  font-weight: 500;
  transition: color 0.15s;
  text-decoration: none;
  position: relative;
}
.bottom-nav a.active { color: var(--primary); }
.bottom-nav a.active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}
.bottom-nav svg { width: 24px; height: 24px; }

/* ── Botões ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
  text-decoration: none;
  line-height: 1.4;
}
.btn:active { transform: scale(0.97); }

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-secondary { background: var(--gray-800); color: #fff; }
.btn-secondary:hover { background: var(--gray-900); color: #fff; }

.btn-outline { background: transparent; color: var(--primary); border: 2px solid var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }

.btn-white { background: #fff; color: var(--text); border: 1px solid var(--gray-200); }
.btn-white:hover { background: var(--gray-50); border-color: var(--gray-300); color: var(--text); }

.btn-success { background: var(--success); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }

.btn-lg { padding: 14px 28px; font-size: 1rem; border-radius: var(--radius-lg); }
.btn-sm { padding: 8px 16px; font-size: 0.8125rem; }
.btn-block { width: 100%; }
.btn-pill { border-radius: var(--radius-full); }

.btn-icon {
  width: 44px; height: 44px;
  padding: 0;
  border-radius: var(--radius);
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: var(--shadow-md); }
.card-body { padding: 16px; }
.card-title { font-size: 1rem; font-weight: 600; margin-bottom: 4px; }
.card-text { font-size: 0.875rem; color: var(--text-light); }

/* ── Formulários ───────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-input::placeholder { color: var(--gray-400); }
.form-input.is-error { border-color: var(--danger); }

.form-select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  outline: none;
}
.form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

textarea.form-input { resize: vertical; min-height: 100px; }

.form-hint { font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }

/* ── Badges & Tags ─────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-danger { background: #FEE2E2; color: #991B1B; }
.badge-gray { background: var(--gray-100); color: var(--gray-600); }

/* ── Estrelas de Avaliação ─────────────────────────────────── */
.stars { display: inline-flex; gap: 2px; color: #FCD34D; }
.stars .empty { color: var(--gray-300); }
.rating-num { font-size: 0.8125rem; font-weight: 700; color: var(--text); margin-right: 4px; }

/* ── Avatar ────────────────────────────────────────────────── */
.avatar {
  width: 44px; height: 44px;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  overflow: hidden;
}
.avatar-sm { width: 32px; height: 32px; font-size: 0.75rem; }
.avatar-lg { width: 64px; height: 64px; font-size: 1.5rem; }
.avatar-xl { width: 80px; height: 80px; font-size: 2rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ── Categoria Card ────────────────────────────────────────── */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.cat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 4px;
  border-radius: var(--radius);
  transition: background 0.15s;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
}
.cat-item:hover { background: var(--gray-100); color: var(--text); }
.cat-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem;
  color: #fff;
}
.cat-name { font-size: 0.6875rem; font-weight: 500; text-align: center; line-height: 1.3; color: var(--gray-600); }

/* ── Provider Card ─────────────────────────────────────────── */
.provider-card {
  display: flex;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
  transition: box-shadow 0.2s, border-color 0.2s;
  text-decoration: none;
  color: var(--text);
}
.provider-card:hover { box-shadow: var(--shadow); border-color: var(--gray-300); color: var(--text); }
.provider-info { flex: 1; min-width: 0; }
.provider-name { font-weight: 600; font-size: 0.9375rem; margin-bottom: 2px; }
.provider-cat { font-size: 0.75rem; color: var(--text-muted); }
.provider-meta { display: flex; align-items: center; gap: 12px; margin-top: 6px; font-size: 0.75rem; color: var(--text-light); }
.provider-price { font-weight: 700; color: var(--success); font-size: 0.875rem; }

/* ── Alertas / Toast ───────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}
.alert-success { background: #D1FAE5; color: #065F46; }
.alert-error { background: #FEE2E2; color: #991B1B; }
.alert-warning { background: #FEF3C7; color: #92400E; }
.alert-info { background: #DBEAFE; color: #1E40AF; }

/* ── Seções ────────────────────────────────────────────────── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-title { font-size: 1.0625rem; font-weight: 700; }
.section-link { font-size: 0.8125rem; font-weight: 600; color: var(--primary); }

/* ── Search Bar ────────────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--white);
  padding: 10px 14px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--gray-200);
  transition: border-color 0.15s;
}
.search-bar:focus-within { border-color: var(--primary); }
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 0.9375rem;
  background: transparent;
  color: var(--text);
}
.search-bar input::placeholder { color: var(--gray-400); }
.search-bar svg { color: var(--gray-400); flex-shrink: 0; }

/* ── Empty State ───────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 40px 20px;
}
.empty-state svg { width: 64px; height: 64px; color: var(--gray-300); margin: 0 auto 16px; }
.empty-state h3 { color: var(--gray-600); margin-bottom: 6px; }
.empty-state p { color: var(--text-muted); font-size: 0.875rem; }

/* ── Skeleton Loading ──────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Landing Page Specifics ────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A5F 50%, #2563EB 100%);
  color: #fff;
  padding: 60px 20px 40px;
  text-align: center;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -50%;
  width: 100%;
  height: 200%;
  background: radial-gradient(ellipse at center, rgba(37,99,235,0.15) 0%, transparent 70%);
  animation: float 6s ease-in-out infinite;
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(5deg); }
}
.hero h1 { font-size: 2rem; margin-bottom: 12px; position: relative; }
.hero p { font-size: 1rem; color: #94A3B8; max-width: 360px; margin: 0 auto 24px; position: relative; }
.hero .btn { position: relative; }

.features-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 24px 0;
}
.feature-card {
  background: var(--white);
  padding: 20px 16px;
  border-radius: var(--radius-lg);
  text-align: center;
  border: 1px solid var(--gray-200);
}
.feature-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 10px;
  font-size: 1.25rem;
}
.feature-card h4 { font-size: 0.8125rem; margin-bottom: 4px; }
.feature-card p { font-size: 0.75rem; color: var(--text-light); }

/* ── Divider ───────────────────────────────────────────────── */
.divider { height: 1px; background: var(--gray-200); margin: 20px 0; }
.divider-text {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-muted); font-size: 0.8125rem;
  margin: 20px 0;
}
.divider-text::before, .divider-text::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}

/* ── Urgência Tags ─────────────────────────────────────────── */
.urgencia-baixa { background: #DBEAFE; color: #1D4ED8; }
.urgencia-media { background: #D1FAE5; color: #065F46; }
.urgencia-alta { background: #FEF3C7; color: #92400E; }
.urgencia-urgente { background: #FEE2E2; color: #991B1B; }

/* ── Animations ────────────────────────────────────────────── */
.fade-in { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

.slide-up { animation: slideUp 0.4s ease; }
@keyframes slideUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* ── Responsive ────────────────────────────────────────────── */
@media (min-width: 768px) {
  .container { max-width: 520px; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 16px; }
  h1 { font-size: 2.25rem; }
  .hero h1 { font-size: 2.75rem; }
}
