/* Modal consulta CPF → objeto (compartilhado index + /consulta/) */
.idx-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.95rem 1rem;
  border: none;
  border-radius: 10px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-family: inherit;
  cursor: pointer;
  background: #5a6578;
  color: #fff;
  box-shadow: 0 3px 10px rgba(90, 101, 120, 0.35);
  transition: background 0.15s;
}

.idx-btn:hover:not(:disabled) {
  background: #4a5568;
}

.idx-btn:disabled {
  opacity: 0.75;
  cursor: wait;
}

.idx-btn--cta {
  background: #2e7d32;
  box-shadow: 0 3px 12px rgba(46, 125, 50, 0.35);
  margin-top: 0.25rem;
}

.idx-btn--cta:hover:not(:disabled) {
  background: #1b5e20;
}

body.idx-modal-open,
body.cst-modal-open {
  overflow: hidden;
}

.idx-overlay {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(0, 25, 48, 0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.idx-overlay[hidden] {
  display: none !important;
}

.idx-modal {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 18px;
  box-shadow:
    0 32px 64px rgba(0, 25, 48, 0.28),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
  padding: 1.25rem 1.15rem 1.15rem;
  max-height: 90vh;
  overflow-y: auto;
  font-family: "Source Sans 3", system-ui, -apple-system, sans-serif;
}

.idx-modal-brand-bar {
  height: 5px;
  background: linear-gradient(90deg, #003157 0%, #003157 72%, #ffdf00 72%, #ffdf00 100%);
}

.idx-modal--load,
.idx-modal--result {
  max-width: 420px;
  padding: 0;
  overflow: hidden;
  border: none;
  border-radius: 18px;
}

.idx-modal-load-head {
  padding: 1.15rem 1.35rem 1.1rem;
  text-align: center;
  background: #fff;
  border-bottom: 1px solid #e8eef4;
}

.idx-modal-ico--load {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.75rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #ffef5c 0%, #ffdf00 45%, #f5c400 100%);
  color: #003157;
  box-shadow: 0 4px 16px rgba(255, 193, 7, 0.4);
}

.idx-modal-ico.idx-modal-ico--correios,
.idx-modal-ico--load.idx-modal-ico--correios {
  width: auto;
  height: auto;
  min-width: 0;
  max-width: min(200px, 88vw);
  padding: 0;
  border: none;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.idx-modal-ico--load.idx-modal-ico--correios {
  margin: 0 auto 0.65rem;
}

.idx-modal-correios-logo--load,
.idx-modal-correios-logo--result,
.idx-modal-q7m2-logo--load,
.idx-modal-q7m2-logo--result {
  display: block;
  width: min(220px, 78%);
  max-width: 220px;
  height: auto;
  max-height: none;
  margin: 0 auto;
  object-fit: contain;
}

.idx-modal-title--load {
  margin: 0;
  font-size: clamp(1.05rem, 4.2vw, 1.2rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: #003157;
}

.idx-modal-load-sub {
  margin: 0.4rem 0 0;
  font-size: clamp(0.84rem, 2.5vw, 0.92rem);
  font-weight: 600;
  color: #64748b;
}

.idx-modal-load-body {
  padding: 1.05rem 1.2rem 0.95rem;
  background: #f8fafc;
}

.idx-steps--load {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
}

.idx-modal--load .idx-step {
  padding: 0.72rem 0.9rem 0.72rem 2.5rem;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e2e8f0;
  font-size: clamp(0.86rem, 2.6vw, 0.94rem);
  line-height: 1.4;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition:
    border-color 0.25s,
    background 0.25s,
    color 0.25s,
    box-shadow 0.25s;
}

.idx-modal--load .idx-step::before {
  left: 0.85rem;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
}

.idx-modal--load .idx-step.active {
  border-color: rgba(0, 49, 87, 0.35);
  background: #fff;
  color: #003157;
  font-weight: 700;
  box-shadow:
    0 0 0 2px rgba(0, 49, 87, 0.08),
    0 4px 12px rgba(0, 49, 87, 0.06);
}

.idx-modal--load .idx-step.active::before {
  border-color: #003157;
  border-top-color: transparent;
  animation: idx-step-spin-load 0.75s linear infinite;
}

.idx-modal--load .idx-step.done {
  border-color: #dce8dc;
  background: #fafcfa;
  color: #334155;
  font-weight: 600;
}

.idx-modal--load .idx-step.done::before {
  background: #2e7d32 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/11px no-repeat;
}

@keyframes idx-step-spin-load {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

.idx-modal-load-foot {
  padding: 0.95rem 1.35rem 1.25rem;
  background: #fff;
  border-top: 1px solid #e8eef4;
}

.idx-progress-label {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: #64748b;
}

.idx-progress--load {
  height: 8px;
  border-radius: 999px;
  background: #e8eef4;
  box-shadow: inset 0 1px 2px rgba(0, 49, 87, 0.06);
}

.idx-progress--load span {
  border-radius: inherit;
  background: linear-gradient(90deg, #003157 0%, #004b8d 78%, #ffdf00 100%);
}

.idx-modal[hidden] {
  display: none !important;
}

.idx-modal-ico {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #e3f2fd;
  color: #1565c0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.65rem;
}

.idx-modal-ico--rf {
  background: #e8eaf6;
  color: #003157;
}

/* Logo Q7m2: sem caixa do .idx-modal-ico (evita quadrado azul) */
.idx-modal-ico.idx-modal-ico--q7m2,
.idx-modal-ico--load.idx-modal-ico--q7m2 {
  width: auto;
  height: auto;
  min-width: 0;
  max-width: min(200px, 88vw);
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
}

.idx-modal-ico--load.idx-modal-ico--q7m2 {
  margin: 0 auto 0.65rem;
}

.idx-modal-title {
  margin: 0 0 0.85rem;
  text-align: center;
  font-size: 1rem;
  line-height: 1.35;
  color: #003157;
}

.idx-steps {
  list-style: none;
  margin: 0 0 0.85rem;
  padding: 0;
}

.idx-step {
  position: relative;
  padding: 0.45rem 0 0.45rem 1.65rem;
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.35;
}

.idx-step::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62rem;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #cbd5e1;
  background: #fff;
  box-sizing: border-box;
}

.idx-step.active {
  color: #003157;
  font-weight: 600;
}

.idx-step.active::before {
  border-color: #1565c0;
  border-top-color: transparent;
  animation: idx-step-spin 0.8s linear infinite;
}

.idx-step.done {
  color: #2e7d32;
}

.idx-step.done::before {
  border-color: #2e7d32;
  background: #2e7d32 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z'/%3E%3C/svg%3E") center/10px no-repeat;
}

@keyframes idx-step-spin {
  to {
    transform: rotate(360deg);
  }
}

.idx-progress {
  height: 6px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.idx-progress span {
  display: block;
  height: 100%;
  width: 8%;
  background: linear-gradient(90deg, #003157, #1565c0);
  border-radius: inherit;
  transition: width 0.45s ease;
}

.idx-result-meta-block[hidden],
.idx-result-meta[hidden] {
  display: none !important;
}

.idx-result-meta-block {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.idx-result-meta {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  background: #f1f5f9;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  color: #475569;
  margin-bottom: 0;
  flex-wrap: wrap;
  align-items: flex-start;
}

.idx-result-meta strong {
  color: #003157;
}

.idx-result-alert {
  background: #fdecea;
  border-left: 4px solid #d32f2f;
  border-radius: 8px;
  padding: 0.75rem 0.85rem;
  margin-bottom: 0.85rem;
}

.idx-result-alert-title {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  font-weight: 800;
  color: #c62828;
  letter-spacing: 0.02em;
}

.idx-result-alert ul {
  margin: 0;
  padding-left: 1rem;
  color: #b71c1c;
  font-size: 0.72rem;
  line-height: 1.45;
}

.idx-result-redirect {
  margin: 0.35rem 0 0;
  padding: 0.85rem 0.75rem;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #003157;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 10px;
}

.idx-result-cta {
  display: block;
  width: 100%;
  margin-top: 0.65rem;
  min-height: 3rem;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 12px;
  background: #ffdf00;
  color: #003157;
  font-family: "Source Sans 3", system-ui, sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  touch-action: manipulation;
}

.idx-result-cta:active {
  transform: scale(0.99);
  background: #f5d500;
}

.idx-result-foot {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.75rem;
  font-size: 0.65rem;
  color: #607d8b;
}

.idx-result-foot span {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.idx-result-foot svg {
  color: #1565c0;
}

.idx-modal-title {
  font-size: clamp(1rem, 4vw, 1.12rem);
}

.idx-step {
  font-size: clamp(0.82rem, 2.6vw, 0.92rem);
}

.idx-result-alert ul,
.idx-result-meta {
  font-size: clamp(0.78rem, 2.4vw, 0.88rem);
}

@supports (height: 100dvh) {
  .idx-modal {
    max-height: min(90dvh, calc(100dvh - 1.5rem));
  }
}

.idx-modal-result-head {
  padding: 1rem 1.35rem 1.05rem;
  text-align: center;
  background: #fff;
  border-bottom: 1px solid #e8eef4;
}

.idx-modal-ico--result {
  margin-bottom: 0.5rem;
}

.idx-modal-result-kicker {
  display: inline-block;
  margin: 0 0 0.55rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #003157;
  background: #f0f4f8;
  border: 1px solid #dce4ec;
}

.idx-modal-result-body {
  padding: 0 1.35rem 1.35rem;
  background: #f8fafc;
}

.idx-modal-title--result {
  margin: 0;
  font-size: clamp(1.02rem, 4vw, 1.15rem);
  font-weight: 800;
  line-height: 1.35;
  color: #003157;
}

.idx-modal-result-lead {
  margin: 0.4rem 0 0;
  font-size: clamp(0.86rem, 2.5vw, 0.94rem);
  font-weight: 500;
  line-height: 1.45;
  color: #64748b;
}

.idx-modal--result .idx-result-alert--compact {
  margin: 1.05rem 0 0;
  padding: 1rem 1rem 1rem 1.05rem;
  border: 1px solid rgba(198, 40, 40, 0.22);
  border-left-width: 4px;
  border-left-color: #c62828;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 20px rgba(198, 40, 40, 0.08);
  animation: idx-result-alert-pulse 1.6s ease-in-out infinite;
}

@keyframes idx-result-alert-pulse {
  0%,
  100% {
    border-color: rgba(198, 40, 40, 0.2);
    border-left-color: #c62828;
    box-shadow: 0 6px 20px rgba(198, 40, 40, 0.06);
  }

  50% {
    border-color: rgba(183, 28, 28, 0.35);
    border-left-color: #b71c1c;
    box-shadow:
      0 0 0 3px rgba(211, 47, 47, 0.12),
      0 8px 22px rgba(183, 28, 28, 0.1);
  }
}

.idx-modal--result .idx-result-alert--compact .idx-result-alert-title {
  animation: idx-result-alert-title-pulse 1.35s ease-in-out infinite;
}

@keyframes idx-result-alert-title-pulse {
  0%,
  100% {
    color: #c62828;
  }

  50% {
    color: #b71c1c;
  }
}

@media (prefers-reduced-motion: reduce) {
  .idx-modal--result .idx-result-alert--compact,
  .idx-modal--result .idx-result-alert--compact .idx-result-alert-title {
    animation: none;
  }
}

.idx-result-alert-text {
  margin: 0;
  font-size: clamp(0.84rem, 2.4vw, 0.92rem);
  line-height: 1.5;
  color: #475569;
  font-weight: 500;
}

.idx-modal--result .idx-result-alert-title {
  font-size: clamp(0.78rem, 2.3vw, 0.86rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.idx-modal--result .idx-result-cta {
  margin: 1.1rem 0 0;
  width: 100%;
  min-height: 3.2rem;
  font-size: clamp(0.95rem, 2.8vw, 1.02rem);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffe033 0%, #ffdf00 48%, #f5d500 100%);
  box-shadow:
    0 4px 0 #c9a800,
    0 8px 24px rgba(0, 49, 87, 0.18);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.idx-modal--result .idx-result-cta:hover {
  filter: brightness(1.02);
}

.idx-modal--result .idx-result-cta:active {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 #c9a800,
    0 4px 14px rgba(0, 49, 87, 0.14);
}

.idx-result-foot-note {
  margin: 0.75rem 1.15rem 1.15rem;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: #90a4ae;
}

@media (max-width: 767px) {
  .idx-overlay {
    align-items: center;
    justify-content: center;
    padding: max(0.85rem, env(safe-area-inset-top)) max(0.75rem, env(safe-area-inset-right))
      max(0.85rem, env(safe-area-inset-bottom)) max(0.75rem, env(safe-area-inset-left));
  }

  .idx-modal {
    width: 100%;
    max-width: min(400px, 100%);
    margin: auto;
    border-radius: 16px;
    max-height: min(86dvh, 86vh);
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 28px 60px rgba(0, 49, 87, 0.28);
  }

  .idx-modal--load,
  .idx-modal--result {
    padding: 0;
  }

  .idx-modal-load-foot {
    padding-bottom: max(1.15rem, env(safe-area-inset-bottom));
  }

  .idx-modal-result-body {
    padding-bottom: max(1.35rem, env(safe-area-inset-bottom));
  }

  .idx-modal--result .idx-result-cta {
    margin-bottom: 0;
  }

  .idx-result-foot-note {
    padding-bottom: max(0.25rem, env(safe-area-inset-bottom));
  }

  .idx-result-cta {
    min-height: 3.1rem;
    font-size: max(0.95rem, 16px);
  }
}

@media (max-width: 380px) {
  .idx-overlay {
    padding-left: max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
  }

  .idx-modal {
    max-height: min(84dvh, 84vh);
  }
}
