/* Home comercial: composição editorial e formulários isolados dos estilos legados.
   Não altera os formulários, consentimentos ou integrações de contratação/demo. */

body.celebrax-home-retention .editorial-hero {
  content-visibility: visible;
  contain-intrinsic-size: none;
}

body.celebrax-home-retention .editorial-hero > * {
  min-width: 0;
}

/* O pacote global ainda define três colunas/áreas para CTAs da home anterior. */
body.celebrax-home-retention .editorial-hero .hero-actions {
  display: flex !important;
  flex-wrap: wrap;
  grid-template-areas: none !important;
  grid-template-columns: none !important;
  grid-template-rows: none !important;
  width: 100% !important;
  gap: 12px !important;
}

body.celebrax-home-retention .editorial-hero .hero-actions > .button {
  min-width: 0;
  max-width: 100%;
  min-height: 52px;
  padding: 14px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  white-space: normal;
}

body.celebrax-home-retention .hero-actions > .button > svg {
  flex: 0 0 19px;
}

/* A mesma linguagem visual para nome, e-mail, telefone, data e seleção. */
body.celebrax-home-retention :is(.celebrax-checkout-modal, .celebrax-interest-modal) {
  --commercial-field-surface: #fff;
  --commercial-field-ink: #16243b;
  --commercial-field-border: #cbd5e1;
  --commercial-field-placeholder: #68768b;
  color-scheme: light;
  font-family: var(--cx-sans, "DM Sans", system-ui, sans-serif);
}

body.celebrax-home-retention :is(.celebrax-checkout-fields-grid, .celebrax-interest-grid) {
  align-items: start;
  gap: 16px;
  min-width: 0;
}

body.celebrax-home-retention .celebrax-checkout-form-group:not(.celebrax-checkout-checkbox) > label,
body.celebrax-home-retention .celebrax-interest-field > span {
  color: #2e3b51;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.4;
}

/* :where mantém as exclusões sem superar a altura específica do textarea. */
body.celebrax-home-retention :is(.celebrax-checkout-form-group, .celebrax-interest-field) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea) {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: 48px;
  min-height: 48px;
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--commercial-field-border);
  border-radius: 12px;
  background-color: var(--commercial-field-surface);
  color: var(--commercial-field-ink);
  font-family: var(--cx-sans, "DM Sans", system-ui, sans-serif);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.4;
  text-align: start;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

body.celebrax-home-retention :is(.celebrax-checkout-form-group, .celebrax-interest-field) :is(input, textarea)::placeholder {
  color: var(--commercial-field-placeholder);
  font-weight: 400;
  opacity: 1;
}

body.celebrax-home-retention :is(.celebrax-checkout-form-group, .celebrax-interest-field) :where(input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]), select, textarea):focus {
  border-color: #075ff7;
  background-color: var(--commercial-field-surface);
  box-shadow: 0 0 0 3px rgba(7, 95, 247, 0.12);
}

/* Safari dá ao campo de data um tamanho intrínseco diferente de texto/select. */
body.celebrax-home-retention :is(.celebrax-checkout-form-group, .celebrax-interest-field) input[type="date"] {
  min-inline-size: 0;
  appearance: none;
  -webkit-appearance: none;
}

body.celebrax-home-retention :is(.celebrax-checkout-form-group, .celebrax-interest-field) input[type="date"]::-webkit-date-and-time-value {
  min-height: 1.4em;
  text-align: left;
}

body.celebrax-home-retention :is(.celebrax-checkout-form-group, .celebrax-interest-field) input[type="date"]::-webkit-datetime-edit {
  padding: 0;
}

body.celebrax-home-retention .celebrax-checkout-form-group textarea {
  height: auto;
  min-height: 96px;
  resize: vertical;
}

body.celebrax-home-retention :is(.celebrax-checkout-form-group, .celebrax-interest-field) > small,
body.celebrax-home-retention .celebrax-checkout-error-message {
  margin-top: 5px;
  font-size: 0.75rem;
  line-height: 1.45;
}

body.celebrax-home-retention .celebrax-coupon-box {
  --commercial-field-surface: #143454;
  --commercial-field-ink: #fff;
  --commercial-field-border: #617894;
  --commercial-field-placeholder: #c1cee0;
}

body.celebrax-home-retention .celebrax-checkout-form-group.celebrax-coupon-box > label {
  color: #fff;
}

body.celebrax-home-retention .celebrax-coupon-apply-btn {
  min-height: 48px;
  border-radius: 12px;
  font-size: 0.875rem;
  font-weight: 700;
}

