@import url("https://cdngovbr-ds.estaleiro.serpro.gov.br/design-system/fonts/rawline/css/rawline.css");

:root {
  --govbr-blue: #1351b4;
  --pgmei-border: #e6e6e6;
  --pgmei-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #f2f2f2;
  color: #333;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.43;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; height: auto; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
a { color: inherit; text-decoration: none; }

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 0 8px;
  font-family: "Rawline", sans-serif;
}
.app-inner { display: flex; flex-direction: column; flex: 1; background: #fff; }

/* Header */
.gov-header { background: #fff; }
.gov-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--pgmei-border); }
.gov-row .spacer { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.gov-row .divider { width: 1px; height: 20px; background: #ccc; }
.gov-logo { height: 20px; width: auto; }
.lang-btn { display: flex; align-items: center; gap: 4px; color: var(--govbr-blue); font-weight: 600; font-size: 14px; }
.icon-btn { color: var(--govbr-blue); width: 16px; height: 16px; }
.user-pill {
  display: flex; align-items: center; gap: 8px;
  border-radius: 9999px; background: var(--govbr-blue);
  color: #fff; font-size: 14px; font-weight: 600;
  padding: 6px 16px;
}
.menu-row { color: #333; font-size: 14px; }
.breadcrumb { padding: 12px 16px; border-bottom: 1px solid var(--pgmei-border); background: #f8f8f8; }
.breadcrumb ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 8px;
  color: var(--govbr-blue); font-size: 14px;
}
.breadcrumb li.last { font-weight: 600; }

/* Main */
main { flex: 1; padding: 8px 0 16px; }
.section { background: #fff; border-radius: 4px; padding: 16px; }
.section + .section { margin-top: 16px; }
.box-cnpj { border: 1px solid var(--pgmei-border); padding: 8px 16px; box-shadow: 0 2px 4px rgba(0,0,0,0.12); margin: 0 0 16px; }
.box-cnpj p { margin: 4px 0; font-size: 14px; }
.error-text { color: #a94442; font-size: 13px; }

.alert-red {
  background: #fdecea; border: 2px solid #d9534f; padding: 12px;
  border-radius: 4px; color: #a94442; text-align: left;
}
.alert-red p { margin: 4px 0; }
.alert-red .title { font-weight: 700; }
.section-title { font-size: 18px; font-weight: 700; text-align: center; }
.muni-title { display: flex; align-items: center; justify-content: center; gap: 12px; }
.muni-title h2 { font-size: 16px; font-weight: 700; color: #333; margin: 0; }
.muni-title img { height: 36px; width: auto; }

.btn-primary {
  width: 100%; padding: 12px 16px;
  border-radius: 9999px; background: var(--govbr-blue);
  color: #fff; font-weight: 600; font-size: 15px;
  box-shadow: var(--pgmei-shadow);
}
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.sticky-cta { position: sticky; bottom: 8px; z-index: 10; background: #fff; padding-top: 8px; margin-top: 16px; }

/* CNPJ form */
.identify { padding: 24px 20px; color: #333; }
.identify h2 { font-size: 18px; font-weight: 700; margin: 0 0 16px; }
.identify .row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.identify p { font-size: 14px; margin: 0 0 12px; }
.identify label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.identify input {
  width: 100%; padding: 12px 16px; border: 1px solid #888;
  border-radius: 4px; font-size: 14px; font-style: italic; color: #555;
  outline: none;
}
.identify input.invalid { border-color: #a94442; }
.identify .options { margin-top: 32px; padding: 0; list-style: none; }
.identify .options li { padding: 12px 0; border-top: 1px solid #ddd; display: flex; align-items: center; gap: 12px; font-size: 14px; }
.identify .options li:first-child { border-top: 0; }
.identify .options .badge {
  margin-left: 8px; font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 4px; background: #168821; color: #fff;
}
.identify .help { margin-top: 32px; text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.identify .help a { font-size: 14px; color: var(--govbr-blue); font-weight: 600; }

/* PIX */
.pix-section { position: relative; padding: 20px; border: 1px solid var(--pgmei-border); border-radius: 4px; box-shadow: var(--pgmei-shadow); background: #fff; }
.pix-close {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border: 1px solid #ccc; background: #fff;
  border-radius: 4px; display: flex; align-items: center; justify-content: center;
  color: #666; font-size: 16px;
}
.pix-title { text-align: center; color: #3c763d; font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.pix-amount { text-align: center; color: #3c763d; font-size: 13px; margin: 0 0 16px; }
.pix-textarea { width: 100%; border: 1px solid #ccc; padding: 8px; border-radius: 4px; font-family: monospace; font-size: 11px; word-break: break-all; resize: none; }
.pix-copy { width: 100%; padding: 8px 16px; border-radius: 4px; background: #5cb85c; color: #fff; font-weight: 600; font-size: 14px; margin-top: 8px; }
.pix-copy.copied { background: #3c763d; }
.pix-qr { display: flex; justify-content: center; padding: 12px; border: 1px solid #e0e0e0; border-radius: 4px; background: #fff; margin-top: 12px; }
.pix-qr img, .pix-qr canvas { width: 220px; height: 220px; }
.pix-await { text-align: center; font-size: 12px; color: #666; margin-top: 12px; }
.pix-success { text-align: center; padding: 24px 0; }
.pix-success .check { display: inline-flex; padding: 12px; background: #dff0d8; border: 2px solid #5cb85c; border-radius: 50%; }
.pix-success h3 { color: #3c763d; font-size: 16px; font-weight: 700; }
.pix-error { text-align: center; padding: 24px 0; color: #a94442; }
.pix-error h3 { font-size: 15px; font-weight: 700; }
.spinner { display: inline-block; width: 20px; height: 20px; border: 3px solid #cfe6cf; border-top-color: #3c763d; border-radius: 50%; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Footer */
.gov-footer { background: #0c326f; padding: 24px 16px; margin: 16px -8px 0; color: #fff; font-family: "Rawline", sans-serif; }
.gov-footer img { height: 28px; filter: brightness(0) invert(1); margin-bottom: 24px; }
.gov-footer h3 { font-size: 16px; font-weight: 700; margin: 0 0 12px; }
.gov-footer ul { list-style: none; padding: 0; margin: 0 0 24px; font-size: 14px; }
.gov-footer ul li { margin-bottom: 12px; }

/* Aprovado */
.approved-card { padding: 24px; background: #fff; border-radius: 4px; box-shadow: var(--pgmei-shadow); text-align: center; }
.approved-icon { display: inline-flex; padding: 12px; background: #dff0d8; border: 2px solid #5cb85c; border-radius: 50%; }
.approved-icon svg { width: 40px; height: 40px; color: #3c763d; }
.approved h2 { color: #3c763d; font-size: 20px; font-weight: 700; }
.approved p { font-size: 14px; color: #333; }
.approved .warn { background: #fcf8e3; border: 2px solid #f0ad4e; border-radius: 4px; padding: 16px; text-align: left; color: #8a6d3b; }
.approved .warn .title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.approved .warn p { color: #8a6d3b; font-size: 13px; margin: 0; }

.hidden { display: none !important; }
