/* Epilogue auto-hospedada — garante a mesma fonte em qualquer máquina */
@font-face {
  font-family: "Epilogue";
  font-style: normal;
  font-weight: 300;
  font-display: block;
  src: url("/assets/fonts/Epilogue-300.ttf") format("truetype");
}

@font-face {
  font-family: "Epilogue";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("/assets/fonts/Epilogue-400.ttf") format("truetype");
}

@font-face {
  font-family: "Epilogue";
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("/assets/fonts/Epilogue-700.ttf") format("truetype");
}

/* Inter auto-hospedada */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/Inter-400.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/Inter-500.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/Inter-600.ttf") format("truetype");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/assets/fonts/Inter-700.ttf") format("truetype");
}

:root {
  --bg-deep: #0e1728;
  --bg-mid: #121f35;
  --bg-soft: #e8edf4;
  --surface: #ffffff;
  --surface-muted: #f6f8fb;
  --text-main: #1f2a3d;
  --text-sub: #5f6f85;
  --line: #d3dbe7;
  --line-strong: #b5c2d6;
  --primary: #1d4e89;
  --primary-hover: #163f70;
  --success: #0b6e4f;
  --success-hover: #08553d;
  --error: #b4233c;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", sans-serif;
  color: var(--text-main);
  background:
    linear-gradient(
      120deg,
      rgba(7, 13, 24, 0.94) 0%,
      rgba(16, 29, 51, 0.96) 55%,
      rgba(11, 22, 39, 0.94) 100%
    ),
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.03) 0,
      rgba(255, 255, 255, 0.03) 1px,
      transparent 1px,
      transparent 120px
    );
}

.app-shell {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.topbar {
  height: 72px;
  border-bottom: 1px solid rgba(193, 208, 228, 0.25);
  background: linear-gradient(
    180deg,
    rgba(15, 26, 44, 0.95) 0%,
    rgba(13, 23, 40, 0.95) 100%
  );
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
}

/* VPN Overlay */
.vpn-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(14, 23, 40, 0.98);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
}

.vpn-modal {
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  animation: modalIn 0.3s ease-out;
}

.vpn-icon {
  font-size: 48px;
  margin-bottom: 20px;
}

.vpn-modal h2 {
  color: var(--primary);
  margin: 0 0 16px;
  font-size: 24px;
}

.vpn-modal p {
  color: var(--text-main);
  line-height: 1.6;
  margin: 8px 0;
}

.success-modal {
  max-width: 500px;
  padding: 44px 40px 36px;
}

.success-check {
  width: 92px;
  height: 92px;
  margin: 0 auto 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(
    circle at center,
    rgba(11, 110, 79, 0.1) 0%,
    rgba(11, 110, 79, 0.04) 60%,
    transparent 100%
  );
  animation: successPop 500ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.success-check svg {
  width: 68px;
  height: 68px;
  overflow: visible;
}

.success-check-circle {
  stroke: var(--success);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 151;
  stroke-dashoffset: 151;
  transform: rotate(-90deg);
  transform-origin: center;
  animation: successDraw 700ms ease-out 150ms forwards;
}

.success-check-mark {
  stroke: var(--success);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 34;
  stroke-dashoffset: 34;
  animation: successDraw 420ms ease-out 700ms forwards;
}

.success-modal h2 {
  margin-bottom: 8px;
  color: #14233b;
  font-size: 26px;
}

.success-modal p {
  color: var(--text-sub);
  margin: 0;
}

.success-hint {
  display: block;
  margin: 18px auto 0;
  padding: 10px 16px;
  max-width: 380px;
  border-radius: 8px;
  background: #f2f7f4;
  border: 1px solid #d8e8df;
  color: #2d5a45;
  font-size: 13.5px;
  line-height: 1.5;
}

.success-modal .btn-success {
  margin-top: 24px;
  min-width: 160px;
}

@keyframes successPop {
  from {
    opacity: 0;
    transform: scale(0.6);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes successDraw {
  to {
    stroke-dashoffset: 0;
  }
}

.progress-modal {
  width: min(620px, calc(100vw - 32px));
  min-height: 340px;
  background: #ffffff;
  border: 1px solid #dce4ef;
  border-radius: 10px;
  padding: 36px;
  text-align: left;
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.42);
  animation: modalIn 0.24s ease-out;
}

.progress-copy {
  min-height: 96px;
  display: grid;
  align-content: start;
}

.progress-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e9f2fb;
  color: #1d4e89;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2px;
  margin-bottom: 14px;
}

.progress-copy h2 {
  margin: 0 0 10px;
  color: #14233b;
  font-size: 28px;
  transition:
    opacity 560ms ease,
    transform 560ms ease,
    filter 560ms ease;
}

.progress-copy p {
  margin: 0;
  color: var(--text-sub);
  font-size: 16px;
  line-height: 1.55;
  transition:
    opacity 560ms ease,
    transform 560ms ease,
    filter 560ms ease;
}

.progress-copy.is-text-leaving h2,
.progress-copy.is-text-leaving p {
  opacity: 0;
  transform: translateY(12px);
  filter: blur(2px);
}

.progress-copy.is-text-entering h2,
.progress-copy.is-text-entering p {
  animation: progressTextEnter 760ms ease both;
}

.progress-steps {
  list-style: none;
  padding: 12px 8px 0;
  margin: 34px 0 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: relative;
}

.progress-steps::before {
  content: "";
  position: absolute;
  top: 30px;
  left: calc(16.66% + 8px);
  right: calc(16.66% + 8px);
  height: 3px;
  border-radius: 999px;
  background: #e1e8f2;
}

.progress-steps::after {
  content: "";
  position: absolute;
  top: 30px;
  left: calc(16.66% + 8px);
  width: calc((66.68% - 16px) * var(--timeline-progress, 0));
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--success) 100%);
  transition: width 700ms cubic-bezier(0.22, 1, 0.36, 1);
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: #8b99ac;
  position: relative;
  z-index: 1;
  padding: 0;
}

