/* Your Journey to World-Class Care — animated homepage timeline */

.journey-care-section {
  position: relative;
  padding: 5rem 0 4.5rem;
  background: linear-gradient(180deg, #f7fafc 0%, #ffffff 42%, #f4f8fb 100%);
  overflow: hidden;
}

.journey-care-section__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.journey-care-section__grid {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(0, 102, 204, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 102, 204, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 80% 70% at 50% 40%, #000 20%, transparent 75%);
}

.journey-care-section__glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.45;
  animation: journeyGlowDrift 12s ease-in-out infinite alternate;
}

.journey-care-section__glow--left {
  top: 8%;
  left: -8%;
  background: rgba(0, 102, 204, 0.12);
}

.journey-care-section__glow--right {
  bottom: 5%;
  right: -6%;
  background: rgba(45, 143, 111, 0.14);
  animation-delay: -4s;
}

.journey-care-section .container {
  position: relative;
  z-index: 1;
}

/* Header */
.journey-care-header {
  margin-bottom: 0.5rem;
}

.journey-care__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1rem;
  border-radius: 999px;
  background: rgba(0, 102, 204, 0.08);
  color: var(--primary-color, #0066cc);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.journey-care__title {
  font-size: clamp(1.75rem, 3.2vw, 2.65rem);
  font-weight: 800;
  color: #0f1f3d;
  line-height: 1.2;
  margin: 1rem 0 0.75rem;
}

.journey-care__subtitle {
  max-width: 720px;
  margin: 0 auto;
  color: #5c6b7f;
  font-size: 1.05rem;
  line-height: 1.7;
}

.journey-care__heartbeat {
  display: block;
  width: min(280px, 70%);
  height: 48px;
  margin: 1.35rem auto 0;
  overflow: visible;
}

.journey-care__heartbeat-line {
  fill: none;
  stroke: url(#journeyHeartbeatGradient);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  opacity: 0.85;
}

.journey-care-section.is-animated .journey-care__heartbeat-line {
  animation: journeyHeartbeatDraw 2.2s ease forwards 0.4s,
    journeyHeartbeatPulse 2.4s ease-in-out 2.8s infinite;
}

/* Timeline grid */
.journey-care-timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1.1rem;
  margin-top: 2.75rem;
  padding-top: 0.25rem;
}

.journey-care-timeline__connectors {
  position: absolute;
  top: 4.1rem;
  left: 0;
  right: 0;
  width: 100%;
  height: 72px;
  z-index: 0;
  pointer-events: none;
}

.journey-care-timeline__path {
  fill: none;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
}

.journey-care-timeline__path--a {
  stroke: url(#journeyConnectorBlue);
}

.journey-care-timeline__path--b {
  stroke: url(#journeyConnectorGreen);
}

.journey-care-timeline__path--c {
  stroke: url(#journeyConnectorBlue);
}

.journey-care-section.is-animated .journey-care-timeline__path--a {
  animation: journeyPathDraw 1.8s ease forwards 0.9s;
}

.journey-care-section.is-animated .journey-care-timeline__path--b {
  animation: journeyPathDraw 1.8s ease forwards 1.35s;
}

.journey-care-section.is-animated .journey-care-timeline__path--c {
  animation: journeyPathDraw 1.8s ease forwards 1.8s;
}

/* Step card */
.journey-care-step {
  position: relative;
  z-index: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.journey-care-step__badge {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.82rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 0.65rem;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
  transform: scale(0);
  opacity: 0;
}

.journey-care-section.is-animated .journey-care-step__badge {
  animation: journeyBadgePop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: calc(0.55s + var(--step-index) * 0.14s);
}

.journey-care-step--blue .journey-care-step__badge {
  background: linear-gradient(135deg, #0066cc, #00b4d8);
}

.journey-care-step--green .journey-care-step__badge {
  background: linear-gradient(135deg, #2d8f6f, #3cb58a);
}

.journey-care-step__icon-wrap {
  position: relative;
  z-index: 2;
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 14px 34px rgba(15, 31, 61, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: -2.35rem;
  transform: translateY(24px) scale(0.85);
  opacity: 0;
}

.journey-care-section.is-animated .journey-care-step__icon-wrap {
  animation: journeyIconReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.65s + var(--step-index) * 0.14s);
}

.journey-care-section.is-animated .journey-care-step__icon {
  animation: journeyIconFloat 4.5s ease-in-out calc(1.5s + var(--step-index) * 0.2s) infinite;
}

.journey-care-step:hover .journey-care-step__card {
  box-shadow: 0 22px 48px rgba(0, 102, 204, 0.14);
}

.journey-care-step__icon-ring {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid transparent;
  opacity: 0;
}

.journey-care-section.is-animated .journey-care-step--blue .journey-care-step__icon-ring {
  border-color: rgba(0, 102, 204, 0.25);
  animation: journeyRingPulse 2.8s ease-out infinite;
  animation-delay: calc(1.2s + var(--step-index) * 0.18s);
}

.journey-care-section.is-animated .journey-care-step--green .journey-care-step__icon-ring {
  border-color: rgba(45, 143, 111, 0.28);
  animation: journeyRingPulse 2.8s ease-out infinite;
  animation-delay: calc(1.2s + var(--step-index) * 0.18s);
}

.journey-care-step__icon {
  width: 3.25rem;
  height: 3.25rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.journey-care-step--blue .journey-care-step__icon {
  background: linear-gradient(145deg, rgba(0, 102, 204, 0.14), rgba(0, 180, 216, 0.2));
  color: #0066cc;
}

.journey-care-step--green .journey-care-step__icon {
  background: linear-gradient(145deg, rgba(45, 143, 111, 0.14), rgba(60, 181, 138, 0.22));
  color: #2d8f6f;
}

.journey-care-step__card {
  width: 100%;
  background: #fff;
  border-radius: 18px;
  padding: 2.85rem 0.85rem 1.15rem;
  box-shadow: 0 14px 36px rgba(15, 31, 61, 0.08);
  border: 1px solid rgba(15, 31, 61, 0.05);
  transform: translateY(28px);
  opacity: 0;
  transition: box-shadow 0.35s ease;
}

.journey-care-section.is-animated .journey-care-step__card {
  animation: journeyCardReveal 0.75s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: calc(0.8s + var(--step-index) * 0.14s);
}

.journey-care-step__title {
  font-size: 0.98rem;
  font-weight: 800;
  color: #12243f;
  line-height: 1.35;
  margin-bottom: 0.55rem;
  min-height: 2.7rem;
}

.journey-care-step__desc {
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 1rem;
  min-height: 3.9rem;
}

.journey-care-step__time {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.journey-care-step--blue .journey-care-step__time {
  background: rgba(0, 102, 204, 0.08);
  color: #0066cc;
}

.journey-care-step--green .journey-care-step__time {
  background: rgba(45, 143, 111, 0.1);
  color: #2d8f6f;
}

.journey-care-step__time i {
  font-size: 0.82rem;
  opacity: 0.9;
}

/* Urgent note */
.journey-care-urgent {
  margin-top: 3rem;
  padding: 1rem 1.35rem;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 12px 36px rgba(15, 31, 61, 0.08);
  border: 2px solid rgba(220, 53, 69, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  text-align: center;
  opacity: 0;
  transform: translateY(16px);
}

.journey-care-section.is-animated .journey-care-urgent {
  animation: journeyCardReveal 0.7s ease forwards 2.1s,
    journeyUrgentGlow 3s ease-in-out 2.8s infinite;
}

.journey-care-urgent__icon {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  flex-shrink: 0;
  animation: journeyUrgentIconPulse 2s ease-in-out infinite;
}

.journey-care-urgent__text {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #dc3545;
  letter-spacing: 0.01em;
}

/* Scroll-triggered header fades */
.journey-care-animate {
  opacity: 0;
  transform: translateY(22px);
}

.journey-care-section.is-animated .journey-care-animate--1 {
  animation: journeyFadeUp 0.65s ease forwards 0.05s;
}

.journey-care-section.is-animated .journey-care-animate--2 {
  animation: journeyFadeUp 0.65s ease forwards 0.15s;
}

.journey-care-section.is-animated .journey-care-animate--3 {
  animation: journeyFadeUp 0.65s ease forwards 0.25s;
}

/* Keyframes */
@keyframes journeyFadeUp {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes journeyHeartbeatDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes journeyHeartbeatPulse {
  0%, 100% {
    opacity: 0.75;
    filter: drop-shadow(0 0 0 transparent);
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 6px rgba(0, 102, 204, 0.35));
  }
}

@keyframes journeyPathDraw {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes journeyBadgePop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  70% {
    transform: scale(1.12);
    opacity: 1;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes journeyIconReveal {
  from {
    opacity: 0;
    transform: translateY(24px) scale(0.85);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes journeyIconFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes journeyCardReveal {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes journeyRingPulse {
  0% {
    transform: scale(1);
    opacity: 0.65;
  }
  70% {
    transform: scale(1.35);
    opacity: 0;
  }
  100% {
    transform: scale(1.35);
    opacity: 0;
  }
}

@keyframes journeyUrgentGlow {
  0%, 100% {
    box-shadow: 0 12px 36px rgba(15, 31, 61, 0.08);
    border-color: rgba(220, 53, 69, 0.15);
  }
  50% {
    box-shadow: 0 12px 36px rgba(220, 53, 69, 0.18), 0 0 0 4px rgba(220, 53, 69, 0.06);
    border-color: rgba(220, 53, 69, 0.35);
  }
}

@keyframes journeyUrgentIconPulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@keyframes journeyGlowDrift {
  from {
    transform: translate(0, 0);
  }
  to {
    transform: translate(18px, -12px);
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .journey-care-animate,
  .journey-care-step__badge,
  .journey-care-step__icon-wrap,
  .journey-care-step__icon,
  .journey-care-step__card,
  .journey-care-urgent,
  .journey-care__heartbeat-line,
  .journey-care-timeline__path {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
  }

  .journey-care-section__glow {
    animation: none;
  }
}

/* Responsive */
@media (max-width: 1199.98px) {
  .journey-care-timeline {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem 1.25rem;
  }

  .journey-care-timeline__connectors {
    display: none;
  }

  .journey-care-step__title,
  .journey-care-step__desc {
    min-height: auto;
  }
}

@media (max-width: 767.98px) {
  .journey-care-section {
    padding: 3.5rem 0 3rem;
  }

  .journey-care-timeline {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 2rem;
    padding-inline-start: 1.25rem;
    border-inline-start: 3px solid rgba(0, 102, 204, 0.15);
  }

  .journey-care-step {
    flex-direction: row;
    align-items: flex-start;
    text-align: start;
    gap: 1rem;
    padding: 1.25rem 0 1.25rem 0.5rem;
    position: relative;
  }

  .journey-care-step::before {
    content: "";
    position: absolute;
    inset-inline-start: -1.55rem;
    top: 2.5rem;
    width: 0.85rem;
    height: 0.85rem;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #0066cc;
    box-shadow: 0 0 0 4px rgba(0, 102, 204, 0.12);
  }

  .journey-care-step--green::before {
    border-color: #2d8f6f;
    box-shadow: 0 0 0 4px rgba(45, 143, 111, 0.12);
  }

  .journey-care-step__badge {
    display: none;
  }

  .journey-care-step__icon-wrap {
    width: 4.25rem;
    height: 4.25rem;
    margin-bottom: 0;
    flex-shrink: 0;
  }

  .journey-care-step__icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.1rem;
  }

  .journey-care-step__card {
    flex: 1;
    min-width: 0;
    padding: 1rem 1rem 1rem 0.75rem;
    margin-top: 0;
  }

  .journey-care-urgent {
    border-radius: 1.25rem;
    padding: 1rem 1.1rem;
  }
}

[dir="rtl"] .journey-care-step__time i {
  transform: scaleX(-1);
}
