/*!
 * Pop-up Comprove Fácil — v2
 *
 * Todas as regras ficam dentro de .cf-popup: nada aqui altera o resto do sistema.
 * Os caminhos url(...) são relativos a ESTE arquivo CSS, então mantenha a pasta
 * assets/ ao lado dele (o caminho funciona em qualquer rota do sistema).
 *
 * Para ajustar sem mexer no arquivo, sobrescreva as variáveis no seu CSS:
 *   .cf-popup { --cf-z-index: 2000; }
 */

/* Fontes locais (sem Google Fonts). Nomes próprios ("CF ...") para não
   conflitar com fontes que o sistema já carregue. Licença: SIL OFL 1.1. */
@font-face {
  font-family: "CF Open Sans";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/open-sans-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "CF Open Sans";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/open-sans-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "CF Open Sans";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/open-sans-latin-700-normal.woff2") format("woff2");
}
@font-face {
  font-family: "CF Readex Pro";
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url("assets/fonts/readex-pro-latin-300-normal.woff2") format("woff2");
}
@font-face {
  font-family: "CF Readex Pro";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("assets/fonts/readex-pro-latin-600-normal.woff2") format("woff2");
}
@font-face {
  font-family: "CF Readex Pro";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/readex-pro-latin-700-normal.woff2") format("woff2");
}

/* ---------- Variáveis e isolamento ---------- */

.cf-popup {
  --cf-z-index: 10000;
  --cf-red: #d10010;
  --cf-red-panel: #c9000f;
  --cf-white: #ffffff;
  --cf-green: #16a34a;
  --cf-font-body: "CF Open Sans", "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --cf-font-title: "CF Readex Pro", "Readex Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  /* Altura do celular acompanha a altura da tela (notebooks de 768px cabem). */
  --cf-phone-h: clamp(380px, calc(100vh - 210px), 556px);
  --cf-phone-w: calc(var(--cf-phone-h) * 0.4856);
}

/* Reset local: protege o pop-up de estilos globais do sistema (Bootstrap, resets etc.). */
.cf-popup,
.cf-popup *,
.cf-popup *::before,
.cf-popup *::after {
  box-sizing: border-box;
}

.cf-popup {
  position: fixed;
  inset: 0;
  z-index: var(--cf-z-index);
  display: grid;
  place-items: center;
  padding: 24px;
  margin: 0;
  background: rgba(17, 0, 1, 0.76);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: var(--cf-white);
  font-family: var(--cf-font-body);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: normal;
  text-align: left;
  text-transform: none;
  -webkit-font-smoothing: antialiased;
  animation: cf-fade-in 0.25s ease both;
}

.cf-popup[hidden] {
  display: none;
}

/* Reset dos elementos internos. ":where" mantém a especificidade em (0,1,0):
   vence regras globais do sistema (h2, a, button, img...) e perde para as classes abaixo. */
.cf-popup :where(h2, p, ul, li, a, span, strong, button, img, svg) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  letter-spacing: inherit;
  text-transform: none;
  text-decoration: none;
  text-shadow: none;
  float: none;
}

.cf-popup :where(ul) {
  list-style: none;
}

.cf-popup :where(img) {
  max-width: none;
}

.cf-popup :where(button) {
  -webkit-appearance: none;
  appearance: none;
  border-radius: 0;
}

.cf-popup :where(strong) {
  font-weight: 700;
}

/* ---------- Painel ---------- */

.cf-popup__panel {
  position: relative;
  width: min(1280px, 100%);
  max-height: calc(100vh - 48px);
  max-height: calc(100dvh - 48px);
  display: flex;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 20px;
  background-color: var(--cf-red-panel);
  background-image: url("assets/bg-hero-grid-lg.webp");
  background-position: center;
  background-size: cover;
  box-shadow: 0 32px 90px rgba(25, 0, 2, 0.55);
  animation: cf-panel-in 0.3s ease both;
}

.cf-popup__panel:focus {
  outline: none;
}

.cf-popup__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    radial-gradient(circle at 24% 38%, rgba(255, 255, 255, 0.12), transparent 35%),
    linear-gradient(rgba(35, 0, 3, 0.18), rgba(35, 0, 3, 0.18));
  pointer-events: none;
}

/* A rolagem fica num container interno: o botão de fechar nunca sai da tela. */
.cf-popup__scroll {
  position: relative;
  z-index: 2;
  width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.cf-popup__close {
  position: absolute;
  z-index: 4;
  top: 20px;
  right: 22px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: var(--cf-white);
  background: rgba(84, 0, 7, 0.28);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.cf-popup__close svg {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.cf-popup__close:hover {
  color: var(--cf-red);
  background: var(--cf-white);
  transform: rotate(90deg);
}

.cf-popup__close:focus-visible,
.cf-popup__cta:focus-visible,
.cf-popup__later:focus-visible,
.cf-phone__toggle:focus-visible {
  outline: 3px solid var(--cf-white);
  outline-offset: 3px;
}

/* ---------- Layout ---------- */

.cf-popup__layout {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  align-items: center;
  gap: 50px;
  padding: 54px 90px 54px 64px;
}

.cf-popup__logo {
  width: 190px;
  height: auto;
  display: block;
  margin-bottom: 34px;
}

.cf-popup__title {
  max-width: 610px;
  margin: 0 0 24px;
  color: var(--cf-white);
  font-family: var(--cf-font-title);
  font-size: clamp(34px, 3.2vw, 48px);
  font-weight: 300;
  line-height: 1.08;
  letter-spacing: -0.035em;
}

.cf-popup__title strong {
  font-weight: 700;
}

.cf-popup__tips {
  display: grid;
  gap: 13px;
  max-width: 650px;
  margin: 0 0 28px;
  list-style: none;
}

.cf-popup__tips li {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #f1f1f1;
  font-size: 14px;
  line-height: 1.5;
}

.cf-popup__check {
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--cf-green);
}

.cf-popup__check svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--cf-white);
  stroke-width: 2.5;
}