.step-marker {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid #c7d3e2;
  background: #ffffff;
  position: relative;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 6px #ffffff;
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    box-shadow 220ms ease,
    transform 220ms ease;
}

.step-index {
  font-size: 15px;
  font-weight: 700;
  color: #8b99ac;
  transition:
    color 220ms ease,
    opacity 180ms ease;
}

.step-label {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-align: center;
  transition: color 220ms ease;
}

.progress-step.is-active {
  color: #17365d;
}

.progress-step.is-active .step-label {
  font-weight: 700;
}

.progress-step.is-active .step-marker {
  border-color: var(--primary);
  transform: scale(1.1);
  box-shadow:
    0 0 0 6px #ffffff,
    0 0 0 12px rgba(29, 78, 137, 0.1);
  animation: markerGlow 1.6s ease-in-out infinite;
}

.progress-step.is-active .step-index {
  color: var(--primary);
}

.progress-step.is-active .step-marker::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  opacity: 0;
  animation: timelinePulse 1.4s ease-out infinite;
}

.progress-step.is-done {
  color: var(--success);
}

.progress-step.is-done .step-marker {
  border-color: var(--success);
  background: var(--success);
}

.progress-step.is-done .step-index {
  opacity: 0;
}

.progress-step.is-done .step-marker::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 9px;
  width: 8px;
  height: 14px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

@keyframes markerGlow {
  0%,
  100% {
    box-shadow:
      0 0 0 6px #ffffff,
      0 0 0 12px rgba(29, 78, 137, 0.08);
  }
  50% {
    box-shadow:
      0 0 0 6px #ffffff,
      0 0 0 14px rgba(29, 78, 137, 0.16);
  }
}

