/* ==========================================================================
   Medsewa – homepage enhancements
   All selectors are prefixed with .ms- so they can't clash with main.css.
   Patterns adapted from 21st.dev / Magic UI / Aceternity ideas
   (spotlight cards, marquee, shimmer button, animated accordion,
   scroll-linked timeline) rebuilt in plain CSS + JS.
   ========================================================================== */

:root {
  --ms-navy: #02015a;
  --ms-navy-2: #17177a;
  --ms-ink: #14163a;
  --ms-muted: #5b6082;
  --ms-line: #e3e6f3;
  --ms-tint: #f2f5ff;
  --ms-teal: #0f8f83;
  --ms-teal-tint: #e6f6f4;
  --ms-radius-lg: 22px;
  --ms-radius-md: 14px;
  --ms-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Scroll progress bar ---------- */
.ms-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 10000;
  transform-origin: 0 50%;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--ms-navy), var(--ms-teal));
  pointer-events: none;
}

/* ---------- Shimmer button (hover sheen) ---------- */
.ms-shimmer {
  position: relative;
  overflow: hidden;
}
.ms-shimmer::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, 0.35) 50%, transparent 65%);
  transform: translateX(-120%);
  transition: transform 0.8s var(--ms-ease);
  pointer-events: none;
}
.ms-shimmer:hover::after {
  transform: translateX(120%);
}

/* ---------- Generic buttons used in the new sections ---------- */
.ms-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 26px;
  border-radius: 999px;
  border: 1.5px solid var(--ms-navy);
  background: var(--ms-navy);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, transform 0.2s var(--ms-ease);
}
.ms-btn:hover {
  background: var(--ms-navy-2);
  color: #fff;
  transform: translateY(-1px);
}
.ms-btn.alt {
  background: #fff;
  color: var(--ms-navy);
}
.ms-btn.alt:hover {
  background: var(--ms-tint);
  color: var(--ms-navy);
}
.ms-btn:focus-visible,
.ms-faq-q:focus-visible,
.ms-field input:focus-visible,
.ms-field select:focus-visible,
.ms-field textarea:focus-visible {
  outline: 3px solid rgba(2, 1, 90, 0.35);
  outline-offset: 2px;
}

/* ---------- Section spacing ---------- */
.ms-sec {
  padding: 100px 0;
}
.ms-sec-tint {
  background: var(--ms-tint);
}

/* ---------- Specialties marquee ---------- */
.ms-marquee {
  background: #fff;
  border-bottom: 1px solid var(--ms-line);
  padding: 34px 0 30px;
  overflow: hidden;
}
.ms-marquee-title {
  text-align: center;
  color: var(--ms-muted);
  font-size: 0.95rem;
  margin: 0 0 18px;
}
.ms-marquee-row {
  display: flex;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ms-marquee-row + .ms-marquee-row {
  margin-top: 12px;
}
.ms-marquee-track {
  display: flex;
  flex: none;
  min-width: 100%;
  gap: 12px;
  padding-right: 12px;
  justify-content: space-around;
  animation: ms-scroll 45s linear infinite;
}
.ms-marquee-row.rev .ms-marquee-track {
  animation-direction: reverse;
  animation-duration: 55s;
}
.ms-marquee:hover .ms-marquee-track {
  animation-play-state: paused;
}
@keyframes ms-scroll {
  to {
    transform: translateX(-100%);
  }
}
.ms-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border: 1px solid var(--ms-line);
  border-radius: 999px;
  background: #fff;
  color: var(--ms-ink);
  font-weight: 500;
  white-space: nowrap;
}
.ms-chip::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ms-teal);
}

