:root {
  --green: #0a6b52;
  --green-dark: #085a45;
  --green-mid: #1a7a5c;
  --green-lime: #b8d96e;
  --green-soft: #eef6f0;
  --border: #d1dbe3;
  --white: #ffffff;
  --radius: 14px;
  --radius-lg: 24px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --app-max: 430px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  color: #334155;
  background: #e8f0ec;
}

.splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(165deg, #0a6b52 0%, #074836 100%);
  transition: opacity 0.45s ease, visibility 0.45s ease;
}

.splash.splash--hide {
  opacity: 0;
  visibility: hidden;
}

.splash__inner {
  width: min(100%, 320px);
  text-align: center;
}

.splash__logo {
  display: block;
  width: min(240px, 78vw);
  height: auto;
  margin: 0 auto 28px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.15));
}

.splash__text {
  min-height: 3rem;
  margin: 0 0 24px;
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.45;
  color: #ffffff;
  animation: splashFade 0.45s ease;
}

.splash__progress {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}

.splash__progress-bar {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: #ffffff;
  animation: splashProgress 5s linear forwards;
}

@keyframes splashProgress {
  to {
    width: 100%;
  }
}

@keyframes splashFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.app--boot {
  visibility: hidden;
}

.app--ready {
  visibility: visible;
}

.app {
  max-width: var(--app-max);
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--white);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

@media (min-width: 520px) {
  body {
    padding: 12px 0;
  }

  .app {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 16px 40px rgba(11, 92, 72, 0.15);
  }
}

.page-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #f4f8f6;
}

.page-main--cpf {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #eef4f1 0%, #f8faf9 55%, #ffffff 100%);
}

.hero-banner {
  line-height: 0;
  background: var(--white);
}

.hero-banner--mobile {
  flex-shrink: 0;
}

.hero-banner__img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
}

.cpf-sheet {
  flex: none;
  display: flex;
  flex-direction: column;
  margin-top: 14px;
  padding: 0 14px calc(16px + var(--safe-bottom));
}

.card {
  margin: 0;
  padding: 22px 18px 20px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow:
    0 16px 40px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(15, 23, 42, 0.04);
}

.card--cpf {
  border-radius: 22px;
}

.card__accent {
  display: block;
  width: 44px;
  height: 4px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green) 0%, var(--green-lime) 100%);
}

.card__title {
  margin: 0 0 8px;
  font-size: clamp(1.05rem, 4.5vw, 1.1875rem);
  font-weight: 700;
  line-height: 1.35;
  color: var(--green-dark);
}

.card__hint {
  margin: 0 0 18px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #64748b;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.cpf-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 14px 6px 6px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: var(--white);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.cpf-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(10, 107, 82, 0.12);
}

.cpf-field__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 10px;
  flex-shrink: 0;
}

.cpf-field__input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 500;
  color: #0f172a;
  border: none;
  outline: none;
  background: transparent;
}

.cpf-field__input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}

.card__error {
  min-height: 1.125rem;
  margin: 8px 2px 0;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #b91c1c;
}

.btn-continuar {
  width: 100%;
  margin-top: 16px;
  padding: 16px 20px;
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(180deg, var(--green) 0%, var(--green-dark) 100%);
  border: none;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(10, 107, 82, 0.32);
  transition: transform 0.12s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.btn-continuar--arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-continuar:active {
  transform: scale(0.98);
}

.secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 20px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
}

.secure--cpf {
  padding-bottom: 4px;
}

.secure__icon {
  display: flex;
  color: var(--green-mid);
}

.view:not(.view--active) {
  display: none;
}

.view--active {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 100dvh;
}

#view-cpf.view--active {
  overflow: hidden;
}

#view-dados.view--active {
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--green);
}

.topbar__logo {
  height: 30px;
  width: auto;
  max-width: 140px;
}

.topbar__menu {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
}

.topbar__menu span {
  display: block;
  width: 22px;
  height: 2px;
  margin-left: auto;
  background: var(--white);
  border-radius: 2px;
}

.dados-page {
  flex: 1;
  padding: 20px 16px calc(20px + var(--safe-bottom));
  background: #f8faf9;
}

.dados-sheet .confirm-hero {
  margin-bottom: 16px;
}

#view-dados .btn-continuar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.dados-page__title {
  margin: 0 0 8px;
  font-size: 1.375rem;
  font-weight: 700;
  color: #0f172a;
}

.dados-page__intro {
  margin: 0 0 18px;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #64748b;
}

.dados-sheet {
  gap: 0;
}

.sheet-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-bottom: 10px;
  padding: 4px 0;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green);
  background: none;
  border: none;
  cursor: pointer;
}

.flow-steps--sheet {
  padding: 12px 14px;
  margin-bottom: 14px;
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.05);
}

.flow-steps--sheet .flow-steps__list {
  padding-bottom: 0;
}

.flow-steps {
  padding: 12px 16px 0;
  background: linear-gradient(180deg, var(--green) 0%, #0a6b52 100%);
}

.flow-steps--light {
  padding: 18px 16px 4px;
  background: transparent;
}

.flow-steps__list {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
  padding: 0 0 14px;
  list-style: none;
}

.flow-steps__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  text-align: center;
  opacity: 0.55;
}

.flow-steps__item--done,
.flow-steps__item--active {
  opacity: 1;
}

.flow-steps__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--green);
  background: rgba(255, 255, 255, 0.35);
  border: 2px solid transparent;
  border-radius: 50%;
}

.flow-steps__item--done .flow-steps__dot {
  color: var(--white);
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.5);
}

