/* ═══════════════════════════════════════════════════════════════════════════
   POCKET PHARMACIST — Clinical Clarity Design System
   Mobile-first • No animations • Professional & Approachable
   ═══════════════════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* ─────────────────────────────────────────
   Design Tokens
   ───────────────────────────────────────── */
:root {
  color-scheme: light;

  /* Typography */
  --font-display: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  /* Font sizes - mobile */
  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;

  /*
   * Brand Colors — Pocket Pharmacist
   * Source: iOS app UIColor definitions
   *
   * BLUES (primary brand):
   *   #007FC3 = blueBrandingColor       — primary accent
   *   #005E90 = darkBlueBrandingColor   — hover/active states
   *   #00A0F6 = lightBlueBrandingColor  — highlights (unused currently)
   *
   * GRAYS:
   *   #F7F8F9 = veryLightGrayBrandingColor — page background
   *   #D7DADF = lightGrayBrandingColor     — borders
   *   #ABB2BC = grayBrandingColor          — strong borders
   *   #8F98A5 = darkGrayBrandingColor      — (available)
   *   #737E8E = veryDarkGrayBrandingColor  — muted text
   *
   * SEMANTIC:
   *   #C3001E = redBrandingColor        — errors
   *   #900016 = darkRedBrandingColor    — (available)
   *   #009032 = darkGreenBrandingColor  — success
   *   #7FC300 = greenBrandingColor      — (available)
   *   #C34400 = orangeBrandingColor     — warnings
   *   #C3A600 = brownBrandingColor      — (available)
   *   #FFDC11 = yellowBrandingColor     — (available)
   */

  /* Layout colors */
  --color-bg: #f7f8f9;            /* veryLightGrayBrandingColor */
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #737e8e;    /* veryDarkGrayBrandingColor */
  --color-border: #d7dadf;        /* lightGrayBrandingColor */
  --color-border-strong: #abb2bc; /* grayBrandingColor */

  /* Brand blues */
  --color-accent: #007fc3;        /* blueBrandingColor */
  --color-accent-hover: #005e90;  /* darkBlueBrandingColor */
  --color-accent-light: #e5f3fb;  /* derived tint */

  /* Semantic colors */
  --color-error: #c3001e;         /* redBrandingColor */
  --color-error-bg: #fef2f3;
  --color-success: #009032;       /* darkGreenBrandingColor */
  --color-warning: #c34400;       /* orangeBrandingColor */
  --color-success-bg: #eef9f2;
  --color-error-dark: #900016;    /* darkRedBrandingColor */

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  /* Borders */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);

  /* Motion */
  --motion-duration-fast: 180ms;
  --motion-duration-page: 280ms;
  --motion-ease-standard: ease-in-out;
  --motion-ease-enter: ease-in;
  --motion-ease-exit: ease-out;
  --motion-slide-distance-full: 100%;
  --motion-slide-distance-peek: 30%;

  /* Safe area insets (iOS notch/home indicator) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

/* ─────────────────────────────────────────
   Dark Mode (system preference)
   ───────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --color-bg: #121417;
    --color-surface: #1c1f24;
    --color-text: #e4e6ea;
    --color-text-muted: #8f98a5;
    --color-border: #2c3038;
    --color-border-strong: #3d4350;
    --color-accent: #3da8e0;
    --color-accent-hover: #5bbaea;
    --color-accent-light: #1a2d3d;
    --color-error: #e5484d;
    --color-error-bg: #2d1b1b;
    --color-error-dark: #c13239;
    --color-success: #30a46c;
    --color-success-bg: #1a2d22;
    --color-warning: #e5984e;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
  }

}

/* ─────────────────────────────────────────
   Reset & Base
   ───────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  font-size: 16px;
}

body {
  margin: 0;
  padding: var(--safe-top) var(--safe-right) var(--safe-bottom) var(--safe-left);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.5;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}

/* ─────────────────────────────────────────
   Typography
   ───────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  margin: 0;
  color: var(--color-text);
}

h1 {
  font-size: var(--text-xl);
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--text-lg);
}

p {
  margin: 0 0 var(--space-4);
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:focus-visible {
  text-decoration: underline;
}

@media (hover: hover) and (pointer: fine) {
  a:hover {
    text-decoration: underline;
  }
}
