/* MedBud public site styles. Shared by the landing page and legal pages so the
   app-hosted web content stays visually consistent with the Flutter app. */

:root {
  color-scheme: dark;
  --bg: #0c0d0f;
  --bg-soft: #202328;
  --card: #15171a;
  --card-border: #353a40;
  --text: #f1f3f5;
  --muted: #a8adb4;
  --accent: #1389dc;
  --on-accent: #00243f;
  --shadow: none;
}

:root[data-theme='light'] {
  color-scheme: light;
  --bg: #f7f7f8;
  --bg-soft: #f0f1f3;
  --card: #ffffff;
  --card-border: #dadde1;
  --text: #1d2025;
  --muted: #676c74;
  --accent: #0b63c7;
  --on-accent: #ffffff;
  --shadow: none;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

body::before {
  display: none;
}

a {
  color: var(--accent);
}

.page {
  position: relative;
  padding: 56px 20px 72px;
}

.shell {
  max-width: 960px;
  margin: 0 auto;
}

.legal-page .shell {
  max-width: 920px;
}

.hero {
  margin-bottom: 24px;
}

.home-page .hero {
  margin-bottom: 0;
  padding-bottom: 36px;
}

.app-icon {
  display: block;
  width: 84px;
  height: 84px;
  border-radius: 24px;
  border: 1px solid var(--card-border);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
}

.home-page .app-icon {
  margin-inline-start: -2px;
}

.eyebrow {
  margin: 0 0 10px;
  display: inline-block;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.product-name {
  margin: 18px 0 10px;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.18em;
  line-height: 1.2;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2.1rem, 4vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: 0;
}

.home-page h1 {
  max-width: 760px;
  font-size: clamp(2.15rem, 4.6vw, 4rem);
  line-height: 1.05;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.16rem;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

p {
  margin: 0 0 12px;
  color: var(--text);
}

ul {
  margin: 0 0 12px;
  padding-left: 22px;
}

li {
  margin: 0 0 8px;
}

strong {
  font-weight: 700;
}

/* Feature flags arrive in the URL from the app. Hide unavailable legal clauses
   before first paint so disabled Premium or ads never flash on screen. */
html[data-premium='off'] [data-requires-premium],
html[data-ads='off'] [data-requires-ads] {
  display: none;
}

html:not([data-premium='off']) [data-no-premium],
html:not([data-ads='off']) [data-no-ads] {
  display: none;
}

.subtitle {
  max-width: 68ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.05rem;
}

.lede {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 1.06rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 28px;
  padding: clamp(24px, 4vw, 44px);
  box-shadow: var(--shadow);
}

.updated {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

section {
  margin-top: 28px;
}

.home-page section {
  margin-top: 0;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  color: inherit;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  border-color: transparent;
  background: var(--accent);
  color: var(--on-accent);
}

.btn-ghost {
  background: var(--card);
  color: var(--text);
}

.btn svg {
  width: 17px;
  height: 17px;
}

.accent-bar {
  width: 58px;
  height: 4px;
  margin-top: 36px;
  border-radius: 999px;
  background: var(--accent);
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.feature-grid .card {
  border-radius: 22px;
  padding: 22px;
}

.feature-grid .card p {
  margin: 8px 0 0;
  color: var(--muted);
}

.note {
  margin-top: 18px;
  color: var(--muted);
  font-size: 0.94rem;
}

.site-footer {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 42px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
}

.footer-note {
  margin-top: 32px;
  padding-top: 22px;
  border-top: 1px solid var(--card-border);
  color: var(--muted);
  font-size: 0.95rem;
}

/* Knowledge center, feature guides, and shared public navigation. */
.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  border-bottom: 1px solid var(--card-border);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(14px);
}

.nav-container {
  display: flex;
  align-items: center;
  gap: 24px;
  width: min(1100px, calc(100% - 40px));
  min-height: 70px;
  margin: 0 auto;
}

.nav-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 800;
  text-decoration: none;
}

.nav-brand img {
  width: 34px;
  height: 34px;
  border: 1px solid var(--card-border);
  border-radius: 10px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  margin-left: auto;
}

.nav-link {
  padding: 8px 11px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: var(--bg-soft);
}

.nav-cta {
  min-height: 40px;
  padding-inline: 16px;
}

.shell-narrow {
  max-width: 860px;
}

.shell-article {
  max-width: 820px;
}

.article-hero {
  margin-bottom: 32px;
}

.article-hero .lede {
  max-width: 70ch;
}

.faq-category {
  margin-top: 42px;
}

.faq-category h2 {
  margin-bottom: 14px;
  font-size: 1.28rem;
}

.faq-list {
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 22px;
  background: var(--card);
}

.faq-item + .faq-item {
  border-top: 1px solid var(--card-border);
}

.faq-item summary {
  position: relative;
  padding: 20px 54px 20px 22px;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  font-weight: 750;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  position: absolute;
  top: 50%;
  right: 22px;
  content: '+';
  color: var(--accent);
  font-size: 1.35rem;
  transform: translateY(-50%);
}

.faq-item[open] summary::after {
  content: '−';
}

.faq-answer {
  padding: 0 22px 18px;
}

.faq-answer p {
  margin: 0;
  color: var(--muted);
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 270px;
  border-radius: 22px;
  padding: 24px;
}

.blog-card h2 {
  margin: 12px 0 10px;
  font-size: 1.2rem;
  line-height: 1.3;
}

.blog-card p:not(.blog-meta) {
  color: var(--muted);
}

.blog-card > a {
  margin-top: 18px;
  font-weight: 800;
  text-decoration: none;
}

.blog-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 700;
}

.blog-meta span:first-child {
  color: var(--accent);
}

.article-content h2 {
  margin-top: 34px;
  font-size: 1.32rem;
}

.article-content h2:first-child {
  margin-top: 0;
}

.article-content h3 {
  margin-bottom: 10px;
}

.article-content p,
.article-content li {
  color: var(--muted);
}

.article-content strong,
.article-content th {
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
  margin: 18px 0;
  border: 1px solid var(--card-border);
  border-radius: 16px;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--card-border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--bg-soft);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.comparison-grid > div,
.legal-callout {
  padding: 18px;
  border: 1px solid var(--card-border);
  border-radius: 16px;
  background: var(--bg-soft);
}

.legal-callout {
  margin-top: 24px;
  color: var(--muted);
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid var(--card-border);
}

.page-footer {
  padding: 0 20px 48px;
}

.page-footer .site-footer {
  margin-top: 0;
}

@media (min-width: 700px) {
  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (max-width: 640px) {
  .page {
    padding: 24px 14px 56px;
  }

  .home-page .page {
    padding-top: 28px;
  }

  .home-page .hero {
    padding-bottom: 28px;
  }

  .app-icon {
    width: 76px;
    height: 76px;
    border-radius: 22px;
  }

  .card {
    border-radius: 22px;
    padding: 20px;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }

  .nav-container {
    width: calc(100% - 28px);
    min-height: 62px;
  }

  .nav-links {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .nav-links::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    white-space: nowrap;
  }

  /* The row scrolls, so the last item is meant to be half-visible. A hard cut
     reads as a broken layout; a fade reads as "there is more this way". */
  .nav-links {
    min-width: 0;
    -webkit-mask-image: linear-gradient(to right, #000 84%, transparent);
    mask-image: linear-gradient(to right, #000 84%, transparent);
  }

  .nav-brand {
    flex: 0 0 auto;
  }

  .nav-cta {
    display: none;
  }

  .site-header .btn,
  .article-actions .btn {
    width: auto;
  }

  .blog-grid,
  .comparison-grid {
    grid-template-columns: 1fr;
  }

  .blog-card {
    min-height: 0;
  }
}