.cf-popup__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

.cf-popup__cta {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  padding: 17px 27px;
  border: 2px solid var(--cf-white);
  border-radius: 999px;
  color: #595959;
  background: var(--cf-white);
  font-family: var(--cf-font-title);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-wrap: balance;
  transition: color 0.25s ease, background 0.25s ease;
}

.cf-popup__cta-arrow {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.25s ease;
}

.cf-popup__cta:hover {
  color: var(--cf-white);
  background: transparent;
}

.cf-popup__cta:hover .cf-popup__cta-arrow {
  transform: translateX(5px);
}

.cf-popup__later {
  padding: 6px 2px;
  border: 0;
  color: rgba(255, 255, 255, 0.85);
  background: none;
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.cf-popup__later:hover {
  color: var(--cf-white);
}

/* ---------- Mockup do celular (só desktop) ---------- */

.cf-popup__media {
  position: relative;
  display: flex;
  justify-content: center;
}

.cf-popup__media::before {
  content: "";
  position: absolute;
  inset: 8% 10%;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  filter: blur(70px);
}

.cf-phone-stage {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.cf-phone {
  position: relative;
  width: var(--cf-phone-w);
  height: var(--cf-phone-h);
  padding: 10px;
  border-radius: 39px;
  background: #0d0d0d;
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.08),
    0 30px 60px rgba(0, 0, 0, 0.35),
    0 12px 24px rgba(0, 0, 0, 0.22);
}

.cf-phone__screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 29px;
  background: #f5f5f5;
}

.cf-phone__frame {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  animation: cf-frame-in 0.4s ease both;
}

.cf-phone__controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cf-phone__progress {
  display: flex;
  gap: 6px;
}

.cf-phone__progress span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  transition: width 0.25s, background 0.25s;
}

.cf-phone__progress span.is-active {
  width: 22px;
  background: var(--cf-white);
}

.cf-phone__toggle {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  color: var(--cf-white);
  background: rgba(84, 0, 7, 0.28);
  cursor: pointer;
}

.cf-phone__toggle svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
}

.cf-popup__features {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: calc(50% + var(--cf-phone-w) / 2 + 17px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 10px 8px;
  border-radius: 999px;
  background: var(--cf-white);
  box-shadow: 0 18px 38px rgba(70, 0, 6, 0.3);
  transform: translateY(calc(-50% - 21px));
}

.cf-popup__features img {
  width: 48px;
  height: 48px;
  display: block;
  border-radius: 50%;
}

/* ---------- Animações ---------- */

@keyframes cf-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes cf-panel-in {
  from { opacity: 0; transform: translateY(12px) scale(0.985); }
  to { opacity: 1; transform: none; }
}

@keyframes cf-frame-in {
  from { opacity: 0; transform: scale(1.015); }
  to { opacity: 1; transform: scale(1); }
}

/* ---------- Telas baixas (notebooks 1366×768 etc.) ---------- */

@media (max-height: 800px) and (min-width: 1051px) {
  .cf-popup__layout {
    padding-top: 38px;
    padding-bottom: 38px;
  }

  .cf-popup__logo {
    margin-bottom: 24px;
  }

  .cf-popup__title {
    margin-bottom: 18px;
    font-size: clamp(32px, 2.8vw, 42px);
  }

  .cf-popup__tips {
    gap: 9px;
    margin-bottom: 22px;
  }
}

/* ---------- Tablet ---------- */

@media (max-width: 1050px) {
  .cf-popup__layout {
    grid-template-columns: 1fr;
    padding: 60px 70px;
  }

  .cf-popup__media {
    display: none;
  }
}

/* ---------- Celular ---------- */

@media (max-width: 760px) {
  .cf-popup {
    padding: 12px;
  }

  .cf-popup__panel {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
    background-image: url("assets/bg-hero-grid-sm.webp");
  }

  .cf-popup__layout {
    padding: 62px 24px 30px;
  }

  .cf-popup__close {
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
  }

  .cf-popup__logo {
    width: 155px;
    margin-bottom: 28px;
  }

  .cf-popup__title {
    padding-right: 8px;
    font-size: 31px;
  }

  .cf-popup__tips li {
    align-items: flex-start;
    font-size: 13px;
  }

  .cf-popup__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cf-popup__cta {
    justify-content: space-between;
    padding: 15px 22px;
    font-size: 14px;
  }

  .cf-popup__later {
    align-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cf-popup,
  .cf-popup__panel,
  .cf-phone__frame {
    animation: none;
  }

  .cf-popup__close,
  .cf-popup__cta,
  .cf-popup__cta-arrow,
  .cf-phone__progress span {
    transition: none;
  }
}

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