/* =========================================================
   MedSim — Tibbi Simulyasiya Mərkəzi
   Rənglər: #469cdd (primary) / #5cbacd (secondary)
   ========================================================= */

:root {
  --primary: #469cdd;
  --primary-dark: #2f7fbd;
  --secondary: #5cbacd;
  --secondary-dark: #3f9aad;
  --navy: #16324a;
  --slate: #5b7186;
  --bg: #f5fafd;
  --bg-tint: #eaf5fa;
  --white: #ffffff;
  --radius: 18px;
  --shadow-soft: 0 10px 30px -12px rgba(22, 50, 74, 0.15);
  --shadow-strong: 0 20px 45px -15px rgba(22, 50, 74, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: var(--navy);
  background: var(--bg);
  margin: 0;
  overflow-x: hidden;
}

h1,
h2,
h3,
.ms-brand-text {
  font-family: 'Space Grotesk', sans-serif;
}

a {
  text-decoration: none;
}

::selection {
  background: var(--primary);
  color: #fff;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary), var(--secondary));
  border-radius: 10px;
}

/* =========================== Reveal on scroll =========================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================== Navbar =========================== */
.ms-navbar {
  background: rgba(245, 250, 253, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 16px 0;
  transition: all .35s ease;
  border-bottom: 1px solid transparent;
}

.ms-navbar.scrolled {
  background: rgba(255, 255, 255, 0.92);
  padding: 10px 0;
  border-bottom: 1px solid rgba(22, 50, 74, 0.06);
  box-shadow: 0 8px 24px -16px rgba(22, 50, 74, 0.25);
}

.ms-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--navy);
}

.ms-brand-accent {
  color: var(--primary);
}

.navbar-toggler {
  border-color: rgba(22, 50, 74, 0.25) !important;
  box-shadow: none !important;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2822, 50, 74, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

.ms-brand-icon {
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 1.1rem;
  box-shadow: var(--shadow-soft);
}

.ms-link {
  color: var(--navy) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 8px 14px !important;
  border-radius: 999px;
  transition: all .25s ease;
  position: relative;
}

.ms-link:hover,
.ms-link.active {
  color: var(--primary-dark) !important;
  background: var(--bg-tint);
}

.ms-btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff !important;
  border: none;
  font-weight: 600;
  box-shadow: 0 10px 25px -8px rgba(70, 156, 221, 0.55);
  transition: transform .25s ease, box-shadow .25s ease;
}

.ms-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -8px rgba(70, 156, 221, 0.7);
  color: #fff;
}

.ms-btn-outline {
  border: 1.5px solid var(--primary);
  color: var(--primary-dark) !important;
  font-weight: 600;
  background: transparent;
  transition: all .25s ease;
}

.ms-btn-outline:hover {
  background: var(--primary);
  color: #fff !important;
  transform: translateY(-2px);
}

/* =========================== Hero =========================== */
.ms-hero {
  position: relative;
  padding-top: 90px;
  overflow: hidden;
}

.ms-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(92, 186, 205, 0.25), transparent 45%),
    radial-gradient(circle at 10% 85%, rgba(70, 156, 221, 0.22), transparent 45%),
    var(--bg);
  z-index: -1;
}

.ms-eyebrow {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary-dark);
  background: var(--bg-tint);
  padding: 8px 16px;
  border-radius: 999px;
}

.ms-eyebrow--dark {
  background: var(--bg-tint);
  color: var(--primary-dark);
}

.ms-eyebrow--light {
  background: rgba(255, 255, 255, 0.1);
  color: var(--secondary);
}

.ms-h1 {
  font-weight: 700;
  font-size: clamp(2.2rem, 4.2vw, 3.4rem);
  line-height: 1.15;
  color: var(--navy);
}

.ms-underline {
  position: relative;
  color: var(--primary-dark);
}

.ms-lead {
  font-size: 1.1rem;
  color: var(--slate);
  max-width: 560px;
}

.ms-hero-visual {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
}

.ms-hero-img {
  width: 100%;
  border-radius: 28px;
  box-shadow: var(--shadow-strong);
  aspect-ratio: 4/3.4;
  object-fit: cover;
}

.ms-float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 18px;
  box-shadow: var(--shadow-strong);
  animation: floaty 5s ease-in-out infinite;
}

.ms-float-card--1 {
  top: -18px;
  left: -18px;
  animation-delay: 0s;
}

.ms-float-card--2 {
  bottom: -18px;
  right: -18px;
  animation-delay: 1.2s;
}

.ms-float-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tint);
  color: var(--primary-dark);
  font-size: 1.2rem;
}