.flow-steps__item--active .flow-steps__dot {
  color: var(--green);
  background: var(--white);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.flow-steps__label {
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.92);
}

.flow-steps--light .flow-steps__item {
  opacity: 0.45;
}

.flow-steps--light .flow-steps__item--done,
.flow-steps--light .flow-steps__item--active {
  opacity: 1;
}

.flow-steps--light .flow-steps__dot {
  color: var(--green);
  background: #e2e8f0;
}

.flow-steps--light .flow-steps__item--done .flow-steps__dot {
  color: var(--white);
  background: var(--green-mid);
  border-color: transparent;
}

.flow-steps--light .flow-steps__item--active .flow-steps__dot {
  color: var(--white);
  background: var(--green);
  box-shadow: 0 4px 12px rgba(10, 107, 82, 0.25);
}

.flow-steps--light .flow-steps__label {
  color: #64748b;
}

.flow-steps--light .flow-steps__item--active .flow-steps__label {
  color: var(--green-dark);
}

.confirm-hero {
  margin-bottom: 18px;
}

.confirm-hero__eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green-mid);
}

.confirm-hero__title {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
}

.confirm-hero__text {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: #64748b;
}

.beneficiario-card {
  margin-bottom: 16px;
  padding: 16px;
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.beneficiario-card__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f1f5f9;
}

.beneficiario-card__avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 50%;
  flex-shrink: 0;
}

.beneficiario-card__title {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.beneficiario-card__subtitle {
  margin: 0;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.info-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}

.info-grid__item {
  margin: 0;
}

.info-grid__label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 4px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748b;
}

.info-grid__label svg {
  flex-shrink: 0;
  color: var(--green-mid);
}

.info-grid__value {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
  word-break: break-word;
}

.info-grid__value--mono {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.info-grid__item--status .info-grid__value {
  font-weight: 500;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
}

.status-chip--pendente {
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.pendencia-card {
  margin-bottom: 18px;
  padding: 16px;
  background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 100%);
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-lg);
}

.pendencia-card__header {
  display: flex;
  gap: 12px;
  margin-bottom: 14px;
}

.pendencia-card__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--green);
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(10, 107, 82, 0.08);
  flex-shrink: 0;
}

.pendencia-card__title {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}

.pendencia-card__desc {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: #64748b;
}

.pendencia-card__valor-box {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  padding: 12px 14px;
  background: var(--white);
  border: 1px solid #dcfce7;
  border-radius: 12px;
}

.pendencia-card__valor-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #64748b;
}

.pendencia-card__valor {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--green);
}

.pendencia-card__lista {
  margin: 0;
  padding: 0 0 0 18px;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: #475569;
}

.confirm-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 14px 0 0;
  font-size: 0.75rem;
  color: #64748b;
}

.confirm-trust svg {
  flex-shrink: 0;
  color: var(--green-mid);
}

.btn-continuar--block {
  margin-top: 0;
}

.btn-continuar:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.45);
  padding: 20px;
}

.loading-overlay.loading-overlay--visible {
  display: flex;
}

.loading-box {
  width: min(100%, 320px);
  padding: 24px 20px;
  text-align: center;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
}

.loading-box__spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 16px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

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

.loading-box__title {
  margin: 0 0 6px;
  font-size: 1.0625rem;
  font-weight: 700;
  color: #0f172a;
}

.loading-box__text {
  margin: 0;
  font-size: 0.875rem;
  color: #64748b;
}

body.is-locked {
  overflow: hidden;
}

.card__error--block {
  margin: 0 0 12px;
}

.card__error--block[hidden] {
  display: none;
}

.topbar__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--white);
  cursor: pointer;
}

.topbar__logo--center {
  margin: 0 auto;
}

.topbar__spacer {
  width: 40px;
  flex-shrink: 0;
}

.topbar:has(.topbar__back) {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.pagamento-page {
  padding-bottom: calc(28px + var(--safe-bottom));
}

.pix-valor-card {
  padding: 16px;
  margin-bottom: 16px;
  text-align: center;
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
}

.pix-valor-card__label {
  display: block;
  font-size: 0.8125rem;
  color: #64748b;
}

.pix-valor-card__valor {
  margin: 4px 0 0;
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--green);
}

.pix-qr-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--white);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
}

.pix-qr-img {
  display: block;
  width: min(240px, 70vw);
  height: auto;
  border-radius: 8px;
}

.pix-qr-placeholder {
  margin: 0;
  font-size: 0.9375rem;
  color: #64748b;
}

.pix-copy-label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
}

.pix-copy-field {
  width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  line-height: 1.4;
  color: #0f172a;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  resize: none;
}

.btn-continuar--outline {
  color: var(--green);
  background: var(--white);
  border: 2px solid var(--green);
  box-shadow: none;
}

.btn-continuar--outline:hover {
  background: var(--green-soft);
}

.pix-status {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  padding: 12px 14px;
  font-size: 0.875rem;
  line-height: 1.45;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
}

.pix-status__dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  margin-top: 6px;
  background: #2563eb;
  border-radius: 50%;
  animation: pixPulse 1.2s ease-in-out infinite;
}

@keyframes pixPulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.35;
  }
}

.pix-status--ok {
  color: #166534;
  background: #ecfdf5;
  border-color: #86efac;
}

.pix-status--ok .pix-status__dot {
  background: #16a34a;
  animation: none;
}

.btn-link {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--green);
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.sucesso-page {
  text-align: center;
  padding-top: 32px;
}

.sucesso-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
  color: var(--green);
}