body.celebrax-home-retention :is(.celebrax-interest-submit, .celebrax-checkout-btn-submit) {
  min-height: 52px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

@media (max-width: 900px) {
  /* Colunas explícitas: o i18n aplica margin: 0 !important no próprio host. */
  body.celebrax-home-retention > .home-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    min-height: 72px;
    padding: 10px max(14px, env(safe-area-inset-right)) 10px max(14px, env(safe-area-inset-left));
  }

  body.celebrax-home-retention .home-header > .home-logo {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    min-width: 0;
  }

  body.celebrax-home-retention .home-logo img {
    width: 118px;
    max-width: 100%;
    height: auto;
  }

  body.celebrax-home-retention .home-header > .celebrax-language-switcher {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }

  body.celebrax-home-retention .home-header > .celebrax-menu-toggle {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
  }
}

@media (max-width: 760px) {
  body.celebrax-home-retention .editorial-hero .hero-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  body.celebrax-home-retention .editorial-hero .hero-actions > .button {
    width: 100%;
  }

  /* A ilustração passa a dimensionar a seção, sem depender de altura fixa. */
  body.celebrax-home-retention .hero-product {
    min-height: 0 !important;
    max-width: 100%;
    padding-top: 12px;
  }

  body.celebrax-home-retention .hero-product::before {
    inset: 0 0 12% 12%;
    transform: none;
  }

  body.celebrax-home-retention .hero-product::after {
    right: 0;
    bottom: 0;
  }

  body.celebrax-home-retention .event-preview {
    position: relative;
    top: auto;
    right: auto;
    width: calc(100% - 8px);
    margin-left: auto;
    transform: none;
  }

  body.celebrax-home-retention .hero-dashboard-card {
    position: relative;
    bottom: auto;
    left: auto;
    width: min(220px, 85%);
    margin-top: -24px;
    transform: none;
  }

  body.celebrax-home-retention .hero-update-card {
    display: none;
  }

  body.celebrax-home-retention .product-caption {
    position: static;
    display: block;
    margin-top: 14px;
    text-align: right;
  }

  /* O overlay cobre a tela; o limite/scroll pertence ao cartão interno.
     --cx-mobile-vh acompanha a área disponível quando o teclado abre. */
  body.celebrax-home-retention :is(.celebrax-checkout-modal, .celebrax-interest-modal) {
    align-items: flex-end;
    height: 100dvh;
    height: calc(var(--cx-mobile-vh, 1dvh) * 100);
    max-height: none !important;
    padding: max(12px, env(safe-area-inset-top)) env(safe-area-inset-right) 0 env(safe-area-inset-left) !important;
    border-radius: 0 !important;
  }

  body.celebrax-home-retention :is(.celebrax-checkout-container, .celebrax-interest-card) {
    width: 100%;
    min-width: 0;
    min-height: 0;
    max-height: 100%;
    border-width: 1px 0 0;
    border-radius: 22px 22px 0 0;
  }

  body.celebrax-home-retention :is(.celebrax-checkout-content, .celebrax-interest-body) {
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scroll-padding-block: 16px 32px;
    padding-bottom: max(24px, env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
  }

  body.celebrax-home-retention :is(.celebrax-checkout-fields-grid, .celebrax-interest-grid) {
    grid-template-columns: minmax(0, 1fr);
  }

  body.celebrax-home-retention .celebrax-interest-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.celebrax-home-retention .celebrax-interest-showcase {
    flex: 0 0 auto;
    min-height: 0;
    padding: 22px 70px 18px 20px;
  }

  body.celebrax-home-retention .celebrax-interest-promise h3 {
    font-size: 1.4rem;
    line-height: 1.2;
  }

  body.celebrax-home-retention .celebrax-interest-body {
    flex: 1 1 auto;
    padding: 22px 16px max(24px, env(safe-area-inset-bottom));
  }

  body.celebrax-home-retention :is(.celebrax-interest-brand, .celebrax-interest-preview, .celebrax-interest-time, .celebrax-interest-benefits, .celebrax-interest-privacy) {
    display: none;
  }

  body.celebrax-home-retention .celebrax-interest-close {
    position: absolute;
    top: 12px;
    right: 14px;
    display: grid;
    place-items: center;
    background: #fff;
    color: #102654;
    border-color: #d9e1ec;
    font-size: 1.5rem;
  }

  body.celebrax-home-retention .celebrax-checkout-close {
    flex-basis: 44px;
    font-size: 1.5rem;
  }
}

@media (max-width: 760px) and (max-height: 600px) {
  body.celebrax-home-retention .celebrax-interest-showcase {
    padding: 14px 70px 14px 16px;
  }

  body.celebrax-home-retention .celebrax-interest-promise > p {
    display: none;
  }

  body.celebrax-home-retention .celebrax-interest-promise h3 {
    font-size: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.celebrax-home-retention :is(.celebrax-checkout-form-group, .celebrax-interest-field) :is(input, select, textarea) {
    transition: none;
  }
}
