/* ============================================================
   Ponto de Coleta — estilo Andes (Mercado Livre)
   Referência: envios.mercadolivre.com.br/agencias-mercado-livre/registro
   header #FFE600 · card branco raio 6px · botão loud #3483FA
   texto rgba(0,0,0,.9) / rgba(0,0,0,.55)
   ============================================================ */

:root {
  --ml-yellow: #FFE600;
  --ml-blue: #3483FA;
  --ml-blue-hover: #2968C8;
  --ml-blue-pressed: #1F4E96;
  --text-primary: rgba(0, 0, 0, 0.9);
  --text-secondary: rgba(0, 0, 0, 0.55);
  --text-disabled: rgba(0, 0, 0, 0.25);
  --border-input: rgba(0, 0, 0, 0.25);
  --border-light: rgba(0, 0, 0, 0.1);
  --page-bg: #EDEDED;
  --card-bg: #FFFFFF;
  --card-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.12);
  --destructive: #F23D4F;
  --green: #00A650;
  --focus-ring: rgba(65, 137, 230, 0.25);
  --radius: 6px;
  --content-width: 640px;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Proxima Nova", -apple-system, Roboto, Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text-primary);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(52, 131, 250, 0.2); }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ===== Header ===== */
.header {
  background: var(--ml-yellow);
  padding: 10px 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  width: 100%;
  display: flex;
  align-items: center;
}

.header-logo {
  height: 40px;
  width: auto;
  display: block;
}

/* ===== Main ===== */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 24px 16px 32px;
}

/* ===== Ícones ===== */
.icon { width: 24px; height: 24px; flex-shrink: 0; }
.icon-lg { width: 40px; height: 40px; }
.icon.primary { color: var(--ml-blue); }
.icon.green { color: var(--green); }

