/* Static MedSahi homepage. Scoped so Flutter routes are unaffected. */

html.medsahi-html-home,
html.medsahi-html-seo {
  height: 100%;
}

html.medsahi-html-home body,
html.medsahi-html-seo body {
  margin: 0;
  min-height: 100%;
  background: #e0f7f4;
  color: #111827;
  font-family: 'Noto Sans', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

#medsahi-homepage {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.ms-header {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 24px 8px;
  isolation: isolate;
}

.ms-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
}

.ms-logo-mark {
  flex: 0 0 auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.18),
    0 0 26px -4px rgba(46, 49, 146, 0.28);
  text-decoration: none;
}

.ms-logo-mark img {
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.ms-nav-pill {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 16px;
  background: #fff;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
  max-width: calc(100% - 60px);
}

.ms-nav-link {
  flex: 0 0 auto;
  padding: 6px 8px;
  color:#555555;
  font-size: 15px;
  font-weight: 400;
  text-decoration: none;
  border-radius: 999px;
  white-space: nowrap;
}

.ms-nav-link:hover {
  background: rgba(0, 0, 0, 0.06);
}

.ms-menu-btn {
  display: none;
  margin-left: auto;
  width: 36px;
  height: 36px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: #fff;
  color: #111827;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  padding: 0;
  place-items: center;
}

.ms-menu-btn .ms-icon-close {
  display: none;
}

.ms-menu-btn.is-open {
  border-color: #059669;
  color: #059669;
}

.ms-menu-btn.is-open .ms-icon-menu {
  display: none;
}

.ms-menu-btn.is-open .ms-icon-close {
  display: block;
}

.ms-mobile-menu {
  position: absolute;
  top: 56px;
  right: 16px;
  width: 210px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  z-index: 30;
}

.ms-mobile-menu a {
  display: block;
  padding: 12px 16px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
}

.ms-mobile-menu a:hover {
  background: #ecfdf5;
  color: #059669;
}

.ms-mobile-menu hr {
  margin: 0;
  border: 0;
  border-top: 1px solid #f1f5f9;
}

.ms-main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 24px 0;
  box-sizing: border-box;
}

.ms-hero {
  text-align: center;
}

.ms-hero-logo {
  height: 104px;
  width: auto;
  max-width: min(320px, 80vw);
  object-fit: contain;
  display: block;
  margin: 0 auto 28px;
}

.ms-hero h1 {
  margin: 0 0 20px;
  font-size: 28px;
  font-weight: 700;
  color: #111827;
  line-height: 1.25;
}

.ms-lead,
.ms-sublead {
  margin: 0 auto;
  max-width: 768px;
  color: #111827;
  line-height: 1.6;
}

.ms-lead {
  font-size: 18px;
}

.ms-sublead {
  margin-top: 16px;
  font-size: 16px;
}

.ms-accent {
  color: #059669;
}

.ms-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin: 64px 0;
}

.ms-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 320px;
  padding: 28px;
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 44px;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.1),
    0 4px 14px rgba(0, 0, 0, 0.05);
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.ms-card:hover,
.ms-card:focus-visible {
  transform: translateY(-2px);
}

.ms-card-patient:hover,
.ms-card-patient:focus-visible {
  border-color: #059669;
  border-width: 1.5px;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.14),
    0 6px 18px rgba(5, 150, 105, 0.22);
}

.ms-card-provider:hover,
.ms-card-provider:focus-visible {
  border-color: #3b82f6;
  border-width: 1.5px;
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.14),
    0 6px 18px rgba(59, 130, 246, 0.22);
}

.ms-card-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #2e3192;
  color: #fff;
  display: grid;
  place-items: center;
}

.ms-card h2 {
  margin: 20px 0 8px;
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  text-align: center;
}

.ms-card-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  color: #111827;
  text-align: center;
}

.ms-card-rule {
  width: 68%;
  max-width: 340px;
  margin: 24px auto 20px;
  border: 0;
  border-top: 1px solid rgba(226, 232, 240, 0.85);
}

.ms-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  width: min(72%, 360px);
}

.ms-card li {
  position: relative;
  padding: 0 0 12px 16px;
  font-size: 13px;
  line-height: 1.4;
  color: #111827;
  text-align: left;
}

.ms-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #374151;
}

.ms-footer {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 32px 24px 8px;
  text-align: center;
}

.ms-footer-links {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ms-footer-links a {
  font-size: 12px;
  color: #6b7280;
  text-decoration: none;
}

.ms-footer-links a:hover {
  text-decoration: underline;
}

.ms-copyright {
  margin: 0;
  padding: 4px 0;
  font-size: 10px;
  letter-spacing: 0.5px;
  color: #9ca3af;
  border-top: 1px solid #e5e7eb;
}

.ms-portal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(224, 247, 244, 0.92);
  text-align: center;
}

.ms-portal-overlay[hidden] {
  display: none !important;
}

.ms-portal-overlay img {
  height: 56px;
  width: auto;
  margin-bottom: 32px;
}

.ms-portal-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(5, 150, 105, 0.2);
  border-top-color: #059669;
  border-radius: 50%;
  animation: medsahi-spin 0.85s linear infinite;
}

.ms-portal-overlay-title {
  margin: 24px 0 8px;
  font-size: 18px;
  font-weight: 600;
  color: #111827;
}

.ms-portal-overlay-sub {
  margin: 0;
  font-size: 14px;
  color: #9ca3af;
}

@media (max-width: 1023px) {
  .ms-nav-pill {
    display: none;
  }

  .ms-menu-btn {
    display: grid;
  }

  .ms-header {
    padding: 12px 16px 8px;
  }
}

@media (min-width: 1024px) {
  .ms-mobile-menu {
    display: none !important;
  }
}

@media (max-width: 639px) {
  .ms-cards {
    grid-template-columns: 1fr;
  }

  .ms-hero h1 {
    font-size: 24px;
  }

  .ms-lead {
    font-size: 16px;
  }
}

@media (prefers-color-scheme: dark) {
  html.medsahi-html-home body,
  html.medsahi-html-seo body {
    background: #121212;
    color: #f1f5f9;
  }

  .ms-logo-mark,
  .ms-nav-pill,
  .ms-menu-btn,
  .ms-mobile-menu,
  .ms-card {
    background: #1e293b;
  }

  .ms-nav-link,
  .ms-hero h1,
  .ms-lead,
  .ms-sublead,
  .ms-card h2,
  .ms-card-desc,
  .ms-card li,
  .ms-portal-overlay-title {
    color: #f1f5f9;
  }

  .ms-nav-link:hover {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
  }

  .ms-mobile-menu {
    border-color: #334155;
  }

  .ms-mobile-menu a {
    color: #e2e8f0;
  }

  .ms-mobile-menu a:hover {
    background: rgba(52, 211, 153, 0.15);
    color: #34d399;
  }

  .ms-mobile-menu hr {
    border-top-color: #253348;
  }

  .ms-accent {
    color: #34d399;
  }

  .ms-card {
    border-color: #334155;
  }

  .ms-card-rule {
    border-top-color: #334155;
  }

  .ms-card li::before {
    background: #94a3b8;
  }

  .ms-footer-links a {
    color: #94a3b8;
  }

  .ms-copyright {
    color: #64748b;
    border-top-color: #334155;
  }

  .ms-portal-overlay {
    background: rgba(18, 18, 18, 0.92);
  }
}
