/* Orientação visual comum para CPF/CNPJ em compras, cadastros e primeiro acesso. */
.cpf-guide-field,
.cpf-guide-host {
  position: relative;
  min-width: 0;
  width: 100%;
}

.cpf-guide-callout {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 7px 10px;
  border: 1px solid rgba(48, 202, 242, .72);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(7, 52, 72, .98), rgba(8, 31, 48, .98));
  color: #eafaff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18), 0 0 0 3px rgba(48, 202, 242, .06);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.cpf-guide-callout[hidden],
.cpf-guide-feedback[hidden],
.cpf-guide-field[hidden] {
  display: none !important;
}

.cpf-guide-pointer {
  display: inline-grid;
  place-items: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  font-size: 23px;
  line-height: 1;
  transform-origin: 50% 100%;
  animation: cpfGuidePoint 1.05s ease-in-out infinite;
}

.cpf-guide-copy {
  min-width: 0;
  line-height: 1.12;
}

.cpf-guide-copy b,
.cpf-guide-copy small {
  display: block;
}

.cpf-guide-copy b {
  color: #7cecff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .7px;
}

.cpf-guide-copy small {
  margin-top: 3px;
  color: #d5e8f1;
  font-size: 10px;
  font-weight: 700;
}

.cpf-guide-callout[data-state="focus"] {
  border-color: #55ddff;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .2), 0 0 0 4px rgba(48, 202, 242, .11);
}

.cpf-guide-callout[data-state="valid"] {
  border-color: #4ee486;
  background: linear-gradient(135deg, rgba(7, 67, 39, .98), rgba(8, 40, 28, .98));
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18), 0 0 0 3px rgba(78, 228, 134, .08);
}

.cpf-guide-callout[data-state="valid"] .cpf-guide-pointer {
  animation: cpfGuideSuccess .46s ease both;
}

.cpf-guide-callout[data-state="valid"] .cpf-guide-copy b {
  color: #8dffb4;
}

.cpf-guide-callout[data-state="invalid"] {
  border-color: #ff6679;
  background: linear-gradient(135deg, rgba(91, 19, 34, .98), rgba(48, 12, 23, .98));
  animation: cpfGuideShake .34s ease both;
}

.cpf-guide-callout[data-state="invalid"] .cpf-guide-copy b {
  color: #ffd8df;
}

.cpf-guide-field input.cpf-field-valid,
.cpf-guide-host input.cpf-field-valid {
  border-color: #42dc7b !important;
  box-shadow: 0 0 0 4px rgba(66, 220, 123, .13) !important;
  background-image: linear-gradient(90deg, rgba(66, 220, 123, .055), rgba(66, 220, 123, .015)) !important;
}

.cpf-guide-field input.cpf-field-invalid,
.cpf-guide-host input.cpf-field-invalid {
  border-color: #ff6679 !important;
  box-shadow: 0 0 0 4px rgba(255, 102, 121, .13) !important;
  background-image: linear-gradient(90deg, rgba(255, 102, 121, .06), rgba(255, 102, 121, .015)) !important;
}

.cpf-guide-feedback {
  display: none;
  align-items: center;
  gap: 6px;
  margin: 7px 0 10px;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.cpf-guide-feedback[data-state="valid"],
.cpf-guide-feedback[data-state="invalid"] {
  display: flex;
}

.cpf-guide-feedback[data-state="valid"] {
  border: 1px solid rgba(66, 220, 123, .45);
  background: rgba(16, 96, 50, .2);
  color: #baffce;
}

.cpf-guide-feedback[data-state="invalid"] {
  border: 1px solid rgba(255, 102, 121, .5);
  background: rgba(130, 25, 43, .2);
  color: #ffe0e5;
}

.field-visual-invalid {
  border-color: #ff6679 !important;
  box-shadow: 0 0 0 4px rgba(255, 102, 121, .13) !important;
}

.field-visual-valid {
  border-color: #42dc7b !important;
  box-shadow: 0 0 0 4px rgba(66, 220, 123, .13) !important;
}

.error.visual-feedback-active,
[role="alert"].visual-feedback-active {
  display: block !important;
  animation: cpfGuideShake .34s ease both;
}

@keyframes cpfGuidePoint {
  0%, 100% { transform: translateY(-2px) rotate(-5deg); }
  50% { transform: translateY(5px) rotate(3deg); }
}

@keyframes cpfGuideSuccess {
  0% { transform: scale(.72) rotate(-12deg); }
  70% { transform: scale(1.18) rotate(4deg); }
  100% { transform: scale(1) rotate(0); }
}

@keyframes cpfGuideShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  55% { transform: translateX(5px); }
  78% { transform: translateX(-2px); }
}

@media (max-width: 560px) {
  .cpf-guide-callout {
    width: 100%;
    padding: 7px 9px;
  }

  .cpf-guide-copy small {
    font-size: 9px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cpf-guide-pointer,
  .cpf-guide-callout,
  .error.visual-feedback-active,
  [role="alert"].visual-feedback-active {
    animation: none !important;
    transition: none !important;
  }
}
