/* Seção sobre o desafio estrutural da prática médica. */
.challenge-section {
  padding: var(--page-section-space-top) 0 var(--page-section-space-bottom);
}

/* Container alinhado ao grid principal da landing. */
.challenge-shell {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

/* Desktop em duas colunas com arte à esquerda e copy à direita. */
.challenge-layout {
  display: grid;
  grid-template-columns: 653px 564px;
  grid-template-areas:
    "visual intro"
    "visual copy";
  align-items: center;
  gap: 0 64px;
  justify-content: center;
}

/* Bloco superior com título e texto curto. */
.challenge-intro {
  grid-area: intro;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 26px;
  width: 564px;
}

/* Bloco visual com backdrop ciano e imagem da médica. */
.challenge-visual {
  grid-area: visual;
  position: relative;
  width: 653px;
  height: 520px;
}

/* Fundo ciano arredondado atrás da personagem. */
.challenge-visual__backdrop {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 403px;
  border-radius: 45px;
  background: #57d4ff;
}

/* Arte principal da seção. */
.challenge-visual__image {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 519px;
  display: block;
  object-fit: cover;
  border-radius: 45px;
}

/* Pills flutuantes cinza-azul seguindo a lógica do frame mobile. */
.challenge-pill {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: 98px;
  background: #64748b;
  color: #fff;
  font-family: "Muring Text", system-ui, sans-serif;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  transform-origin: center;
  will-change: transform;
}

.challenge-pill img {
  width: 16px;
  height: 16px;
  margin-right: 10px;
  display: block;
}

.challenge-pill--time {
  top: 150px;
  left: 46px;
  animation: challenge-float-a 7.2s ease-in-out infinite;
}

.challenge-pill--energy {
  top: 80px;
  right: 62px;
  animation: challenge-float-b 8.4s ease-in-out infinite;
}

.challenge-pill--repeat {
  right: 120px;
  bottom: 100px;
  animation: challenge-float-c 7.8s ease-in-out infinite;
}

@keyframes challenge-float-a {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  25% {
    transform: translate3d(4px, -8px, 0) rotate(-0.8deg);
  }

  55% {
    transform: translate3d(-5px, -14px, 0) rotate(0.9deg);
  }

  80% {
    transform: translate3d(3px, -5px, 0) rotate(-0.4deg);
  }
}

@keyframes challenge-float-b {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  20% {
    transform: translate3d(-4px, -6px, 0) rotate(0.6deg);
  }

  50% {
    transform: translate3d(6px, -13px, 0) rotate(-0.9deg);
  }

  78% {
    transform: translate3d(-3px, -4px, 0) rotate(0.4deg);
  }
}

@keyframes challenge-float-c {
  0%,
  100% {
    transform: translate3d(0, 0, 0) rotate(0deg);
  }

  28% {
    transform: translate3d(5px, -9px, 0) rotate(0.8deg);
  }

  58% {
    transform: translate3d(-4px, -15px, 0) rotate(-0.7deg);
  }

  84% {
    transform: translate3d(2px, -6px, 0) rotate(0.3deg);
  }
}

/* Coluna textual. */
.challenge-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 30px;
  width: 564px;
}

/* Título em gradiente. */
.challenge-title {
  width: 564px;
  margin: 0;
  font-family: "Muring Display", system-ui, sans-serif;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.356;
  letter-spacing: 0.76px;
  background: linear-gradient(160deg, #57d4ff 0%, #845cff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Texto introdutório mais curto. */
.challenge-lead {
  width: 564px;
  margin: 0;
  color: #64748b;
  font-family: "Muring Text", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.47;
}

/* Texto longo explicativo. */
.challenge-description {
  width: 564px;
  margin: 0;
  color: #64748b;
  font-family: "Muring Text", system-ui, sans-serif;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.47;
}

/* CTA da seção. */
.challenge-cta__label {
  width: 198px;
}

/* Tablet: empilha conteúdo com o visual acima. */
@media (max-width: 1024px) {
  .challenge-shell {
    width: min(100%, calc(100% - 40px));
  }

  .challenge-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "visual"
      "copy";
    gap: 36px;
    justify-items: center;
  }

  .challenge-intro,
  .challenge-copy {
    width: min(720px, 100%);
    align-items: center;
    text-align: center;
  }

  .challenge-visual {
    width: min(720px, 100%);
  }
}

/* Mobile: segue o frame com ordem título, subtítulo, imagem, texto e CTA. */
@media (max-width: 480px) {
  .challenge-shell {
    width: min(335px, calc(100% - 32px));
  }

  .challenge-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "intro"
      "visual"
      "copy";
    gap: 19px;
  }

  .challenge-intro {
    width: 327px;
    gap: 19px;
    align-items: center;
    text-align: center;
  }

  .challenge-copy {
    width: 335px;
    gap: 19px;
    align-items: center;
    text-align: center;
  }

  .challenge-title {
    width: 299px;
    font-size: 28px;
    letter-spacing: 0.56px;
  }

  .challenge-lead,
  .challenge-description {
    width: 327px;
    font-size: 16px;
    line-height: 1.47;
  }

  .challenge-description {
    width: 335px;
  }

  .challenge-visual {
    width: 321px;
    height: 261px;
  }

  .challenge-visual__backdrop {
    top: 37.68px;
    bottom: auto;
    height: 223.176px;
    border-radius: 22.121px;
  }

  .challenge-visual__image {
    width: 321px;
    height: 261px;
    border-radius: 22.121px;
  }

  .challenge-pill {
    padding: 9.832px 14.747px;
    font-size: 9.832px;
    letter-spacing: -0.2458px;
  }

  .challenge-pill img {
    width: 12px;
    height: 12px;
    margin-right: 8px;
  }

  .challenge-pill--time {
    top: 76.52px;
    left: 30.48px;
    animation: challenge-float-a 7.2s ease-in-out infinite;
  }

  .challenge-pill--energy {
    top: 27.85px;
    right: 31px;
    animation: challenge-float-b 8.4s ease-in-out infinite;
  }

  .challenge-pill--repeat {
    right: 64px;
    bottom: 46px;
    animation: challenge-float-c 7.8s ease-in-out infinite;
  }

  .challenge-cta {
    width: 272.308px;
    height: 66.294px;
    padding: 12.43px;
    gap: 7.136px;
  }

  .challenge-cta__label {
    width: 198.879px;
    font-size: 14.92px;
    letter-spacing: 0.2984px;
  }

  .challenge-cta__icon,
  .challenge-cta__icon img {
    width: 41.433px;
    height: 41.433px;
    flex-basis: 41.433px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .challenge-pill {
    animation: none;
  }
}
