/* Mirrors the My Hospital app theme (apps/mobile/src/index.css): Geist, indigo primary, 0.75rem radius. */
@font-face {
  font-family: "Geist";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/assets/geist-latin.woff2") format("woff2");
}

:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.205 0 0);
  --card: oklch(1 0 0);
  --primary: oklch(0.488 0.243 264.376);
  --primary-foreground: oklch(0.985 0 0);
  --primary-soft: oklch(0.488 0.243 264.376 / 8%);
  --muted: oklch(0.968 0.007 247.896);
  --muted-foreground: oklch(0.446 0.03 256.802);
  --border: oklch(0.922 0 0);
  --success: oklch(0.627 0.194 149.214);
  --warning: oklch(0.769 0.188 70.08);
  --radius: 0.75rem;
  --shadow: 0 1px 2px oklch(0 0 0 / 4%), 0 4px 16px oklch(0 0 0 / 4%);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --background: oklch(0.145 0 0);
    --foreground: oklch(0.985 0 0);
    --card: oklch(0.205 0 0);
    --primary: oklch(0.623 0.214 259.815);
    --primary-foreground: oklch(0.985 0 0);
    --primary-soft: oklch(0.623 0.214 259.815 / 14%);
    --muted: oklch(0.269 0 0);
    --muted-foreground: oklch(0.708 0 0);
    --border: oklch(1 0 0 / 10%);
    --success: oklch(0.723 0.191 149.214);
    --warning: oklch(0.828 0.189 84.429);
    --shadow: none;
    color-scheme: dark;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--foreground);
  background:
    radial-gradient(ellipse 80% 50% at 20% 0%, var(--primary-soft), transparent 70%) no-repeat,
    var(--background);
  font-family: "Geist", "Noto Sans Bengali", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--primary);
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

code {
  font-size: 0.875em;
  background: var(--muted);
  padding: 2px 6px;
  border-radius: 6px;
}

.skip-link {
  position: absolute;
  left: -999px;
  z-index: 100;
}

.skip-link:focus {
  left: 16px;
  top: 16px;
  padding: 8px 12px;
  background: var(--primary);
  color: var(--primary-foreground);
  border-radius: var(--radius);
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in oklab, var(--background) 80%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
}

.brand img {
  display: block;
  height: 34px;
  width: auto;
}

@media (prefers-color-scheme: dark) {
  /* The wordmark is black; give it a light plate so it stays legible. */
  .brand img {
    background: oklch(0.985 0 0);
    padding: 3px 8px;
    border-radius: 8px;
    height: 36px;
  }
}

.site-nav {
  display: flex;
  gap: 4px;
}

.site-nav a {
  color: var(--muted-foreground);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--foreground);
  background: var(--muted);
}

.site-nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
}

@media (max-width: 520px) {
  .site-nav a {
    padding: 6px 8px;
    font-size: 0.85rem;
  }
  .brand img {
    height: 28px;
  }
}

/* Hero */
.hero {
  padding: 40px 0 24px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid color-mix(in oklab, var(--primary) 20%, transparent);
  padding: 4px 12px;
  border-radius: 999px;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

h1 {
  font-size: clamp(1.9rem, 5vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
  margin: 16px 0 8px;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted-foreground);
  max-width: 62ch;
  margin: 0 0 12px;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin: 0;
}

/* Layout */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  padding-bottom: 48px;
}

@media (min-width: 960px) {
  .layout {
    grid-template-columns: 240px minmax(0, 1fr);
    align-items: start;
  }
  .toc {
    position: sticky;
    top: 88px;
  }
  .toc details > summary {
    pointer-events: none;
  }
  .toc details > summary::after {
    display: none;
  }
  /* Always show the contents on wide screens, even though it starts collapsed for phones. */
  .toc details::details-content {
    content-visibility: visible;
    display: block;
  }
}

.content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  min-width: 0;
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.4);
  box-shadow: var(--shadow);
  padding: 20px 24px;
}

@media (max-width: 520px) {
  .card {
    padding: 18px 16px;
  }
}

.card > :first-child {
  margin-top: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

h2 {
  font-size: 1.25rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

h2 .num {
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 8px;
  transform: translateY(-2px);
}

h3 {
  font-size: 1rem;
  margin: 20px 0 6px;
}

ul,
ol {
  padding-left: 22px;
  margin: 8px 0;
}

li {
  margin: 4px 0;
}

li::marker {
  color: var(--muted-foreground);
}

/* Summary / callouts */
.highlight {
  background: var(--primary-soft);
  border-color: color-mix(in oklab, var(--primary) 25%, transparent);
}

.highlight h2 {
  color: var(--primary);
}

.check-list {
  list-style: none;
  padding: 0;
}

.check-list li {
  position: relative;
  padding-left: 28px;
  margin: 8px 0;
}

.check-list li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 0.45em;
  width: 14px;
  height: 8px;
  border-left: 2.5px solid var(--success);
  border-bottom: 2.5px solid var(--success);
  transform: rotate(-45deg);
}

.note {
  border-left: 3px solid var(--warning);
  background: var(--muted);
  padding: 12px 16px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 12px 0;
}

/* Table of contents */
.toc details {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) * 1.4);
  box-shadow: var(--shadow);
  padding: 14px 18px;
}

.toc summary {
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
}

.toc summary::-webkit-details-marker {
  display: none;
}

.toc summary::after {
  content: "+";
  color: var(--muted-foreground);
}

.toc details[open] summary::after {
  content: "–";
}

.toc ol {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  font-size: 0.875rem;
}

.toc a {
  display: block;
  color: var(--muted-foreground);
  text-decoration: none;
  padding: 5px 8px;
  border-radius: 8px;
}

.toc a:hover {
  color: var(--foreground);
  background: var(--muted);
}

/* Tables */
.table-scroll {
  overflow-x: auto;
  margin: 12px -4px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 0.925rem;
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}

tr:last-child td {
  border-bottom: 0;
}

th {
  background: var(--muted);
  font-weight: 600;
  font-size: 0.85rem;
}

td:first-child {
  font-weight: 600;
  white-space: nowrap;
}

/* Steps */
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 44px;
  margin: 14px 0;
  min-height: 30px;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: -2px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--primary-foreground);
  background: var(--primary);
  border-radius: 50%;
}

/* Buttons */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
  background: var(--primary);
  color: var(--primary-foreground);
}

.button:hover {
  filter: brightness(1.08);
}

.button.secondary {
  background: var(--muted);
  color: var(--foreground);
}

/* Landing cards */
.tiles {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  padding-bottom: 48px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--foreground);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.tile:hover {
  border-color: var(--primary);
}

.tile .icon {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 6px;
}

.tile strong {
  font-size: 1.05rem;
}

.tile span {
  color: var(--muted-foreground);
  font-size: 0.925rem;
}

.tile .more {
  margin-top: auto;
  padding-top: 8px;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.9rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 28px;
}

.site-footer a {
  color: var(--muted-foreground);
}

@media print {
  body {
    background: #fff;
  }
  .site-header,
  .toc,
  .skip-link,
  .actions {
    display: none;
  }
  .layout {
    display: block;
  }
  .card {
    box-shadow: none;
    break-inside: avoid;
  }
}

.page-end {
  padding-bottom: 48px;
}
