/* ─────────────────────────────────────────────
   PIN · OS  —  Shared Design System
   Load this before any page-specific stylesheet.
   ───────────────────────────────────────────── */

:root {
  --bg: #f8fafc;
  --white: #ffffff;
  --s1: #f1f5f9;
  --s2: #e2e8f0;
  --border: rgba(0, 0, 0, 0.08);
  --border2: rgba(0, 0, 0, 0.05);
  --txt: #0f172a;
  --txt2: #475569;
  --muted: #64748b;
  --muted2: #94a3b8;
  --teal: #0ea5e9;
  --teal2: rgba(14, 165, 233, 0.10);
  --teal3: rgba(14, 165, 233, 0.06);
  --amber: #f0a500;
  --amber2: rgba(240, 165, 0, 0.12);
  --red: #f04054;
  --red2: rgba(240, 64, 84, 0.12);
  --green: #22c98a;
  --green2: rgba(34, 201, 138, 0.10);
  --blue: #6c72f0;
  --blue2: rgba(108, 114, 240, 0.10);
  --violet: #a855f7;
  --violet2: rgba(168, 85, 247, 0.10);
  --pharma: #14b8c8;
  --pharma2: rgba(20, 184, 200, 0.10);
  --pharma3: rgba(20, 184, 200, 0.06);
  --shadow: 0 1px 6px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow2: 0 10px 30px rgba(15, 23, 42, 0.12);
  --shadow3: 0 6px 24px rgba(0, 0, 0, 0.14), 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Reset */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base */
body {
  background: var(--bg);
  color: var(--txt);
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  line-height: 1.6;
  overflow-x: hidden;
}

/* ── Header ──────────────────────────────────── */
header {
  padding: 0;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Logo ──────────────────────────────────────── */
.logo {
  display: flex;
  align-items: center;
  gap: 0;
  text-decoration: none;
  color: var(--txt);
  flex-shrink: 0;
}

.logo-mark {
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.2px;
  color: var(--txt);
}

.logo-mark span {
  color: var(--teal);
}

.logo-sub {
  font-size: 9px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

.logo-img {
  height: 40px;
  width: auto;
  display: block;
}

/* ── Desktop nav ─────────────────────────────── */
.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link[aria-expanded="true"] {
  color: var(--teal);
  background: var(--teal3);
}

/* ── Dropdown ─────────────────────────────────── */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.nav-dropdown-toggle::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  margin-top: 1px;
  transition: transform 0.2s;
}

.nav-dropdown-toggle[aria-expanded="true"]::after {
  transform: rotate(180deg);
}

.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  min-width: 210px;
  padding: 6px;
  z-index: 300;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}

.nav-dropdown-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-menu a {
  display: block;
  padding: 8px 12px;
  color: var(--txt2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.13s, color 0.13s;
  white-space: nowrap;
}

.nav-dropdown-menu a:hover {
  background: var(--teal3);
  color: var(--teal);
}

/* ── Nav action buttons ───────────────────────── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-signup {
  color: var(--txt);
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-signup:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.nav-signin {
  background: linear-gradient(135deg, var(--teal), var(--pharma));
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 8px;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
}

.nav-signin:hover {
  opacity: 0.88;
  transform: translateY(-1px);
  color: #fff;
}

/* ── Hamburger ────────────────────────────────── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}

.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--txt);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
  transform-origin: center;
}

.nav-hamburger.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ── Mobile nav drawer ───────────────────────── */
.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
  background: var(--white);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.mobile-nav.open {
  max-height: 1200px;
}

/* ── Mobile accordion ─────────────────────────── */
.mobile-nav-section {
  border-bottom: 1px solid var(--border2);
}

.mobile-nav-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 24px;
  color: var(--txt);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  transition: background 0.13s, color 0.13s;
}

.mobile-nav-category:hover {
  background: var(--s1);
  color: var(--teal);
}

.mobile-nav-category::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid currentColor;
  transition: transform 0.2s;
}

.mobile-nav-category.open::after {
  transform: rotate(180deg);
}

.mobile-nav-subitems {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}

.mobile-nav-subitems.open {
  max-height: 400px;
}

.mobile-nav-subitems a {
  display: block;
  padding: 10px 36px;
  color: var(--txt2);
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
  border-bottom: 1px solid var(--border2);
  transition: background 0.13s, color 0.13s;
}

.mobile-nav-subitems a:last-child {
  border-bottom: none;
}

.mobile-nav-subitems a:hover {
  background: var(--teal3);
  color: var(--teal);
}

.mobile-nav-link {
  display: block;
  padding: 13px 24px;
  color: var(--txt2);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-bottom: 1px solid var(--border2);
  transition: background 0.15s, color 0.15s;
}

.mobile-nav-link:hover {
  background: var(--s1);
  color: var(--teal);
}

.mobile-nav-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

.mobile-nav-signup {
  font-weight: 600;
  color: var(--txt);
}

.mobile-nav-signin {
  color: var(--teal);
  font-weight: 700;
  background: var(--teal3);
}

/* ── Footer ──────────────────────────────────── */
footer {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 0 0 24px;
  margin-top: auto;
}

.footer-tagline {
  border-bottom: 1px solid var(--border);
  padding: 18px 28px;
  text-align: center;
}

.footer-tagline p {
  max-width: 1200px;
  margin: 0 auto;
  font-size: 12px;
  font-style: italic;
  color: var(--muted);
  letter-spacing: 0.2px;
}

.footer-main {
  padding: 40px 28px 0;
}

.footer-disclaimer {
  max-width: 1200px;
  margin: 0 auto;
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  padding: 16px 0 0;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: 1.4fr repeat(4, 1fr);
  gap: 40px;
}

.footer-links-grid {
  display: contents;
}

.footer-section h3 {
  font-weight: 600;
  font-size: 14px;
  color: var(--txt);
  margin-bottom: 16px;
}

.footer-section p {
  font-size: 11px;
  color: var(--txt2);
  line-height: 1.65;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: var(--txt2);
  text-decoration: none;
  font-size: 11px;
  transition: color 0.15s;
}

.footer-links a:hover {
  color: var(--teal);
}

.footer-bottom {
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-copyright {
  font-size: 10px;
  color: var(--muted);
}

.footer-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── Badges ──────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.badge-hipaa {
  background: var(--green2);
  color: var(--green);
}

.badge-fhir {
  background: var(--teal2);
  color: var(--teal);
}

.badge-irb {
  background: var(--amber2);
  color: var(--amber);
}

/* ── Utility ─────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-actions {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .mobile-nav {
    display: flex;
  }

  .header-content {
    padding: 14px 20px;
  }

  .footer-content {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .footer-links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
  }

  .footer-tagline {
    padding: 14px 20px;
  }

  .footer-main {
    padding: 28px 20px 0;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .footer-links-grid {
    grid-template-columns: 1fr 1fr;
  }
}
