/* Mobile Clinic — Premium Design System v2 */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=Outfit:wght@500;600;700;800&display=swap');

:root {
  --primary: #0f4c81;
  --primary-dark: #0a355c;
  --primary-light: #1a6bb5;
  --accent: #00b4d8;
  --accent-soft: #e0f7fa;
  --bg: #f4f7fb;
  --bg-white: #ffffff;
  --text: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #059669;
  --warning: #d97706;
  --danger: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 4px 24px rgba(15, 76, 129, 0.07);
  --shadow-lg: 0 12px 48px rgba(15, 76, 129, 0.12);
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'DM Sans', sans-serif;
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }
img { max-width: 100%; height: auto; display: block; }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.22;
  color: var(--text);
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.85rem, 4.2vw, 2.85rem); }
h2 { font-size: clamp(1.45rem, 3vw, 2.05rem); }
h3 { font-size: 1.28rem; }

/* Layout */
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 1.25rem; }
.section { padding: 3.75rem 0; }
.section-title { text-align: center; margin-bottom: 2.25rem; }
.section-title span { color: var(--primary-light); }

/* Header */
.site-header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 1.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.22rem;
  color: var(--primary);
  letter-spacing: -0.01em;
}
.logo-img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  border-radius: 10px;
}
.logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.25rem;
  box-shadow: 0 4px 12px rgba(15,76,129,0.25);
}
.nav-links { display: flex; align-items: center; gap: 1.6rem; list-style: none; }
.nav-links a { color: var(--text); font-weight: 500; font-size: 0.94rem; position: relative; }
.nav-links a::after {
  content: ''; position: absolute; bottom: -4px; left: 0; width: 0; height: 2px;
  background: var(--accent); transition: width var(--transition);
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.header-actions { display: flex; align-items: center; gap: 0.7rem; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  padding: 0.62rem 1.3rem; border-radius: var(--radius-sm); font-weight: 600;
  font-size: 0.9rem; border: none; cursor: pointer; transition: all var(--transition);
  text-decoration: none; font-family: var(--font);
}
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 14px rgba(15,76,129,0.28);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(15,76,129,0.35);
  color: white;
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--accent-soft); }
.btn-ghost { background: transparent; color: var(--text-muted); }
.btn-ghost:hover { color: var(--primary); background: rgba(15,76,129,0.06); }
.btn-sm { padding: 0.42rem 0.9rem; font-size: 0.84rem; }
.btn-lg { padding: 0.85rem 1.7rem; font-size: 1rem; border-radius: 12px; }
.btn-block { width: 100%; }
.mobile-toggle { display: none; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--text); }