.ms-float-num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  line-height: 1;
}

.ms-float-label {
  font-size: 0.78rem;
  color: var(--slate);
}

@keyframes floaty {

  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

/* Heartbeat / ECG imza xətti */
.ms-pulse-divider {
  width: 100%;
  line-height: 0;
  margin-top: 40px;
}

.ms-pulse-svg {
  width: 100%;
  height: 60px;
  display: block;
}

#pulsePath {
  stroke-dasharray: 1400;
  stroke-dashoffset: 1400;
  animation: drawPulse 3.2s ease-in-out infinite;
}

@keyframes drawPulse {
  0% {
    stroke-dashoffset: 1400;
  }

  60% {
    stroke-dashoffset: 0;
  }

  100% {
    stroke-dashoffset: -1400;
  }
}

/* =========================== Stats strip =========================== */
.ms-stats-strip {
  background: var(--white);
  padding: 42px 0;
  border-bottom: 1px solid rgba(22, 50, 74, 0.06);
}

.ms-stat {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2.2rem;
  background: linear-gradient(135deg, var(--primary-dark), var(--secondary-dark));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ms-stat-label {
  color: var(--slate);
  font-size: 0.9rem;
  margin-top: 4px;
}

/* =========================== Sections =========================== */
.ms-section {
  padding: 100px 0;
}

.ms-section--tint {
  background: var(--bg-tint);
}

.ms-section--dark {
  background: linear-gradient(160deg, var(--navy) 0%, #1c3f5c 100%);
  color: #fff;
}

.ms-section-head {
  max-width: 640px;
}

.ms-h2 {
  font-weight: 700;
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  color: var(--navy);
  line-height: 1.25;
}

.ms-h2--light {
  color: #fff;
}

.ms-body-text {
  color: var(--slate);
  font-size: 1.02rem;
  line-height: 1.7;
}

.ms-body-text--light {
  color: #b9cbdb;
}

/* About */
.ms-about-visual {
  position: relative;
  padding: 0 20px 40px 0;
}

.ms-about-img--1 {
  width: 100%;
  border-radius: 22px;
  box-shadow: var(--shadow-strong);
  aspect-ratio: 5/4;
  object-fit: cover;
}

.ms-about-img--2 {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 52%;
  border-radius: 18px;
  border: 5px solid var(--bg);
  box-shadow: var(--shadow-strong);
  aspect-ratio: 4/3;
  object-fit: cover;
}

.ms-feature {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.ms-feature i {
  font-size: 1.2rem;
  color: var(--primary-dark);
  background: var(--bg-tint);
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ms-feature-title {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--navy);
}

.ms-feature-text {
  font-size: 0.85rem;
  color: var(--slate);
}

/* Service cards */
.ms-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 34px 28px;
  height: 100%;
  box-shadow: var(--shadow-soft);
  transition: transform .3s ease, box-shadow .3s ease;
  border: 1px solid rgba(22, 50, 74, 0.05);
}

.ms-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-strong);
}

.ms-card-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 18px;
}

.ms-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 10px;
}

.ms-card-text {
  color: var(--slate);
  font-size: 0.92rem;
  line-height: 1.6;
  margin: 0;
}

/* Gallery */
.ms-gallery-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 4/3;
}

.ms-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.ms-gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(22, 50, 74, 0) 40%, rgba(22, 50, 74, 0.75) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  padding: 14px;
  color: #fff;
  font-size: 1.3rem;
  opacity: 0;
  transition: opacity .3s ease;
}

.ms-gallery-item:hover img {
  transform: scale(1.08);
}

.ms-gallery-item:hover .ms-gallery-overlay {
  opacity: 1;
}

.ms-lightbox-content {
  background: transparent;
  border: none;
  padding: 10px;
}

.ms-lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  filter: invert(1);
}

.ms-lightbox-caption {
  color: #fff;
  font-weight: 500;
}

/* Results */
.ms-result-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  height: 100%;
}

.ms-result-num {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 2.1rem;
  background: linear-gradient(135deg, #7fc4ec, var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.ms-result-label {
  color: #b9cbdb;
  font-size: 0.85rem;
  margin-top: 6px;
  min-height: 40px;
}

.ms-progress {
  height: 6px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  margin-top: 14px;
  overflow: hidden;
}

.ms-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 10px;
  transition: width 1.4s ease;
}

