/* ============================================================
   BASE — Medici și Farmacii
   Design tokens (ported from the Claude Design system), CSS reset
   and base element styles. Brand rule: blue and green never sit
   side-by-side at equal weight — one always dominates. Green is
   reserved for positive actions and live/open status.
   ============================================================ */

:root {
  /* ---- Brand base ---- */
  --blue-700: #193A5E;    /* link hover / pressed (primary -15%) */
  --blue-600: #224E7C;    /* PRIMARY — header, buttons, headings, links */
  --blue-100: #EAF1F9;    /* tints: specialty tags, soft fills */
  --blue-050: #F2F7FC;

  --green-700: #357A3A;   /* CTA pressed */
  --green-600: #419F46;   /* ACCENT — CTA, active rating stars, badges */
  --green-100: #E6F3E7;   /* soft green fills, open-status pills */

  /* ---- Neutrals ---- */
  --ink-900: #1A1A2E;     /* body text, titles */
  --ink-700: #3C4654;     /* strong secondary text */
  --gray-500: #9BA5B0;    /* secondary text, placeholder */
  --gray-300: #D0D7DE;    /* empty rating stars, dividers */
  --line-200: #E0E6EC;    /* borders, header bottom border */
  --surface-100: #F4F6F8; /* section backgrounds, zebra rows, inputs */
  --white: #FFFFFF;

  /* ---- Footer ---- */
  --footer-900: #1A2B3C;  /* dark footer background */

  /* ---- Semantic status ---- */
  --danger-600: #D9534F;
  --danger-100: #FBEAE9;
  --warning-600: #E0A106;
  --warning-100: #FBF1D6;
  --success-600: #419F46;
  --success-100: #E6F3E7;
  --info-600: #224E7C;
  --info-100: #EAF1F9;

  /* ============ SEMANTIC ALIASES ============ */
  --color-primary: var(--blue-600);
  --color-primary-hover: var(--blue-700);
  --color-accent: var(--green-600);
  --color-accent-hover: var(--green-700);

  --text-heading: var(--blue-600);
  --text-body: var(--ink-900);
  --text-muted: var(--gray-500);
  --text-on-primary: var(--white);
  --text-link: var(--blue-600);
  --text-link-hover: var(--blue-700);

  --surface-page: var(--white);
  --surface-card: var(--white);
  --surface-sunken: var(--surface-100);
  --surface-tint: var(--blue-100);

  --border-default: var(--line-200);
  --border-strong: var(--gray-300);
  --border-focus: var(--blue-600);

  --star-active: var(--green-600);
  --star-empty: var(--gray-300);

  /* ---- Type families ---- */
  --font-display: "Quicksand", "Segoe UI", sans-serif;       /* headings, logo, labels */
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* ---- Weights ---- */
  --weight-regular: 400;
  --weight-medium: 500;
  --weight-semibold: 600;
  --weight-bold: 700;

  /* ---- Type scale (rem; base 16px) ---- */
  --text-h1: 2rem;
  --text-h2: 1.5rem;
  --text-h3: 1.2rem;
  --text-lead: 1.125rem;
  --text-base: 1rem;
  --text-sm: 0.875rem;
  --text-meta: 0.85rem;
  --text-label: 0.75rem;

  /* ---- Line heights ---- */
  --leading-tight: 1.2;
  --leading-snug: 1.35;
  --leading-body: 1.6;

  /* ---- Letter spacing ---- */
  --tracking-label: 0.05em;
  --tracking-normal: 0;

  /* ---- Spacing scale (4px base) ---- */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  /* ---- Layout ---- */
  --content-max: 1200px;
  --gutter: 24px;
  --gutter-mobile: 16px;

  /* ---- Radii ---- */
  --radius-sm: 4px;
  --radius-md: 6px;       /* cards, inputs */
  --radius-lg: 10px;
  --radius-pill: 20px;
  --radius-full: 999px;

  /* ---- Control sizing ---- */
  --control-h-sm: 32px;
  --control-h-md: 40px;
  --control-h-lg: 48px;

  /* ---- Elevation ---- */
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.08);
  --shadow-card-hover: 0 2px 8px rgba(0, 0, 0, 0.12);
  --shadow-popover: 0 6px 24px rgba(26, 26, 46, 0.16);
  --shadow-focus: 0 0 0 3px rgba(34, 78, 124, 0.22);

  /* ---- Motion ---- */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-fast: 120ms;
  --dur-base: 180ms;
  --transition-base: all var(--dur-base) var(--ease-standard);

  /* ---- Card accent ---- */
  --card-hover-accent: 3px solid var(--blue-600);
}

/* ============================================================
   RESET
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  font-weight: var(--weight-regular);
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text-body);
  background: var(--surface-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  max-width: 100%;
  vertical-align: middle;
}

img {
  height: auto;
}

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
}

/* ============================================================
   BASE TYPOGRAPHY
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  color: var(--text-heading);
  line-height: var(--leading-snug);
  margin: 0 0 var(--space-4);
  letter-spacing: var(--tracking-normal);
}

h1 { font-size: var(--text-h1); line-height: var(--leading-tight); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); font-weight: var(--weight-medium); }
h4 { font-size: var(--text-lead); }

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

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-standard);
}

a:hover,
a:focus {
  color: var(--text-link-hover);
  text-decoration: underline;
}

strong, b {
  font-weight: var(--weight-semibold);
}

small {
  font-size: var(--text-meta);
}

hr {
  border: 0;
  border-top: 1px solid var(--line-200);
  margin: var(--space-8) 0;
}

blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-4) var(--space-6);
  border-left: 3px solid var(--green-600);
  background: var(--surface-100);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-700);
}

ul, ol {
  margin: 0 0 var(--space-4);
  padding-left: var(--space-6);
}

::selection {
  background: rgba(65, 159, 70, 0.22);
}

:focus-visible {
  outline: 2px solid var(--blue-600);
  outline-offset: 2px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.visually-hidden.focusable:active,
.visually-hidden.focusable:focus {
  position: static !important;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: inherit;
}

@media (max-width: 768px) {
  :root {
    --gutter: var(--gutter-mobile);
  }
  h1 { font-size: 1.65rem; }
  h2 { font-size: 1.35rem; }
}