/* ===== Wrapper do formulário ===== */
.form-wrapper {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ===== Mensagem informativa (andes-message quiet) ===== */
.info-message {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(0, 0, 0, 0.04);
  border-radius: var(--radius);
  padding: 12px 16px;
}

.info-message__badge {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--ml-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.info-message p {
  margin: 0;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.45;
}

/* ===== Etapas ===== */
.step { display: none; }
.step.active { display: block; }

/* ===== Card de cadastro (andes-card) ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  /* sem overflow:hidden — o dropdown de "Tipo de comércio" precisa
     abrir por cima da borda do card */
}

.register-card__header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.register-card__step {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.register-card__title {
  font-size: 20px;
  font-weight: 400;
  color: var(--text-primary);
  margin: 0;
}

.register-card__content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Ilustração da etapa inicial (Andes) */
.intro-illustration {
  display: flex;
  justify-content: center;
  padding: 8px 0 4px;
}

.intro-illustration svg {
  width: 112px;
  height: 112px;
}

@media (max-width: 600px) {
  .intro-illustration svg {
    width: 96px;
    height: 96px;
  }
}

.register-card__text {
  font-size: 16px;
  color: var(--text-primary);
  line-height: 1.5;
  margin: 0;
}

.register-card__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

.register-card__actions {
  display: flex;
  flex-direction: column-reverse; /* botão principal (último no HTML) fica em cima */
  align-items: stretch;
  gap: 8px;
}

/* botão principal ocupa toda a largura do card */
.register-card__actions .btn { width: 100%; }

/* ===== Linhas de campos (form-row) ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 24px;
}

.form-row--full { grid-template-columns: 1fr; }

@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}

/* ===== Campos (andes-form-control) ===== */
.field { display: flex; flex-direction: column; gap: 6px; }

.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius);
  background: #fff;
  font-size: 16px;
  font-weight: 400;
  font-family: inherit;
  color: var(--text-primary);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder { color: var(--text-disabled); }

.input:hover { border-color: var(--ml-blue); }

.input:focus {
  outline: none;
  border-color: var(--ml-blue);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* ===== Combobox "Tipo de comércio" (andes-dropdown com busca) ===== */
.combo { position: relative; }

.combo__input { padding-right: 44px; }

.combo__chevron {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
}

.combo__chevron:hover { color: var(--ml-blue); }

.combo__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 100;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 8px 16px 0 rgba(0, 0, 0, 0.15);
  max-height: 200px;
  overflow-y: auto;
}

.combo__option {
  padding: 12px 16px;
  font-size: 16px;
  color: var(--text-primary);
  cursor: pointer;
}

.combo__option:hover { background: rgba(0, 0, 0, 0.04); }

/* Status da consulta de CNPJ/CEP (Brasil API) */
.field-hint {
  font-size: 13px;
  font-weight: 400;
  margin: 0;
  color: var(--text-secondary);
}

.field-hint.loading { color: var(--ml-blue); }
.field-hint.success { color: var(--green); }
.field-hint.error { color: var(--destructive); }

.field-error {
  display: none;
  font-size: 13px;
  color: var(--destructive);
  font-weight: 400;
  margin: 0;
}

.field.invalid .field-error { display: block; }
.field.invalid .input { border-color: var(--destructive); }

/* ===== Botões (andes-button) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  height: 48px;
  padding: 0 24px;
  border-radius: var(--radius);
  transition: background-color 0.15s;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

/* loud — azul sólido */
.btn-loud {
  background: var(--ml-blue);
  color: #fff;
}

.btn-loud:hover { background: var(--ml-blue-hover); }
.btn-loud:active { background: var(--ml-blue-pressed); }

.btn-loud:disabled {
  pointer-events: none;
  background: rgba(0, 0, 0, 0.08);
  color: var(--text-disabled);
}

/* quiet — texto azul, fundo transparente */
.btn-quiet {
  background: transparent;
  color: var(--ml-blue);
}

.btn-quiet:hover { background: rgba(52, 131, 250, 0.1); }
.btn-quiet:active { background: rgba(52, 131, 250, 0.2); }

/* outline — usado na tela de sucesso */
.btn-outline {
  background: rgba(52, 131, 250, 0.15);
  color: var(--ml-blue);
}

.btn-outline:hover { background: rgba(52, 131, 250, 0.25); }

/* ===== Tela de sucesso (padrão Andes) ===== */
.success-wrapper {
  width: 100%;
  max-width: var(--content-width);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* variação success da andes-message */
.info-message--success {
  background: rgba(0, 166, 80, 0.08);
}

.info-message__badge--success {
  background: var(--green);
}

/* lista de próximos passos com divisores */
.register-card__content--list { gap: 0; padding: 0 24px; }

.next-step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-light);
}

.next-step:last-child { border-bottom: none; }

.next-step__number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.next-step h3 {
  font-weight: 600;
  margin: 0 0 4px;
  font-size: 16px;
  color: var(--text-primary);
}

.next-step p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
  line-height: 1.5;
}

/* ===== Tela de busca de responsável (loading) ===== */
.searching-card__body {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 48px 24px 40px;
}

/* Radar com anéis pulsantes + varredura rotativa */
.radar {
  position: relative;
  width: 160px;
  height: 160px;
  margin-bottom: 28px;
}

.radar__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(52, 131, 250, 0.35);
  animation: radar-pulse 2.4s cubic-bezier(0.2, 0.6, 0.35, 1) infinite;
}

.radar__ring--2 { animation-delay: 0.8s; }
.radar__ring--3 { animation-delay: 1.6s; }

@keyframes radar-pulse {
  0%   { transform: scale(0.45); opacity: 0; }
  30%  { opacity: 1; }
  100% { transform: scale(1.15); opacity: 0; }
}

.radar__sweep {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(52, 131, 250, 0) 0deg, rgba(52, 131, 250, 0) 280deg, rgba(52, 131, 250, 0.28) 360deg);
  animation: radar-sweep 1.8s linear infinite;
}

@keyframes radar-sweep {
  to { transform: rotate(360deg); }
}

