/* ATPV Online Portal 3.9.2 — ajustes pontuais solicitados. */

/* Opções Sim/Não/Não sei: círculo sempre centralizado e protegido do CSS do tema. */
html body .atpv-shell .atpv-choice {
  grid-template-columns: 22px minmax(0, 1fr) !important;
  align-items: center !important;
}

html body .atpv-shell .atpv-choice > input[type="radio"] {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  opacity: 0 !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  pointer-events: none !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
}

html body .atpv-shell .atpv-choice-control {
  position: relative !important;
  box-sizing: border-box !important;
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  display: block !important;
  align-self: center !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 2px solid #a5b6be !important;
  border-radius: 50% !important;
  background: #fff !important;
  line-height: 0 !important;
  transform: none !important;
}

html body .atpv-shell .atpv-choice-control::before {
  content: none !important;
  display: none !important;
}

html body .atpv-shell .atpv-choice-control::after {
  content: "" !important;
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  width: 9px !important;
  height: 9px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: var(--atpv-teal) !important;
  opacity: 0 !important;
  transform: translate(-50%, -50%) !important;
}

html body .atpv-shell .atpv-choice:has(input:checked) .atpv-choice-control {
  border-color: var(--atpv-teal) !important;
}

html body .atpv-shell .atpv-choice:has(input:checked) .atpv-choice-control::after {
  opacity: 1 !important;
}

html body .atpv-shell .atpv-choice strong {
  align-self: center !important;
  margin: 0 !important;
  line-height: 1.45 !important;
}

/* Botão de anexar: contraste garantido em todos os estados. */
html body .atpv-shell .atpv-file-field .atpv-file-button,
html body .atpv-shell .atpv-file-field:hover .atpv-file-button,
html body .atpv-shell .atpv-file-field input:focus-visible + .atpv-file-button,
html body .atpv-shell .atpv-file-field input:active + .atpv-file-button {
  color: #fff !important;
  background: var(--atpv-navy) !important;
  border-color: var(--atpv-navy) !important;
  opacity: 1 !important;
  text-shadow: none !important;
}

html body .atpv-shell .atpv-file-field:hover .atpv-file-button,
html body .atpv-shell .atpv-file-field input:focus-visible + .atpv-file-button {
  background: var(--atpv-navy-deep) !important;
  border-color: var(--atpv-navy-deep) !important;
}

/* Conferência final dividida em blocos claros. */
html body .atpv-shell .atpv-review-group {
  min-width: 0 !important;
  display: grid !important;
  gap: 12px !important;
}

html body .atpv-shell .atpv-review-group + .atpv-review-group {
  padding-top: 20px !important;
  border-top: 1px solid var(--atpv-border) !important;
}

html body .atpv-shell .atpv-review-group > h2 {
  margin: 0 !important;
  color: var(--atpv-navy) !important;
  font-family: "Sora", "Manrope", sans-serif !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.35 !important;
}

html body .atpv-shell .atpv-review-details--vehicle > div:last-child:nth-child(odd) {
  grid-column: auto !important;
}

/* Duas confirmações independentes, com alerta vermelho na segunda. */
html body .atpv-shell .atpv-final-confirmations {
  display: grid !important;
  gap: 12px !important;
}

html body .atpv-shell .atpv-check--warning {
  border-color: rgba(180, 35, 24, .34) !important;
  background: #fff4f2 !important;
}

html body .atpv-shell .atpv-check--warning > span,
html body .atpv-shell .atpv-check--warning > span strong {
  color: #9f1f17 !important;
  font-weight: 700 !important;
}

html body .atpv-shell [data-atpv-finalize-button]:disabled {
  cursor: not-allowed !important;
  opacity: .5 !important;
  filter: grayscale(.15) !important;
  box-shadow: none !important;
}

/* Cupom: ações simples, sem travar o pagamento. */
html body .atpv-shell .atpv-coupon-error-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin-top: 12px !important;
}

html body .atpv-shell .atpv-coupon-error-actions .atpv-button {
  flex: 1 1 210px !important;
}

html body .atpv-shell .atpv-coupon-remove-form {
  margin-top: 10px !important;
}

html body .atpv-shell .atpv-coupon-remove-form .atpv-text-button {
  color: #9f1f17 !important;
  font-weight: 700 !important;
  text-decoration: underline !important;
  text-underline-offset: 3px !important;
}

