:root {
  --tiix-red: #871312;
  --tiix-red-dark: #75100f;
  --white: #fff;
  --focus: #d2ae6d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  color-scheme: light;
}

body {
  margin: 0;
  color: var(--tiix-red);
  background: var(--white);
  font-family: "Outfit", sans-serif;
  -webkit-font-smoothing: antialiased;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.download-duo {
  width: 100%;
  min-height: clamp(520px, 50.8vw, 820px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.download-product {
  min-width: 0;
  min-height: inherit;
  overflow: hidden;
  display: grid;
  grid-template-rows: 54% 46%;
}

.download-product--patient {
  color: var(--white);
  background: var(--tiix-red);
  grid-template-rows: 52.2% 47.8%;
}

.download-product--professional {
  color: var(--tiix-red);
  background: var(--white);
  grid-template-rows: 53.54% 46.46%;
}

.download-product__preview {
  --preview-phone-width: clamp(166px, 16.1vw, 260px);
  --preview-phone-half: clamp(83px, 8.05vw, 130px);
  --preview-arrow-size: clamp(30px, 2.5vw, 40px);
  --preview-arrow-gap: clamp(10px, 0.87vw, 14px);
  position: relative;
  min-height: 0;
  overflow: hidden;
}

.download-product__preview::after {
  position: absolute;
  z-index: 2;
  inset: auto 0 0;
  height: 42%;
  content: "";
  pointer-events: none;
}

.download-product--patient .download-product__preview::after {
  background: linear-gradient(to bottom, transparent, var(--tiix-red) 78%);
}

.download-product--professional .download-product__preview::after {
  background: linear-gradient(to bottom, transparent, var(--white) 78%);
}

.phone {
  position: absolute;
  top: clamp(16px, 1.65vw, 27px);
  left: 50%;
  width: var(--preview-phone-width);
  aspect-ratio: 0.488;
  overflow: hidden;
  border: clamp(5px, 0.5vw, 8px) solid #292a2d;
  border-radius: clamp(29px, 2.8vw, 45px);
  background: #fff;
  box-shadow: 0 12px 28px rgb(0 0 0 / 16%);
  transform: translateX(-50%);
}

.phone img {
  width: 100%;
  height: auto;
}

.service-phone {
  position: absolute;
  top: clamp(16px, 1.65vw, 27px);
  left: 50%;
  width: var(--preview-phone-width);
  aspect-ratio: 9 / 19.27;
  overflow: hidden;
  padding: 0;
  border: clamp(6px, 0.557vw, 9px) solid #2a2a2a;
  border-radius: clamp(31px, 2.972vw, 48px);
  outline: 0;
  background: #1a1a1a;
  box-shadow:
    0 30px 70px rgb(0 0 0 / 45%),
    0 0 0 1px rgb(255 255 255 / 8%) inset;
  transform: translateX(-50%);
  cursor: grab;
  touch-action: pan-y;
}

.service-phone:active {
  cursor: grabbing;
}

.service-phone:focus-visible {
  box-shadow:
    0 30px 70px rgb(0 0 0 / 45%),
    0 0 0 1px rgb(255 255 255 / 8%) inset,
    0 0 0 3px var(--focus);
}

.service-phone::before {
  position: absolute;
  z-index: 7;
  top: clamp(8px, 0.743vw, 12px);
  left: 50%;
  width: clamp(56px, 5.45vw, 88px);
  height: clamp(11px, 1.115vw, 18px);
  border-radius: 100px;
  background: #000;
  content: "";
  transform: translateX(-50%);
  pointer-events: none;
}

.service-phone__screen {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: clamp(25px, 2.378vw, 38.4px);
  background: #f7f7f9;
}

.phone--professional {
  aspect-ratio: 0.455;
}

.pro-service-phone {
  aspect-ratio: 412 / 905;
}

.pro-service-phone::before {
  display: none;
}

.pro-service-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 412px;
  height: 905px;
  overflow: hidden;
  background: #f5f6fa;
  transform: scale(var(--pro-stage-scale, 0.45));
  transform-origin: top left;
}

.pro-service-slide {
  position: absolute;
  z-index: 1;
  inset: 0;
  margin: 0;
  overflow: hidden;
  background: #f5f6fa;
  opacity: 0;
  transform: translateX(14%) scale(0.985);
  transform-origin: center center;
  transition:
    opacity 420ms ease,
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.pro-service-phone[data-direction="previous"] .pro-service-slide:not(.is-active) {
  transform: translateX(-14%) scale(0.985);
}

.pro-service-slide.is-active {
  z-index: 2;
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.pro-service-slide__screen-source {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center top;
}

.pro-service-slide__device-source {
  position: absolute;
  top: -146px;
  width: 2000px;
  height: auto;
  max-width: none;
}

.pro-service-slide__device-source--left {
  left: -341px;
}

.pro-service-slide__device-source--right {
  left: -1263px;
}

.pro-service-slide--dashboard {
  padding-top: 118px;
  background:
    linear-gradient(var(--tiix-red), var(--tiix-red)) 0 0 / 100% 84px no-repeat,
    #f2f5fb;
}

.pro-service-slide--dashboard::before {
  position: absolute;
  z-index: 2;
  top: 20px;
  left: 50%;
  width: 92px;
  height: 22px;
  border-radius: 999px;
  background: #080808;
  content: "";
  transform: translateX(-50%);
}

.pro-service-slide--dashboard::after {
  position: absolute;
  top: 48px;
  left: 0;
  width: 100%;
  color: #fff;
  content: "Visão do negócio";
  font-size: 18px;
  font-weight: 500;
  text-align: center;
}

.pro-service-slide__dashboard-source {
  position: absolute;
  top: 118px;
  left: -22%;
  width: 144%;
  height: auto;
  max-width: none;
  filter: saturate(0.96);
}

.pro-service-slide--finance::before {
  position: absolute;
  z-index: 3;
  top: 12px;
  left: 50%;
  width: 92px;
  height: 22px;
  border-radius: 999px;
  background: #080808;
  content: "";
  transform: translateX(-50%);
}

.phone__statusbar {
  position: absolute;
  z-index: 6;
  top: 0;
  left: 0;
  width: 100%;
  height: 44px;
  padding: 0 21px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #1f1f1f;
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  pointer-events: none;
}

.phone__status-icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.phone__status-icons svg {
  width: 17px;
  height: auto;
  fill: currentColor;
}

.phone__status-icons svg:nth-child(2) {
  width: 16px;
}

.phone__status-icons svg:last-child {
  width: 25px;
}

.phone__journey-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: 412px;
  height: 892px;
  overflow: hidden;
  transform: scale(var(--journey-stage-scale, 0.45));
  transform-origin: top left;
}

.phone__journey {
  position: absolute;
  inset: 0;
}

.phone__journey {
  z-index: 1;
  margin: 0;
  overflow: hidden;
  background: #fff;
  opacity: 0;
  transform: translateX(14%) scale(0.985);
  transform-origin: center center;
  transition:
    opacity 420ms ease,
    transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
  pointer-events: none;
}

.service-phone[data-direction="previous"] .phone__journey:not(.is-active) {
  transform: translateX(-14%) scale(0.985);
}

.phone__journey.is-active {
  z-index: 2;
  opacity: 1;
  transform: translateX(0) scale(1);
  pointer-events: auto;
}

.phone__journey-content-window {
  position: absolute;
  z-index: 1;
  top: var(--journey-top);
  bottom: var(--journey-bottom);
  left: 50%;
  width: 100%;
  overflow: hidden;
  background: #f7f7fb;
  transform: translateX(-50%);
}

.phone__journey-content {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  margin-inline: auto;
  object-position: center top;
}

.phone__journey[data-journey-fit="cover"] .phone__journey-content {
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.phone__journey-chrome {
  position: absolute;
  z-index: 3;
  left: 50%;
  width: 100%;
  max-width: none;
  object-fit: contain;
  object-position: center;
  transform: translateX(-50%);
  pointer-events: none;
}

.phone__journey-chrome--top {
  top: 0;
}

.phone__journey-chrome--bottom {
  bottom: 0;
}

.preview-arrow {
  /* Removidas do visual a pedido do Lucas — carrossel segue navegável por
     teclado (setas ←/→ com o card em foco) e por swipe/arraste; os botões
     continuam no DOM só porque o JS depende deles existirem (ver guarda em
     cta-download-app.js), mas não aparecem nem recebem foco. */
  display: none;
}

button.preview-arrow {
  cursor: pointer;
}

button.preview-arrow:hover {
  filter: drop-shadow(0 5px 10px rgb(0 0 0 / 18%));
  transform: translateY(-50%) scale(1.07);
}

button.preview-arrow:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.preview-arrow--previous {
  left: calc(
    50% - var(--preview-phone-half) - var(--preview-arrow-gap) - var(--preview-arrow-size)
  );
}

.preview-arrow--previous img {
  transform: rotate(180deg);
}

.preview-arrow--next {
  right: calc(
    50% - var(--preview-phone-half) - var(--preview-arrow-gap) - var(--preview-arrow-size)
  );
}

.preview-arrow img {
  width: 100%;
  height: 100%;
}

.download-product__content {
  min-height: 0;
  padding: 0 clamp(28px, 2.75vw, 44px) clamp(28px, 2.75vw, 44px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.download-product__title {
  min-height: clamp(52px, 5vw, 81px);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.22em;
  font-size: clamp(39px, 3.95vw, 64px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.035em;
  white-space: nowrap;
}

.download-product__logo {
  flex: 0 0 auto;
  object-fit: contain;
}

.download-product__logo--tiix {
  width: clamp(78px, 7.9vw, 127px);
  height: clamp(51px, 5.15vw, 83px);
  /* Encaixe óptico: desce a logo para casar a base do "iix" com a
     baseline do texto do título. */
  transform: translateY(6%);
}

.download-product__logo--pro {
  width: clamp(94px, 9.1vw, 147px);
  max-height: clamp(43px, 4.3vw, 70px);
}

/* Tagline do público-alvo, acima do título. */
.download-product__tagline {
  margin: 0 0 clamp(2px, 0.3vw, 6px);
  text-align: center;
  font-size: clamp(14px, 1.15vw, 19px);
  font-weight: 300;
  letter-spacing: 0.04em;
  line-height: 1;
}

.download-product--patient .download-product__tagline {
  color: rgb(255 255 255 / 78%);
}

.download-product--professional .download-product__tagline {
  color: var(--tiix-red);
}

.download-product__description {
  max-width: 680px;
  margin: clamp(2px, 0.3vw, 6px) auto 0;
  text-align: center;
  font-size: clamp(15px, 1.25vw, 20px);
  font-weight: 300;
  line-height: 1.1;
}

.download-product__description--journey {
  min-height: clamp(58px, 4.3vw, 70px);
  display: grid;
  align-content: start;
  gap: 3px;
}

.download-product__description--journey strong,
.download-product__description--journey span {
  display: block;
}

.download-product__description--journey strong {
  font-size: 1.08em;
  font-weight: 500;
}

body.is-option-b .download-product__content {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  justify-items: center;
  align-items: start;
  display: grid;
}

body.is-option-b .download-product__secondary {
  align-self: start;
  justify-self: center;
}

body.is-option-b .download-product__description {
  width: min(100%, 680px);
  margin: 0;
  align-self: center;
  justify-self: center;
  text-align: center;
}

body.is-option-b .download-product__description--journey {
  align-content: center;
  justify-items: center;
}

body.is-option-b .download-product__title {
  gap: 0.22em;
  font-size: clamp(31px, 3.15vw, 51px);
}

body.is-option-b .download-product__logo--tiix {
  width: clamp(70px, 6.7vw, 108px);
  height: clamp(46px, 4.42vw, 71px);
}

body.is-option-b .download-product__logo--pro {
  width: clamp(84px, 7.95vw, 128px);
}

body.is-option-b .download-product__button {
  margin-top: 0;
  align-self: end;
  justify-self: center;
}

.download-product__button {
  min-width: clamp(116px, 9vw, 145px);
  min-height: clamp(45px, 3.45vw, 56px);
  margin-top: auto;
  padding: 8px 24px;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: clamp(20px, 1.85vw, 30px);
  font-weight: 400;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 3px 8px rgb(0 0 0 / 15%);
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.download-product--patient .download-product__button {
  color: var(--tiix-red);
  background: var(--white);
}

.download-product--professional .download-product__button {
  color: var(--white);
  background: var(--tiix-red);
}

.download-product__button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgb(0 0 0 / 18%);
}

.download-product--professional .download-product__button:hover {
  background: var(--tiix-red-dark);
}

.download-product__button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

/* CTA secundário: download para quem já tem cadastro (hierarquia menor
   que o botão Cadastrar). */
.download-product__secondary {
  margin-top: clamp(10px, 1vw, 16px);
  align-self: center;
  max-width: 58ch;
  text-wrap: balance;
  text-align: center;
  font-size: clamp(13px, 1.05vw, 17px);
  font-weight: 300;
  line-height: 1.3;
  text-decoration: none;
  transition: opacity 180ms ease;
}

.download-product__secondary strong {
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.download-product--patient .download-product__secondary {
  color: rgb(255 255 255 / 85%);
}

.download-product--professional .download-product__secondary {
  color: var(--tiix-red);
}

.download-product__secondary:hover {
  opacity: 0.75;
}

.download-product__secondary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
  border-radius: 4px;
}

@media (max-width: 1023px) {
  .download-product__description {
    max-width: 44ch;
    line-height: 1.2;
  }
}

@media (max-width: 767px) {
  .download-duo {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .download-product {
    min-height: 680px;
    grid-template-rows: 360px 320px;
  }

  .download-product__preview {
    --preview-phone-width: 194px;
    --preview-phone-half: 97px;
  }

  .phone {
    top: 24px;
    width: 194px;
    border-width: 6px;
    border-radius: 34px;
  }

  .service-phone {
    top: 24px;
    border-width: 7px;
    border-radius: 36px;
  }

  .service-phone::before {
    top: 9px;
    width: 66px;
    height: 13px;
  }

  .service-phone__screen {
    border-radius: 29px;
  }

  body.is-option-b .download-product__title {
    font-size: clamp(29px, 8.15vw, 37px);
  }

  body.is-option-b .download-product__logo--tiix {
    width: 78px;
    height: 52px;
  }

  body.is-option-b .download-product__logo--pro {
    width: 94px;
  }

  .preview-arrow {
    top: 58%;
    width: 38px;
    height: 38px;
  }

  .download-product__content {
    padding: 0 24px 30px;
  }

  .download-product__title {
    min-height: 62px;
    font-size: clamp(36px, 10.2vw, 44px);
  }

  .download-product__logo--tiix {
    width: 88px;
    height: 58px;
  }

  .download-product__logo--pro {
    width: 104px;
  }

  .download-product__description {
    max-width: 34ch;
    font-size: 16px;
    line-height: 1.3;
  }

  .download-product__button {
    width: auto;
    min-width: 124px;
    min-height: 48px;
    font-size: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .phone__journey,
  .pro-service-slide,
  .preview-arrow {
    transition: none;
  }

  .download-product__button,
  .download-product__secondary {
    transition: none;
  }
}