.radar__core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: rgba(52, 131, 250, 0.1);
  border: 2px solid var(--ml-blue);
  color: var(--ml-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: core-breathe 1.8s ease-in-out infinite;
}

@keyframes core-breathe {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(52, 131, 250, 0.25); }
  50%      { transform: scale(1.06); box-shadow: 0 0 0 10px rgba(52, 131, 250, 0); }
}

/* pontos "encontrados" orbitando no radar */
.radar__dot {
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ml-blue);
  opacity: 0;
}

.radar__dot--1 { top: 18%; left: 70%; animation: dot-blip 2.4s ease-in-out infinite 0.4s; }
.radar__dot--2 { top: 68%; left: 14%; animation: dot-blip 2.4s ease-in-out infinite 1.2s; background: var(--green); }
.radar__dot--3 { top: 76%; left: 74%; animation: dot-blip 2.4s ease-in-out infinite 1.9s; }

@keyframes dot-blip {
  0%, 100% { opacity: 0; transform: scale(0.4); }
  20%      { opacity: 1; transform: scale(1.25); }
  45%      { opacity: 0.9; transform: scale(1); }
  70%      { opacity: 0; transform: scale(0.5); }
}

.searching-card__status {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 20px;
  min-height: 26px;
  transition: opacity 0.25s ease;
}

.searching-card__status.is-fading { opacity: 0; }

/* reticências animadas */
.searching-dots span {
  display: inline-block;
  animation: dot-bounce 1.2s ease-in-out infinite;
}
.searching-dots span:nth-child(2) { animation-delay: 0.15s; }
.searching-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes dot-bounce {
  0%, 60%, 100% { transform: translateY(0); }
  30%           { transform: translateY(-4px); }
}

.searching-progress {
  width: 100%;
  max-width: 320px;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.searching-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--ml-blue), #5FA0FF);
  transition: width 0.45s ease;
}

.searching-card__hint {
  margin: 14px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== Card do responsável (reveal) ===== */
.assigned-card { overflow: hidden; }

.assigned-card__content {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: 32px;
  padding-bottom: 28px;
}

.assigned-card__avatar-wrap {
  position: relative;
  width: 120px;
  height: 120px;
  margin-bottom: 18px;
  animation: avatar-pop 0.65s cubic-bezier(0.34, 1.56, 0.64, 1) 0.35s both;
}

@keyframes avatar-pop {
  0%   { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.assigned-card__avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--ml-blue), 0 8px 24px rgba(52, 131, 250, 0.25);
}

/* halo que expande uma vez no reveal */
.assigned-card__halo {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 3px solid var(--ml-blue);
  animation: halo-burst 1s ease-out 0.55s both;
  pointer-events: none;
}

@keyframes halo-burst {
  0%   { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.7); opacity: 0; }
}

.assigned-card__check {
  position: absolute;
  right: 2px;
  bottom: 2px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  border: 3px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: check-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) 0.85s both;
}

@keyframes check-pop {
  0%   { transform: scale(0) rotate(-30deg); }
  100% { transform: scale(1) rotate(0); }
}

.assigned-card__check .check-path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: check-draw 0.35s ease-out 1.1s forwards;
}

@keyframes check-draw {
  to { stroke-dashoffset: 0; }
}

