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

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  background: linear-gradient(165deg, #eef2ff 0%, #f8fafc 38%, #f1f5f9 100%);
  color: #0f172a;
}

.wrap {
  max-width: 460px;
  margin: 0 auto;
  padding: 2.25rem 1.25rem 2.5rem;
}

.head h1 {
  margin: 0 0 0.4rem;
  font-size: 1.625rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #0f172a;
}

.sub {
  margin: 0;
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.5;
}

.card {
  margin-top: 1.5rem;
  padding: 1.5rem 1.35rem;
  background: #fff;
  border-radius: 18px;
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 12px 40px rgba(15, 23, 42, 0.08);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.lbl {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.5rem;
}

.row {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
}

#codigo {
  flex: 1 1 160px;
  min-width: 0;
  padding: 0.7rem 0.95rem;
  font-size: 1rem;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-family: inherit;
  background: #fafbfc;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

#codigo:focus {
  outline: none;
  border-color: #6366f1;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
  padding: 0.7rem 1.25rem;
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: inherit;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn.primary {
  background: linear-gradient(180deg, #4f46e5 0%, #4338ca 100%);
  color: #fff;
  box-shadow: 0 2px 8px rgba(67, 56, 202, 0.35);
}

.btn.primary:hover {
  background: linear-gradient(180deg, #4338ca 0%, #3730a3 100%);
}

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

.btn.primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.hint {
  margin: 0.85rem 0 0;
  font-size: 0.8125rem;
  color: #94a3b8;
  line-height: 1.45;
}

.foot {
  margin-top: 2rem;
  font-size: 0.8125rem;
  text-align: center;
  line-height: 1.55;
}

.muted {
  color: #94a3b8;
}

.hidden {
  display: none !important;
}

/* Resultado — cartão estilo “comprovante” */
#result-section.card {
  padding: 0;
  overflow: hidden;
}

.result-shell {
  text-align: center;
  padding: 1.75rem 1.35rem 1.6rem;
}

.result-shell--ok {
  background: linear-gradient(180deg, #f0fdf4 0%, #ffffff 42%);
  border-bottom: 1px solid rgba(34, 197, 94, 0.15);
}

.result-shell--warn {
  background: linear-gradient(180deg, #fffbeb 0%, #ffffff 42%);
  border-bottom: 1px solid rgba(245, 158, 11, 0.2);
}

.result-shell--err {
  background: linear-gradient(180deg, #fef2f2 0%, #ffffff 45%);
  border-bottom: 1px solid rgba(239, 68, 68, 0.12);
}

.result-shell--loading {
  padding: 2rem 1.35rem;
}

.result-icon-svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 1rem;
  color: #16a34a;
}

.result-shell--warn .result-icon-svg {
  color: #d97706;
}

.result-shell--err .result-icon-svg {
  color: #dc2626;
}

.result-icon-svg--warn {
  color: #d97706;
}

.result-icon-svg--err {
  color: #dc2626;
}

.result-body {
  text-align: left;
}

.result-heading {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.result-shell--ok .result-heading {
  color: #15803d;
}

.result-shell--warn .result-heading {
  color: #b45309;
}

.result-shell--err .result-heading {
  color: #b91c1c;
}

.result-lead {
  margin: 0 0 1.25rem;
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.5;
}

.result-text {
  margin: 0;
  font-size: 0.9375rem;
  color: #64748b;
  line-height: 1.5;
}

.detail-grid {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0.35rem 0;
  overflow: hidden;
}

.detail-row {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #f1f5f9;
}

.detail-row:last-child {
  border-bottom: none;
}

@media (min-width: 400px) {
  .detail-row {
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
  }
}

.detail-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
  flex-shrink: 0;
}

.detail-value {
  font-size: 0.9375rem;
  color: #1e293b;
  font-weight: 500;
  text-align: left;
  word-break: break-word;
}

@media (min-width: 400px) {
  .detail-value {
    text-align: right;
    max-width: 62%;
  }
}

.err-detail {
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: #94a3b8;
  word-break: break-word;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 0 auto 1rem;
  border: 3px solid #e2e8f0;
  border-top-color: #6366f1;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

.result-loading-text {
  margin: 0;
  font-size: 0.9375rem;
  color: #64748b;
}