/* Hero */
.hero {
  background: linear-gradient(160deg, #e8f1fa 0%, #f4f7fb 45%, #ffffff 100%);
  padding: 3.5rem 0 2.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -120px; right: -80px;
  width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(0,180,216,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero-content {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 2.5rem;
  align-items: center;
  margin-bottom: 2rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: white;
  border: 1px solid var(--border);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.1rem;
  box-shadow: var(--shadow);
}
.hero-text h1 { margin-bottom: 1rem; }
.hero-text p {
  font-size: 1.08rem;
  color: var(--text-muted);
  max-width: 480px;
  margin-bottom: 1.6rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; }
.hero-visual { display: flex; justify-content: center; }
.hero-logo-wrap {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: white;
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  padding: 2rem;
}
.hero-logo-wrap img {
  max-width: 85%;
  max-height: 85%;
  object-fit: contain;
}
.phone-float {
  width: 210px; height: 420px;
  background: linear-gradient(160deg, #1e293b, #0f172a);
  border-radius: 32px;
  padding: 12px;
  box-shadow: 0 25px 50px rgba(15,23,42,0.35);
  position: relative;
}
.phone-screen {
  width: 100%; height: 100%;
  background: linear-gradient(180deg, #f0f9ff, #e0f2fe);
  border-radius: 24px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 0.5rem;
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

/* Search bar */
.search-bar {
  display: flex;
  gap: 0.6rem;
  background: white;
  padding: 0.65rem;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}
.search-bar input, .search-bar select {
  flex: 1;
  min-width: 120px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  font-family: var(--font);
  font-size: 0.95rem;
  background: var(--bg);
}
.search-bar input:focus, .search-bar select:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(26,107,181,0.15);
}

/* Forms */
.form-group { margin-bottom: 1.15rem; }
.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.88rem;
  margin-bottom: 0.4rem;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 0.72rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font);
  font-size: 0.95rem;
  background: white;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-control:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(26,107,181,0.12);
}
.form-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.9rem;
}
.form-check label { display: flex; align-items: center; gap: 0.45rem; font-weight: 500; margin: 0; }
.forgot-link { font-size: 0.88rem; color: var(--primary); }

/* Auth pages */
.auth-section {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1.25rem;
  background: linear-gradient(160deg, #e8f1fa 0%, #f4f7fb 50%, #ffffff 100%);
  min-height: calc(100vh - 140px);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: white;
  border-radius: 20px;
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}
.auth-header { text-align: center; margin-bottom: 1.75rem; }
.auth-logo {
  width: 56px; height: 56px;
  margin: 0 auto 1rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem;
  box-shadow: 0 8px 20px rgba(15,76,129,0.25);
}
.auth-header h1 {
  font-size: 1.55rem;
  margin-bottom: 0.35rem;
}
.auth-header .subtitle {
  color: var(--text-muted);
  font-size: 0.92rem;
}
.auth-form { margin-top: 0.5rem; }
.otp-input {
  text-align: center;
  font-size: 1.6rem !important;
  letter-spacing: 0.55rem;
  font-weight: 700;
  font-family: var(--font-display);
}
.auth-footer {
  text-align: center;
  margin-top: 1.4rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}
.auth-footer a { font-weight: 600; }

/* Product cards */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.4rem;
}
.product-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  color: inherit;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.product-card-img {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg);
  overflow: hidden;
}
.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-card-img .badge {
  position: absolute;
  top: 10px; left: 10px;
  background: var(--primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
}
.product-card-body { padding: 1rem 1.1rem 1.2rem; }
.product-card-body h3 {
  font-size: 1rem;
  margin-bottom: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.45rem; }
.product-price {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--primary);
}
.product-price small { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }

/* Stat / How it works */
.stat-card {
  background: white;
  border-radius: var(--radius);
  padding: 1.5rem 1.25rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  transition: transform var(--transition);
}
.stat-card:hover { transform: translateY(-3px); }

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  padding: 3.5rem 0 1.5rem;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}
.footer-brand .logo { color: white; margin-bottom: 0.85rem; }
.footer-brand p { font-size: 0.9rem; line-height: 1.7; max-width: 280px; }
.footer-col h4 { color: white; font-size: 0.95rem; margin-bottom: 1rem; font-family: var(--font-display); }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 0.5rem; }
.footer-col a { color: #94a3b8; font-size: 0.9rem; }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid #334155; padding-top: 1.5rem;
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem;
  font-size: 0.85rem;
}
.bam-credit { font-size: 0.8rem; color: #94a3b8; }
.bam-credit a { color: #60a5fa; font-weight: 600; }

/* Dashboard */
.dashboard-layout { display: grid; grid-template-columns: 260px 1fr; min-height: calc(100vh - 72px); }
.sidebar {
  background: #0f172a; color: #cbd5e1; padding: 1.5rem 0; position: sticky; top: 72px; height: calc(100vh - 72px); overflow-y: auto;
}
.sidebar-nav { list-style: none; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1.5rem;
  color: #94a3b8; font-weight: 500; font-size: 0.9rem; transition: all var(--transition);
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(59, 130, 246, 0.15); color: #60a5fa; border-right: 3px solid var(--accent);
}
.dashboard-main { padding: 2rem; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .value { font-size: 1.75rem; font-weight: 800; color: var(--primary); margin-top: 0.25rem; font-family: var(--font-display); }

/* Map */
.map-container { height: 400px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.leaflet-container { height: 100%; width: 100%; }

/* Flashes */
.flash-messages { position: fixed; top: 80px; right: 1.25rem; z-index: 2000; max-width: 360px; }
.flash {
  padding: 0.85rem 1.15rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.6rem;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  animation: slideIn 0.3s ease;
}
.flash-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.flash-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }
.flash-warning { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.flash-info { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: none; } }

/* Responsive */
@media (max-width: 900px) {
  .hero-content { grid-template-columns: 1fr; text-align: center; }
  .hero-text p { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .hero-visual { order: -1; }
  .phone-float { width: 180px; height: 360px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 640px) {
  .nav-links { display: none; }
  .mobile-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .header-actions .btn-outline { display: none; }
  .search-bar { flex-direction: column; }
  .auth-card { padding: 1.75rem 1.35rem; }
}
/* Mobile nav drawer */
.mobile-nav {
  position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 1500;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.mobile-nav.open { opacity: 1; pointer-events: auto; }
.mobile-nav-panel {
  position: absolute; top: 0; right: 0; width: min(320px, 85vw); height: 100%;
  background: white; padding: 1.5rem; transform: translateX(100%); transition: transform 0.3s;
}
.mobile-nav.open .mobile-nav-panel { transform: none; }
.mobile-nav-panel ul { list-style: none; margin-top: 2rem; }
.mobile-nav-panel li { margin-bottom: 0.75rem; }
.mobile-nav-panel a { font-weight: 600; font-size: 1.05rem; color: var(--text); }

/* Skeleton */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 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; } }

.qr-box {
  background: white; border: 2px dashed var(--border); border-radius: var(--radius);
  padding: 1.5rem; text-align: center; max-width: 320px; margin: 0 auto;
}
.qr-box img { max-width: 220px; margin: 0 auto 1rem; }

#page-loader{display:none;position:fixed;inset:0;background:rgba(15,23,42,.45);z-index:99999;align-items:center;justify-content:center;backdrop-filter:blur(2px)}
#page-loader.active{display:flex}
.page-loader-inner{background:#fff;border-radius:16px;padding:1.5rem 2rem;text-align:center;box-shadow:0 20px 50px rgba(0,0,0,.2);min-width:140px}
.page-loader-spinner{width:40px;height:40px;border:3px solid #e2e8f0;border-top-color:#0f4c81;border-radius:50%;margin:0 auto .75rem;animation:mcspin .7s linear infinite}
.page-loader-inner p{margin:0;font-size:.9rem;color:#64748b}
@keyframes mcspin{to{transform:rotate(360deg)}}


.float-whatsapp{position:fixed;right:18px;bottom:22px;z-index:9990;width:56px;height:56px;border-radius:50%;background:#25d366;color:#fff;display:flex;align-items:center;justify-content:center;box-shadow:0 8px 24px rgba(37,211,102,.45);text-decoration:none;transition:transform .15s ease,box-shadow .15s}
.float-whatsapp:hover{transform:scale(1.06);box-shadow:0 10px 28px rgba(37,211,102,.55);color:#fff}
.float-whatsapp-icon{font-size:1.55rem;line-height:1}
@media(max-width:480px){.float-whatsapp{right:14px;bottom:16px;width:52px;height:52px}}