/* ---------- Bento services grid with cursor spotlight ---------- */
.ms-bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 18px;
}
.ms-tile {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  grid-column: span 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 28px;
  background: #fff;
  border: 1px solid var(--ms-line);
  border-radius: var(--ms-radius-lg);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.ms-tile.w4 {
  grid-column: span 4;
}
.ms-tile.w6 {
  grid-column: span 6;
}
.ms-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.3s;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(2, 1, 90, 0.09), transparent 60%);
}
.ms-tile:hover {
  border-color: #c5cbec;
  box-shadow: 0 14px 34px -18px rgba(2, 1, 90, 0.35);
}
.ms-tile:hover::before {
  opacity: 1;
}
.ms-ico {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--ms-tint);
  color: var(--ms-navy);
  margin-bottom: 8px;
}
.ms-ico svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ms-tile h4 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--ms-ink);
}
.ms-tile p {
  margin: 0;
  color: var(--ms-muted);
  font-size: 0.97rem;
  line-height: 1.6;
}
.ms-tile-link {
  margin-top: auto;
  padding-top: 8px;
  font-weight: 600;
  font-size: 0.93rem;
  color: var(--ms-navy);
  text-decoration: none;
}
.ms-tile-link:hover {
  text-decoration: underline;
}
/* Featured tile */
.ms-tile.feat {
  background: var(--ms-navy);
  border-color: var(--ms-navy);
}
.ms-tile.feat::before {
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.14), transparent 60%);
}
.ms-tile.feat .ms-ico {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}
.ms-tile.feat h4,
.ms-tile.feat p,
.ms-tile.feat .ms-tile-link {
  color: #fff;
}
.ms-tile.feat p {
  opacity: 0.85;
}
/* Horizontal tile (icon left) */
.ms-tile.row {
  flex-direction: row;
  align-items: flex-start;
  gap: 18px;
}
.ms-tile.row .ms-ico {
  flex: none;
  margin: 0;
}
.ms-tile.row .ms-tile-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------- Journey timeline (scroll-linked) ---------- */
.ms-journey {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 72px;
  align-items: start;
}
.ms-journey-aside {
  position: sticky;
  top: 120px;
}
.ms-journey-aside p {
  color: var(--ms-muted);
  margin: 0 0 28px;
  max-width: 44ch;
}
.ms-rail {
  position: relative;
  padding-left: 68px;
}
.ms-rail-line,
.ms-rail-fill {
  position: absolute;
  left: 19px;
  top: 20px;
  width: 2px;
  border-radius: 2px;
}
.ms-rail-line {
  height: calc(100% - 40px);
  background: var(--ms-line);
}
.ms-rail-fill {
  height: 0;
  background: linear-gradient(var(--ms-navy), var(--ms-teal));
}
.ms-step {
  position: relative;
  padding-bottom: 46px;
}
.ms-step:last-child {
  padding-bottom: 0;
}
.ms-step-dot {
  position: absolute;
  left: -68px;
  top: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid var(--ms-line);
  color: var(--ms-muted);
  font-weight: 700;
  transition: background 0.35s, border-color 0.35s, color 0.35s;
}
.ms-step-dot svg {
  display: none;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ms-step.is-done .ms-step-dot {
  background: var(--ms-navy);
  border-color: var(--ms-navy);
  color: #fff;
}
.ms-step.is-done .ms-step-dot span {
  display: none;
}
.ms-step.is-done .ms-step-dot .i-check {
  display: block;
}
.ms-step.is-active .ms-step-dot {
  box-shadow: 0 0 0 6px rgba(2, 1, 90, 0.14);
}
.ms-step.is-active .ms-step-dot .i-check {
  display: none;
}
.ms-step.is-active .ms-step-dot .i-plane {
  display: block;
  transform: rotate(135deg);
}
.ms-step h4 {
  margin: 4px 0 6px;
  font-size: 1.25rem;
  color: var(--ms-ink);
}
.ms-step p {
  margin: 0 0 10px;
  color: var(--ms-muted);
  max-width: 52ch;
}
.ms-tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--ms-tint);
  color: var(--ms-navy);
}
.ms-tag.clinical {
  background: var(--ms-teal-tint);
  color: var(--ms-teal);
}

/* ---------- Who does what (split panels) ---------- */
.ms-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.ms-panel {
  border-radius: var(--ms-radius-lg);
  padding: 38px;
}
.ms-panel.does {
  background: var(--ms-tint);
}
.ms-panel.decides {
  background: #fff;
  border: 1px solid var(--ms-line);
}
.ms-panel h3 {
  font-size: 1.4rem;
  margin: 0 0 6px;
  color: var(--ms-ink);
}
.ms-panel > p {
  margin: 0 0 22px;
  color: var(--ms-muted);
}
.ms-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.ms-list li {
  position: relative;
  padding-left: 34px;
  color: var(--ms-ink);
  line-height: 1.5;
}
.ms-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--ms-teal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat;
}
.ms-panel.decides .ms-list li::before {
  background: #fff;
  border: 2px solid var(--ms-navy);
}