.ms-testimonial-wrap {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.ms-testimonial {
  padding: 0 20px;
}

.ms-quote-icon {
  font-size: 2.2rem;
  color: var(--secondary);
}

.ms-testimonial-text {
  font-size: 1.15rem;
  line-height: 1.7;
  color: #e7eef5;
  margin-top: 10px;
}

.ms-testimonial-author {
  font-weight: 700;
  margin-top: 18px;
  color: #fff;
}

.ms-testimonial-role {
  font-size: 0.85rem;
  color: #9fb7cb;
}

.ms-testimonial-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  margin-top: 24px;
}

.ms-carousel-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s ease;
}

.ms-carousel-btn:hover {
  background: var(--primary);
  border-color: var(--primary);
}

.ms-carousel-indicators {
  position: static;
  margin: 0;
}

.ms-carousel-indicators button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  opacity: 1;
  border: none;
}

.ms-carousel-indicators button.active {
  background: var(--secondary);
  width: 22px;
  border-radius: 5px;
}

/* Contact */
.ms-contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ms-contact-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.ms-contact-icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.ms-contact-title {
  font-weight: 700;
  color: var(--navy);
  font-size: 0.95rem;
}

.ms-contact-text {
  color: var(--slate);
  font-size: 0.88rem;
}

.ms-social {
  display: flex;
  gap: 10px;
}

.ms-social a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-tint);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .25s ease;
}

.ms-social a:hover {
  background: var(--primary);
  color: #fff;
  transform: translateY(-3px);
}

.ms-contact-form {
  background: #fff;
  border-radius: var(--radius);
  padding: 34px;
  box-shadow: var(--shadow-soft);
}

.ms-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
  display: block;
}

.ms-input {
  border: 1.5px solid #dbe7f0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 0.92rem;
  background: var(--bg);
}

.ms-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(70, 156, 221, 0.12);
  background: #fff;
}

.was-validated .ms-input:invalid,
.ms-input.is-invalid {
  border-color: #e57373;
}

.ms-error {
  display: none;
  color: #d9534f;
  font-size: 0.78rem;
  margin-top: 4px;
}

.is-invalid~.ms-error,
.ms-input.is-invalid+.ms-error {
  display: block;
}

.ms-form-success {
  background: #e6f6ea;
  color: #2e7d32;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 0.9rem;
}

.ms-map-wrap {
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
}

.ms-map-wrap iframe {
  width: 100%;
  height: 340px;
  border: 0;
  display: block;
  filter: saturate(0.9);
}

/* Footer */
.ms-footer {
  background: #0f2438;
  color: #b9cbdb;
  padding: 70px 0 30px;
}

.ms-brand--footer {
  color: #fff;
}

.ms-footer-text {
  font-size: 0.88rem;
  max-width: 300px;
}

.ms-footer-title {
  color: #fff;
  font-weight: 700;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.ms-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ms-footer-links a {
  color: #b9cbdb;
  font-size: 0.88rem;
  transition: color .2s ease;
}

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

.ms-newsletter {
  display: flex;
  gap: 8px;
}

.ms-newsletter input {
  flex: 1;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
  padding: 10px 14px;
  font-size: 0.85rem;
}

.ms-newsletter input::placeholder {
  color: #7f97ab;
}

.ms-newsletter button {
  width: 42px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.ms-footer-divider {
  border-color: rgba(255, 255, 255, 0.1);
  margin: 40px 0 20px;
}

.ms-footer-copy {
  font-size: 0.8rem;
  color: #7f97ab;
}

/* Back to top */
.ms-back-to-top {
  position: fixed;
  bottom: 26px;
  right: 26px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 1.1rem;
  box-shadow: var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all .3s ease;
  z-index: 999;
}

.ms-back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* =========================== Navbar collapse — sağlamlıq təminatı =========================== */
/* Masaüstü (>=992px): menyu həmişə üfüqi və görünən olmalıdır */
@media (min-width: 992px) {
  .navbar-collapse {
    display: flex !important;
    flex-basis: auto;
  }

  .navbar-nav {
    flex-direction: row;
  }
}

/* Mobil (<992px): açılan menyu kart şəklində, JS ilə .show sinifi idarə edir */
@media (max-width: 991px) {
  .navbar-collapse {
    background: #fff;
    margin-top: 14px;
    padding: 18px;
    border-radius: 16px;
    box-shadow: var(--shadow-strong);
    position: relative;
    z-index: 1040;
  }

  .navbar-nav {
    width: 100%;
  }

  .navbar-nav .nav-item {
    width: 100%;
  }

  .ms-link {
    display: block;
    width: 100%;
  }

  .navbar-nav .nav-item.ms-2 {
    margin-top: 10px;
    margin-left: 0 !important;
  }

  .navbar-nav .nav-item.ms-2 .btn {
    display: inline-flex;
  }

  .ms-section {
    padding: 70px 0;
  }
}