@keyframes timelinePulse {
  0% {
    opacity: 0.75;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

@keyframes progressTextEnter {
  from {
    opacity: 0;
    transform: translateY(-12px);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.mismatch-modal {
  max-width: 580px;
  text-align: left;
  padding: 0;
  overflow: hidden;
  border: 1px solid #f2b8c0;
  box-shadow:
    0 24px 56px rgba(71, 8, 20, 0.38),
    0 0 0 1px rgba(180, 35, 60, 0.08) inset;
}

.mismatch-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px 24px;
  background: linear-gradient(180deg, #fff6f8 0%, #ffe9ed 100%);
  border-bottom: 1px solid #f4c4cb;
}

.mismatch-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  line-height: 1;
  color: #ffffff;
  background: #b4233c;
  box-shadow: 0 8px 16px rgba(180, 35, 60, 0.32);
}

.mismatch-head h2 {
  margin: 0;
  color: #8d1327;
  font-size: 22px;
}

.mismatch-subtitle {
  margin: 4px 0 0;
  color: #a4263b;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.1px;
}

.mismatch-body {
  padding: 18px 24px 14px;
}

.mismatch-body p {
  margin: 10px 0;
  color: #4a2430;
}

#mismatchMessage {
  margin-top: 0;
  font-weight: 700;
  color: #931c2f;
}

.mismatch-footer {
  padding: 14px 24px 18px;
  border-top: 1px solid #f4c4cb;
  background: #fff8fa;
}

.mismatch-actions {
  margin-top: 0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@keyframes modalIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #49a2ff;
  box-shadow: 0 0 0 6px rgba(73, 162, 255, 0.15);
}

.brand-texts {
  display: grid;
  gap: 2px;
}

.brand-texts strong {
  color: #e7eef8;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.2px;
}

.brand-texts span {
  color: #96a8c4;
  font-size: 12px;
  font-family: "Inter", sans-serif;
}

.topbar-badge {
  border: 1px solid rgba(145, 169, 201, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  color: #c0d1e8;
  font-size: 12px;
  letter-spacing: 0.2px;
}

.page {
  flex: 1;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 18px;
  overflow-y: auto;
}

.panel {
  width: min(1020px, 100%);
  background: var(--surface);
  border: 1px solid #c9d4e4;
  border-radius: 10px;
  padding: 26px;
  box-shadow:
    0 12px 34px rgba(0, 0, 0, 0.2),
    0 2px 0 rgba(255, 255, 255, 0.8) inset;
}

.panel-head {
  margin-bottom: 20px;
}

h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #14233b;
}

.panel-head p {
  margin: 8px 0 0;
  color: var(--text-sub);
  font-family: "Inter", sans-serif;
  font-size: 18px;
}

.block {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  padding: 16px;
}

.block + .block {
  margin-top: 14px;
}

h2 {
  margin: 0 0 12px;
  font-size: 17px;
  color: #213556;
  font-weight: 700;
}

.cpf-row {
  display: flex;
  gap: 12px;
  align-items: flex-end;
}

.grow {
  flex: 1;
}

.grid {
  margin-top: 6px;
  display: grid;
  grid-template-columns: repeat(2, minmax(250px, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
}

label {
  font-weight: 600;
  font-size: 15px;
  color: #334864;
  font-family: "Inter", sans-serif;
}

input {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 7px 10px;
  min-height: 36px;
  font-size: 16px;
  line-height: 1.35;
  color: #203247;
  background: #fff;
  transition:
    border-color 150ms ease,
    box-shadow 150ms ease;
}

input:focus {
  outline: none;
  border-color: #4f79a9;
  box-shadow: 0 0 0 3px rgba(61, 114, 171, 0.16);
}

input[readonly] {
  background: #edf2f8;
  color: #50637a;
}

.status {
  min-height: 22px;
  margin: 10px 2px 4px;
  color: #355575;
  font-size: 14px;
  font-weight: 500;
}

.status.error {
  color: var(--error);
}

.actions {
  margin-top: 16px;
  display: flex;
  justify-content: flex-end;
}

.btn-primary,
.btn-success {
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.15px;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.version-info {
  margin-top: auto;
  padding: 10px 0 20px;
  display: flex;
  justify-content: center;
}

.badge-v {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.35);
  padding: 3px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  backdrop-filter: blur(4px);
  transition: all 0.2s ease;
}

.badge-v:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success:hover {
  background: var(--success-hover);
}

.btn-primary:disabled,
.btn-success:disabled {
  cursor: not-allowed;
  opacity: 0.85;
}

.btn-success.is-loading::before {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  animation: buttonSpin 0.8s linear infinite;
}

@keyframes buttonSpin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ---- Busca por nome: lista de resultados ---- */
.results-list {
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  display: grid;
  gap: 5px;
  max-height: 220px;
  overflow-y: auto;
}

.result-item {
  padding: 9px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  transition:
    background 120ms,
    border-color 120ms;
  user-select: none;
}

.result-item:hover {
  background: #edf4ff;
  border-color: #4f79a9;
}

.result-item.selected {
  background: #e8f0fb;
  border-color: var(--primary);
}

.result-nome {
  font-weight: 600;
  font-size: 14px;
  color: #1f2a3d;
}

.result-meta {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 2px;
}

.result-count {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-sub);
}

@media (max-width: 820px) {
  .topbar {
    height: 60px;
    padding: 0 16px;
  }

  .brand-texts span,
  .topbar-badge {
    display: none;
  }

  h1 {
    font-size: 22px;
  }

  .panel-head p {
    font-size: 15px;
  }

  .page {
    padding: 20px 12px;
  }

  .panel {
    padding: 18px 16px;
  }

  .cpf-row {
    flex-direction: column;
    align-items: stretch;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .actions {
    justify-content: stretch;
  }

  .btn-success {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .topbar {
    height: 54px;
    padding: 0 12px;
  }

  h1 {
    font-size: 19px;
  }

  .panel-head p {
    font-size: 13px;
  }

  .page {
    padding: 12px 8px;
  }

  .panel {
    padding: 14px 12px;
    border-radius: 8px;
  }

  .block {
    padding: 12px;
  }

  h2 {
    font-size: 15px;
  }

  label {
    font-size: 13px;
  }

  input {
    font-size: 15px;
    padding: 6px 9px;
    min-height: 38px;
  }

  .btn-primary,
  .btn-success {
    font-size: 14px;
    min-height: 40px;
  }

  .version-info {
    padding: 8px 0 14px;
  }

  .mismatch-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

/* Telas desktop/notebook com altura reduzida (ex: 768px) */
@media (min-width: 821px) and (max-height: 820px) {
  .topbar {
    height: 56px;
  }

  .page {
    padding: 16px 18px;
  }

  .panel {
    padding: 18px 22px;
  }

  .panel-head {
    margin-bottom: 12px;
  }

  h1 {
    font-size: 22px;
  }

  .panel-head p {
    font-size: 14px;
  }

  .block {
    padding: 12px 14px;
  }

  .block + .block {
    margin-top: 10px;
  }

  h2 {
    font-size: 14px;
    margin-bottom: 10px;
  }

  .grid {
    gap: 10px;
  }

  label {
    font-size: 13px;
  }

  input {
    min-height: 32px;
    font-size: 14px;
    padding: 5px 9px;
  }

  .status {
    margin: 6px 2px 2px;
    font-size: 13px;
  }

  .actions {
    margin-top: 10px;
  }

  .btn-primary,
  .btn-success {
    min-height: 36px;
    font-size: 14px;
  }

  .version-info {
    padding: 6px 0 10px;
  }
}