/* ---------- Quick enquiry ---------- */
.ms-enq {
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 64px;
  align-items: center;
}
.ms-enq-copy p {
  color: var(--ms-muted);
  max-width: 46ch;
}
.ms-enq-copy .ms-list {
  margin-top: 22px;
}
.ms-form {
  background: #fff;
  border: 1px solid var(--ms-line);
  border-radius: var(--ms-radius-lg);
  padding: 34px;
  box-shadow: 0 24px 50px -30px rgba(2, 1, 90, 0.35);
}
.ms-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.ms-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ms-field.full {
  grid-column: 1 / -1;
}
.ms-field label {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--ms-ink);
}
.ms-field input,
.ms-field select,
.ms-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--ms-line);
  border-radius: 12px;
  background: #fff;
  color: var(--ms-ink);
  font: inherit;
  transition: border-color 0.2s;
}
.ms-field input:hover,
.ms-field select:hover,
.ms-field textarea:hover {
  border-color: #c5cbec;
}
.ms-field input:focus,
.ms-field select:focus,
.ms-field textarea:focus {
  border-color: var(--ms-navy);
}
/* Keep the native select (the theme's nice-select plugin would otherwise replace it) */
.ms-form select {
  display: block !important;
}
.ms-form .nice-select {
  display: none !important;
}
.ms-field textarea {
  min-height: 96px;
  resize: vertical;
}
.ms-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}
.ms-form-note {
  margin: 16px 0 0;
  font-size: 0.87rem;
  color: var(--ms-muted);
}
.ms-form-note.ok {
  color: var(--ms-teal);
  font-weight: 600;
}

/* ---------- FAQ accordion ---------- */
.ms-faq {
  max-width: 820px;
  margin: 0 auto;
  display: grid;
  gap: 12px;
}
.ms-faq-item {
  background: #fff;
  border: 1px solid var(--ms-line);
  border-radius: var(--ms-radius-md);
  transition: border-color 0.25s, box-shadow 0.25s;
}
.ms-faq-item.is-open {
  border-color: #c5cbec;
  box-shadow: 0 12px 30px -20px rgba(2, 1, 90, 0.4);
}
.ms-faq-q {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  background: none;
  border: 0;
  border-radius: var(--ms-radius-md);
  text-align: left;
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--ms-ink);
  cursor: pointer;
}
.ms-faq-q .ms-plus {
  position: relative;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ms-tint);
}
.ms-faq-q .ms-plus::before,
.ms-faq-q .ms-plus::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 12px;
  height: 2px;
  margin: -1px 0 0 -6px;
  background: var(--ms-navy);
  border-radius: 2px;
  transition: transform 0.3s var(--ms-ease);
}
.ms-faq-q .ms-plus::after {
  transform: rotate(90deg);
}
.ms-faq-item.is-open .ms-plus::after {
  transform: rotate(0deg);
}
.ms-faq-a {
  display: grid;
  grid-template-rows: 0fr;
  visibility: hidden;
  transition: grid-template-rows 0.35s var(--ms-ease), visibility 0s 0.35s;
}
.ms-faq-item.is-open .ms-faq-a {
  grid-template-rows: 1fr;
  visibility: visible;
  transition: grid-template-rows 0.35s var(--ms-ease), visibility 0s;
}
.ms-faq-a > div {
  overflow: hidden;
}
.ms-faq-a p {
  margin: 0;
  padding: 0 24px 22px;
  color: var(--ms-muted);
  line-height: 1.7;
  max-width: 70ch;
}
.ms-faq-a a {
  color: var(--ms-navy);
  font-weight: 600;
}

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .ms-sec {
    padding: 72px 0;
  }
  .ms-tile,
  .ms-tile.w4 {
    grid-column: span 6;
  }
  .ms-tile.feat {
    grid-column: span 12;
  }
  .ms-journey,
  .ms-enq {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .ms-journey-aside {
    position: static;
  }
  .ms-split {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 575px) {
  .ms-sec {
    padding: 56px 0;
  }
  .ms-tile,
  .ms-tile.w4,
  .ms-tile.w6 {
    grid-column: span 12;
  }
  .ms-form {
    padding: 22px;
  }
  .ms-form-grid {
    grid-template-columns: 1fr;
  }
  .ms-panel {
    padding: 26px;
  }
  .ms-rail {
    padding-left: 60px;
  }
  .ms-step-dot {
    left: -60px;
  }
  .ms-btn {
    width: 100%;
  }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .ms-marquee-track {
    animation: none;
  }
  .ms-marquee-track[aria-hidden="true"] {
    display: none;
  }
  .ms-marquee-row {
    overflow-x: auto;
    -webkit-mask-image: none;
    mask-image: none;
  }
  .ms-shimmer::after,
  .ms-faq-a,
  .ms-faq-q .ms-plus::before,
  .ms-faq-q .ms-plus::after,
  .ms-step-dot {
    transition: none;
  }
}

/* ---------- Callout (About page) ---------- */
.ms-callout {
  margin-top: 28px;
  padding: 20px 24px;
  background: var(--ms-teal-tint);
  border-left: 4px solid var(--ms-teal);
  border-radius: 0 var(--ms-radius-md) var(--ms-radius-md) 0;
}
.ms-callout strong {
  display: block;
  font-size: 1.15rem;
  color: var(--ms-ink);
  margin-bottom: 4px;
}
.ms-callout span {
  color: var(--ms-muted);
  line-height: 1.6;
}