@media (max-width: 760px) {
  html body .atpv-shell .atpv-review-details,
  html body .atpv-shell .atpv-review-details--vehicle {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body .atpv-shell .atpv-review-details > div,
  html body .atpv-shell .atpv-review-details--vehicle > div {
    grid-column: auto !important;
    min-height: 0 !important;
  }

  html body .atpv-shell .atpv-coupon-error-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  html body .atpv-shell .atpv-coupon-error-actions .atpv-button {
    width: 100% !important;
  }
}

/* 3.9.2 — alinhamento responsivo isolado por contexto.
   Impede que estilos centralizados do tema/Elementor sejam herdados pelos textos do portal. */
html body .atpv-shell :where(
  .atpv-card-head,
  .atpv-form-heading,
  .atpv-prevalidation-intro,
  .atpv-question-block,
  .atpv-form-section-head,
  .atpv-data-review-head,
  .atpv-benefit-head,
  .atpv-section-head,
  .atpv-next-action,
  .atpv-status-hero,
  .atpv-order-summary,
  .atpv-document-guidance,
  .atpv-consent-box,
  .atpv-upload-card,
  .atpv-review-group,
  .atpv-review-details,
  .atpv-details,
  .atpv-result-summary,
  .atpv-answer-review-list,
  .atpv-payment-options,
  .atpv-choice-list
) {
  text-align: left !important;
}

html body .atpv-shell :where(
  .atpv-card-head,
  .atpv-form-heading,
  .atpv-prevalidation-intro,
  .atpv-form-section-head,
  .atpv-data-review-head,
  .atpv-benefit-head,
  .atpv-section-head,
  .atpv-next-action
) > :where(h1, h2, h3, h4, p) {
  margin-left: 0 !important;
  margin-right: 0 !important;
  text-align: left !important;
}

html body .atpv-shell .atpv-form :where(
  label,
  legend,
  small,
  .atpv-field-error,
  .atpv-field-status
) {
  text-align: left !important;
}

html body .atpv-shell .atpv-check,
html body .atpv-shell .atpv-check > span,
html body .atpv-shell .atpv-choice,
html body .atpv-shell .atpv-choice > strong,
html body .atpv-shell .atpv-payment-option,
html body .atpv-shell .atpv-payment-option > span {
  text-align: left !important;
}

html body .atpv-shell :where(
  .atpv-card-head p,
  .atpv-form-heading p,
  .atpv-prevalidation-intro p,
  .atpv-form-section-head p,
  .atpv-data-review-head p,
  .atpv-benefit-head p,
  .atpv-section-head p,
  .atpv-next-action p
) {
  max-width: 760px !important;
}

/* Textos comuns quebram por palavra; identificadores longos continuam protegidos. */
html body .atpv-shell :where(
  p,
  li,
  label,
  small,
  .atpv-field-error,
  .atpv-field-status
) {
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

html body .atpv-shell :where(
  .atpv-request-tabs strong,
  .atpv-status-protocol strong,
  .atpv-details dd,
  .atpv-review-details dd,
  .atpv-result-summary strong,
  .atpv-client-document-copy,
  .atpv-communication-email
) {
  overflow-wrap: anywhere !important;
}

/* A mensagem dos Termos ocupa a coluna de texto e nunca a coluna estreita do checkbox. */
html body .atpv-shell .atpv-consent-box--start > .atpv-check:first-child > .atpv-field-error {
  grid-column: 2 / -1 !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  margin: 2px 0 0 !important;
  text-align: left !important;
  white-space: normal !important;
  word-break: normal !important;
  overflow-wrap: break-word !important;
}

/* Desktop: conteúdo textual à esquerda; botões e elementos intencionalmente centrais permanecem intactos. */
@media (min-width: 1101px) {
  html body .atpv-shell .atpv-start-card,
  html body .atpv-shell .atpv-form-card,
  html body .atpv-shell .atpv-information-card,
  html body .atpv-shell .atpv-documents-card,
  html body .atpv-shell .atpv-payment-main,
  html body .atpv-shell .atpv-prevalidation-card,
  html body .atpv-shell .atpv-result-card {
    text-align: left !important;
  }
}

/* Tablet: mantém colunas quando houver espaço, sem herdar centralização do tema. */
@media (min-width: 821px) and (max-width: 1100px) {
  html body .atpv-shell :where(
    .atpv-card-head,
    .atpv-form-heading,
    .atpv-prevalidation-intro,
    .atpv-form-section-head,
    .atpv-data-review-head,
    .atpv-benefit-head,
    .atpv-section-head,
    .atpv-next-action,
    .atpv-consent-box
  ) {
    text-align: left !important;
  }

  html body .atpv-shell.atpv-shell--compact {
    width: min(100%, 860px) !important;
    max-width: 860px !important;
  }
}

/* Mobile: uma coluna, leitura à esquerda e mensagens usando toda a largura útil. */
@media (max-width: 820px) {
  html body .atpv-shell :where(
    .atpv-card-head,
    .atpv-form-heading,
    .atpv-prevalidation-intro,
    .atpv-form-section-head,
    .atpv-data-review-head,
    .atpv-benefit-head,
    .atpv-section-head,
    .atpv-next-action,
    .atpv-status-hero,
    .atpv-consent-box,
    .atpv-upload-card
  ) {
    text-align: left !important;
  }

  html body .atpv-shell .atpv-consent-box--start .atpv-check {
    grid-template-columns: 22px minmax(0, 1fr) !important;
    align-items: start !important;
  }

  html body .atpv-shell .atpv-consent-box--start .atpv-check > input[type="checkbox"] {
    margin-top: 3px !important;
  }

  html body .atpv-shell .atpv-consent-box--start > .atpv-check:first-child > .atpv-field-error {
    grid-column: 2 / -1 !important;
    font-size: 13px !important;
    line-height: 1.45 !important;
  }
}

/* Telas muito estreitas: não comprime o texto nem cria rolagem horizontal. */
@media (max-width: 480px) {
  html body .atpv-shell .atpv-consent-box--start {
    padding: 16px 14px !important;
  }

  html body .atpv-shell .atpv-consent-box--start .atpv-check {
    gap: 10px !important;
  }
}


/* ================================================================
 * ATPV Online Portal 3.9.3 — experiência responsiva preservando o
 * layout aprovado. Ajusta somente a ocupação útil da tela e a leitura
 * do acompanhamento em desktop, tablet e celular.
 * ================================================================ */

/* Desktop amplo: aproveita a tela real mesmo quando o tema usa um
 * container estreito. O limite mantém a leitura confortável. */
@media (min-width: 1101px) {
  html body .atpv-shell {
    position: relative !important;
    left: 50% !important;
    width: min(calc(100vw - 48px), 1440px) !important;
    max-width: 1440px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: translateX(-50%) !important;
    padding-inline: clamp(28px, 3vw, 52px) !important;
  }

  html body .atpv-shell.atpv-shell--compact {
    width: min(calc(100vw - 48px), 1180px) !important;
    max-width: 1180px !important;
  }
}

/* Tablet: usa praticamente toda a largura disponível, mantendo respiro
 * lateral e sem transformar formulários em uma versão estreita de PC. */
@media (min-width: 821px) and (max-width: 1100px) {
  html body .atpv-shell,
  html body .atpv-shell.atpv-shell--compact,
  html body .atpv-shell.atpv-shell--wide {
    position: relative !important;
    left: 50% !important;
    width: calc(100vw - 32px) !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: translateX(-50%) !important;
    padding: 28px clamp(20px, 4vw, 36px) 48px !important;
  }
}

/* Celular: ocupa a largura do conteúdo sem provocar rolagem horizontal. */
@media (max-width: 820px) {
  html body .atpv-shell,
  html body .atpv-shell.atpv-shell--compact,
  html body .atpv-shell.atpv-shell--wide {
    position: static !important;
    left: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    transform: none !important;
    padding: 20px clamp(12px, 4vw, 22px) 40px !important;
    overflow-x: clip !important;
  }
}

/* Acompanhamento: mantém o desenho aprovado e reforça a etapa atual. */
html body .atpv-shell .atpv-timeline-item--current {
  opacity: 1 !important;
}

html body .atpv-shell .atpv-timeline-item--current .atpv-progress-title-row strong {
  color: var(--atpv-navy) !important;
}

html body .atpv-shell .atpv-timeline-item--current .atpv-progress-state {
  border-color: rgba(213, 157, 42, .48) !important;
  color: #805b0b !important;
  background: #fff8e7 !important;
}

/* Em telas menores, a etiqueta desce para não apertar o título. */
@media (max-width: 620px) {
  html body .atpv-shell .atpv-progress-title-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    justify-items: start !important;
    gap: 8px !important;
  }

  html body .atpv-shell .atpv-progress-state {
    width: auto !important;
    max-width: 100% !important;
    white-space: normal !important;
  }

  html body .atpv-shell .atpv-progress-step {
    grid-template-columns: 20px minmax(0, 1fr) !important;
    gap: 12px !important;
    min-height: 0 !important;
    padding-bottom: 26px !important;
  }

  html body .atpv-shell .atpv-progress-step:not(:last-child)::after {
    left: 9px !important;
  }

  html body .atpv-shell .atpv-progress-marker {
    width: 18px !important;
    height: 18px !important;
  }
}
