/* Pharmio.ai Web — Design System */

/* ── 1. Design Tokens ─────────────────────────────────────────── */
:root {
  --ph-mint:   #55D690;
  --ph-purple: #8676FF;
  --ph-navy:   #1A0B5B;
  --ph-bg:     #F8F9FD;
  --ph-white:  #ffffff;
}

/* ── 2. Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  background-color: var(--ph-bg);
  font-family: 'Nunito', ui-sans-serif, system-ui, sans-serif;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* ── 3. App Shell ─────────────────────────────────────────────── */
.sidebar {
  width: 260px;
  min-height: 100vh;
  background: var(--ph-white);
  border-right: 1px solid #f1f5f9;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  z-index: 40;
  overflow-y: auto;
}

.app-content {
  min-height: 100vh;
}

@media (min-width: 1024px) {
  .app-content { margin-left: 260px; }
}

/* ── 4. Sidebar Nav ───────────────────────────────────────────── */
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border-radius: 12px;
  color: #64748b;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.18s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}
.sidebar-nav-item:hover {
  background-color: var(--ph-bg);
  color: var(--ph-navy);
}
.sidebar-nav-item.active {
  background-color: rgba(134, 118, 255, 0.09);
  color: var(--ph-purple);
}
.sidebar-nav-item.active iconify-icon { color: var(--ph-purple); }

/* ── 5. Bottom Nav (mobile) ───────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--ph-white);
  border-top: 1px solid #f1f5f9;
  display: flex;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px 8px;
  gap: 2px;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 700;
  text-decoration: none;
  transition: color 0.18s;
}
.bottom-nav-item.active { color: var(--ph-purple); }

/* ── 6. Landing Page Gradients ────────────────────────────────── */
.hero-gradient {
  background: linear-gradient(135deg, #0d0633 0%, #1A0B5B 35%, #2d1b8e 65%, #5b3fa6 100%);
}
.soft-gradient {
  background: linear-gradient(150deg, #eef0ff 0%, #f8f9fd 45%, #edfff5 100%);
}
.scan-promo-gradient {
  background: linear-gradient(135deg, var(--ph-navy) 0%, #2d1b8e 60%, #4a2dab 100%);
}

/* ── 7. Animations ────────────────────────────────────────────── */
.fade-in  { animation: fadeIn  0.4s ease-in-out forwards; }
.slide-up { animation: slideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

@keyframes fadeIn  { from { opacity: 0; }                          to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── 8. Circular Score Chart ──────────────────────────────────── */
.circular-chart { display: block; margin: 0 auto; max-width: 80%; max-height: 220px; }
.circle-bg  { fill: none; stroke: #e8ecf4; stroke-width: 3.8; }
.circle     { fill: none; stroke-width: 2.8; stroke-linecap: round; animation: progress 1s ease-out forwards; }
@keyframes progress { 0% { stroke-dasharray: 0 100; } }

/* ── 9. Form Components ───────────────────────────────────────── */
.ph-input {
  width: 100%;
  background: #f8fafc;
  border: 1.5px solid #e8ecf4;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: 'Nunito', sans-serif;
  color: var(--ph-navy);
  transition: border-color 0.2s;
  outline: none;
}
.ph-input:focus { border-color: var(--ph-purple); background: white; }
.ph-input::placeholder { color: #94a3b8; }

.ph-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  margin-bottom: 6px;
}

/* ── 10. Buttons ──────────────────────────────────────────────── */
.ph-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 14px;
  font-weight: 700;
  font-size: 1rem;
  font-family: 'Nunito', sans-serif;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  text-decoration: none;
}
.ph-btn:active { transform: scale(0.97); }
.ph-btn-navy   { background: var(--ph-navy);   color: white; box-shadow: 0 4px 20px rgba(26,11,91,0.25); }
.ph-btn-purple { background: var(--ph-purple); color: white; box-shadow: 0 4px 20px rgba(134,118,255,0.3); }
.ph-btn-mint   { background: var(--ph-mint);   color: white; box-shadow: 0 4px 20px rgba(85,214,144,0.3); }
.ph-btn-outline { background: transparent; color: var(--ph-navy); border: 2px solid #e8ecf4; }
.ph-btn-outline:hover { border-color: var(--ph-purple); color: var(--ph-purple); }
.ph-btn-ghost  { background: #f1f5f9; color: var(--ph-navy); }
.ph-btn-ghost:hover { background: #e2e8f0; }

/* ── 11. Cards ────────────────────────────────────────────────── */
.ph-card {
  background: var(--ph-white);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 8px rgba(26, 11, 91, 0.04);
}

/* ── 12. File Upload Drop Zone ────────────────────────────────── */
.drop-zone {
  border: 2px dashed #dde2ef;
  border-radius: 20px;
  transition: all 0.2s;
  cursor: pointer;
  position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--ph-purple);
  background-color: rgba(134, 118, 255, 0.04);
}
.drop-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer;
}

/* ── 13. Toast Notifications ──────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
@media (min-width: 1024px) { #toast-container { bottom: 32px; } }

.toast {
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.875rem;
  white-space: nowrap;
  animation: slideUp 0.3s ease-out forwards;
  pointer-events: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}
.toast-success { background: var(--ph-navy); color: white; }
.toast-error   { background: #ef4444;         color: white; }
.toast-info    { background: var(--ph-purple); color: white; }

/* ── 14. Toggle Switch ────────────────────────────────────────── */
.ph-toggle {
  appearance: none; -webkit-appearance: none;
  width: 44px; height: 24px;
  background: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
}
.ph-toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
  transition: transform 0.2s;
}
.ph-toggle:checked { background: var(--ph-purple); }
.ph-toggle:checked::after { transform: translateX(20px); }

/* ── 15. Goal / Toggle Cards ──────────────────────────────────── */
.goal-card { transition: all 0.2s; }
.goal-card.selected {
  background-color: rgba(85, 214, 144, 0.08) !important;
  border-color: var(--ph-mint) !important;
  box-shadow: 0 4px 16px rgba(85, 214, 144, 0.15);
}

/* ── 16. Scrollbar Hide ───────────────────────────────────────── */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ── 17. Auth Modal ───────────────────────────────────────────── */
.auth-modal-backdrop {
  position: fixed; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 10, 40, 0.55);
  backdrop-filter: blur(4px);
  padding: 16px;
}
.auth-modal-box {
  background: white;
  border-radius: 28px;
  padding: 40px;
  width: 100%;
  max-width: 440px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
}
@media (max-width: 640px) {
  .auth-modal-backdrop { align-items: flex-end; padding: 0; }
  .auth-modal-box { border-radius: 28px 28px 0 0; padding: 32px 24px; max-height: 90vh; }
}

/* ── 18. Supplement Image Grid ────────────────────────────────── */
.img-thumb {
  width: 72px; height: 72px;
  border-radius: 12px;
  object-fit: cover;
  border: 1.5px solid #f1f5f9;
}

/* ── 19. Wizard Steps ─────────────────────────────────────────── */
.step-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
  transition: all 0.3s;
}
.step-dot.active { background: var(--ph-purple); width: 24px; border-radius: 4px; }
.step-dot.done   { background: var(--ph-mint); }