.assigned-card__name {
  margin: 0 0 2px;
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.assigned-card__role {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Banner de destaque do WhatsApp */
.whatsapp-banner {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: 100%;
  max-width: 480px;
  text-align: left;
  background: rgba(0, 166, 80, 0.1);
  border: 1.5px solid rgba(0, 166, 80, 0.45);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 18px;
}

.whatsapp-banner__icon {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: whatsapp-ring 2.2s ease-in-out infinite 1.4s;
}

@keyframes whatsapp-ring {
  0%, 100% { transform: rotate(0); box-shadow: 0 0 0 0 rgba(0, 166, 80, 0.35); }
  8%  { transform: rotate(-12deg); }
  16% { transform: rotate(10deg); }
  24% { transform: rotate(-8deg); }
  32% { transform: rotate(0); }
  50% { box-shadow: 0 0 0 12px rgba(0, 166, 80, 0); }
}

.whatsapp-banner__text strong:first-child {
  display: block;
  font-size: 17px;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.whatsapp-banner__text p {
  margin: 0;
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--text-primary);
}

.whatsapp-banner__text p strong { color: var(--green); }

.assigned-card__text {
  margin: 0;
  max-width: 440px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* reveals em cascata */
.reveal {
  animation: reveal-up 0.55s cubic-bezier(0.22, 0.9, 0.36, 1) both;
}

.reveal--1 { animation-delay: 0.05s; }
.reveal--2 { animation-delay: 0.2s; }
.reveal--3 { animation-delay: 0.7s; }
.reveal--4 { animation-delay: 0.85s; }
.reveal--5 { animation-delay: 1s; }
.reveal--6 { animation-delay: 1.15s; }
.reveal--7 { animation-delay: 1.3s; }

@keyframes reveal-up {
  0%   { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* ===== Confete sutil ===== */
.confetti {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.confetti i {
  position: absolute;
  top: -12px;
  width: 7px;
  height: 11px;
  border-radius: 2px;
  opacity: 0;
  animation: confetti-fall 2.6s ease-in 0.6s both;
}

.confetti i:nth-child(1)  { left: 6%;  background: var(--ml-blue);   animation-delay: 0.6s; }
.confetti i:nth-child(2)  { left: 14%; background: var(--ml-yellow); animation-delay: 0.9s; }
.confetti i:nth-child(3)  { left: 24%; background: var(--green);     animation-delay: 0.7s; }
.confetti i:nth-child(4)  { left: 33%; background: var(--ml-blue);   animation-delay: 1.2s; }
.confetti i:nth-child(5)  { left: 42%; background: var(--ml-yellow); animation-delay: 0.65s; }
.confetti i:nth-child(6)  { left: 52%; background: var(--green);     animation-delay: 1s; }
.confetti i:nth-child(7)  { left: 60%; background: var(--ml-yellow); animation-delay: 0.8s; }
.confetti i:nth-child(8)  { left: 68%; background: var(--ml-blue);   animation-delay: 1.25s; }
.confetti i:nth-child(9)  { left: 76%; background: var(--green);     animation-delay: 0.7s; }
.confetti i:nth-child(10) { left: 84%; background: var(--ml-yellow); animation-delay: 1.05s; }
.confetti i:nth-child(11) { left: 91%; background: var(--ml-blue);   animation-delay: 0.85s; }
.confetti i:nth-child(12) { left: 97%; background: var(--green);     animation-delay: 1.15s; }

@keyframes confetti-fall {
  0%   { opacity: 0; transform: translateY(0) rotate(0deg); }
  10%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(320px) rotate(420deg); }
}

/* respeita usuários com redução de movimento */
@media (prefers-reduced-motion: reduce) {
  .radar__ring, .radar__sweep, .radar__core, .radar__dot,
  .searching-dots span, .assigned-card__avatar-wrap, .assigned-card__halo,
  .assigned-card__check, .assigned-card__check .check-path,
  .whatsapp-banner__icon,
  .reveal, .confetti i {
    animation: none !important;
  }
  .reveal { opacity: 1; transform: none; }
  .assigned-card__check .check-path { stroke-dashoffset: 0; }
}

/* ===== Footer (nav-footer Mercado Livre) ===== */
.nav-footer {
  margin-top: 24px;
  background: #fff;
  border-top: 1px solid var(--border-light);
  width: 100%;
}

.nav-footer-inner {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 20px 16px 24px;
}

.nav-footer-copyright {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.nav-footer-navigation__menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.nav-footer-navigation__link {
  font-size: 13px;
  color: var(--text-primary);
  text-decoration: none;
}

.nav-footer-navigation__link:hover { color: var(--ml-blue); }

.nav-footer-secondaryinfo {
  margin: 14px 0 0;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}
