:root {
  --bg: #f2f2f2;
  --card: #ffffff;
  --green: #00713d;
  --green-dark: #005c32;
  --text: #1a1a1a;
  --muted: #8a8a8a;
  --border: #e2e2e2;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --ok: #00713d;
  --ok-bg: #ecf8f1;
  --warn-bg: #fff8e8;
  --warn-border: #e8c96a;
  --radius: 22px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  --card-narrow: 460px;
  --card-wide: 520px;
  --card-guia: 620px;
  --modal: 460px;
  --modal-wide: 720px;
  --content-max: 1080px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.view[hidden] { display: none !important; }

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#view-login,
#view-redefinir {
  justify-content: center;
  padding: 2rem 1rem;
}

.container-portal {
  max-width: var(--content-max);
}

.card-login {
  width: min(var(--card-narrow), 100%);
  background: var(--card);
  border-radius: 28px;
  box-shadow: 0 12px 40px rgba(17, 24, 16, 0.08);
  overflow: hidden;
  text-align: center;
}

#view-redefinir .step[data-step="vpn-conectar"] {
  text-align: left;
}

.passo-guia-vpn {
  max-height: min(52vh, 420px);
  overflow-y: auto;
  margin: 0.25rem 0 0.85rem;
  padding-right: 0.35rem;
  text-align: left;
}

.passo-guia-vpn h3 {
  margin: 0.75rem 0 0.35rem;
  color: var(--green-dark);
  font-size: 0.92rem;
  font-weight: 700;
}

.passo-guia-vpn h3:first-child {
  margin-top: 0;
}

.passo-guia-vpn p {
  margin: 0 0 0.45rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: #333;
}

.passo-guia-vpn figure {
  margin: 0.55rem 0 0.75rem;
}

.passo-guia-vpn figure img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

.passo-guia-vpn figcaption {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  color: #555;
  line-height: 1.4;
}

.card-login-wide {
  width: min(var(--card-wide), 100%);
}

.card-login-wide.card-login-guia {
  width: min(var(--card-guia), 100%);
}

.card-bar {
  height: 5px;
  background: linear-gradient(
    to right,
    #c8102e 0 25%,
    #f5d76e 25% 50%,
    #7cb342 50% 75%,
    #006837 75% 100%
  );
}

.card-inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  padding: 1.75rem 2.1rem 1.85rem;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
}

.brasao {
  height: 72px;
  width: auto;
  flex-shrink: 0;
}

.brand-text {
  text-align: left;
  line-height: 1.12;
}

.brand-text strong {
  display: block;
  font-size: 1.55rem;
  font-weight: 800;
  color: #141414;
  letter-spacing: -0.04em;
}

.brand-text small {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: #5c5c5c;
  letter-spacing: 0.01em;
}

.card-login h1 {
  margin: 1.35rem 0 1.45rem;
  color: var(--green);
  font-size: 2.05rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
}

.lead {
  margin: 0 0 1rem;
  color: #444;
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: left;
}

form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

input[type="text"],
input[type="password"] {
  width: 100%;
  height: 50px;
  padding: 0 1.25rem;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  background: #fff;
  font-size: 0.98rem;
  outline: none;
}

input::placeholder { color: #b4b4b4; }
input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 113, 61, 0.08); }

.btn-idpge {
  --bs-btn-color: #fff;
  --bs-btn-bg: var(--green);
  --bs-btn-border-color: var(--green);
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: var(--green-dark);
  --bs-btn-hover-border-color: var(--green-dark);
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: var(--green-dark);
  --bs-btn-active-border-color: var(--green-dark);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: var(--green);
  --bs-btn-disabled-border-color: var(--green);
  background: var(--green);
  border: 0;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.btn-idpge:hover:not(:disabled),
.btn-idpge:focus-visible {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: #fff;
}

.btn-idpge:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: #9aa89f;
  border-color: #9aa89f;
  box-shadow: none;
}

.btn-idpge-ghost:disabled {
  background: #f4f4f4;
  color: #8a8a8a;
  border-color: #cfcfcf;
}

#view-login .btn-idpge,
#view-redefinir .btn-idpge {
  width: 100%;
  height: 50px;
  margin-top: 0.15rem;
  border-radius: 999px;
  font-size: 1.05rem;
}

.btn-idpge-ghost {
  background: transparent;
  color: var(--green);
  border: 1px solid var(--green);
}

.btn-idpge-ghost:hover:not(:disabled) {
  background: #ecf8f1;
  color: var(--green-dark);
}

.links {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin-top: 1.35rem;
  padding-top: 0.15rem;
}

.links a {
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  padding: 0 1.15rem;
}

.links a + a {
  border-left: 1px solid #e3e3e3;
}

.links a:hover { text-decoration: underline; }

.login-esqueci {
  margin: 0.85rem 0 0;
  text-align: center;
}

.login-esqueci a {
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.login-esqueci a:hover {
  text-decoration: underline;
}

.msg {
  margin: 0;
  font-size: 0.88rem;
  text-align: left;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
}

.msg-error { color: var(--danger); background: var(--danger-bg); }
.msg-ok { color: var(--ok); background: var(--ok-bg); }

.hint {
  margin: 0;
  font-size: 0.8rem;
  color: var(--muted);
  text-align: left;
}

.campo-senha {
  position: relative;
}

#form-senha {
  position: relative;
}

.campo-isca {
  position: absolute !important;
  left: -9999px !important;
  top: 0 !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.campo-senha input {
  padding-right: 3rem;
}

.btn-olho {
  position: absolute;
  top: 50%;
  right: 0.85rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #6b6b6b;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.btn-olho:hover,
.btn-olho:focus-visible {
  color: var(--green);
  outline: none;
}

.btn-olho[aria-pressed="true"] {
  color: var(--green);
}

.senha-checklist {
  margin: 0;
  padding: 0.65rem 0.85rem 0.65rem 0.5rem;
  list-style: none;
  background: #f6f8f7;
  border: 1px solid #e4ebe6;
  border-radius: 12px;
  text-align: left;
}

.senha-checklist li {
  position: relative;
  margin: 0;
  padding: 0.28rem 0 0.28rem 1.55rem;
  color: #555;
  font-size: 0.82rem;
  line-height: 1.35;
}

.senha-checklist li::before {
  content: "";
  position: absolute;
  left: 0.35rem;
  top: 0.55rem;
  width: 0.7rem;
  height: 0.7rem;
  border: 1.5px solid #9aaba0;
  border-radius: 3px;
  background: #fff;
  box-sizing: border-box;
}

.senha-checklist li.ok {
  color: var(--ok);
  font-weight: 600;
}

.senha-checklist li.ok::before {
  border-color: var(--ok);
  background: var(--ok);
  box-shadow: inset 0 0 0 2px #fff;
}

.senha-checklist li.erro {
  color: var(--danger);
  font-weight: 600;
}

.senha-checklist li.erro::before {
  border-color: var(--danger);
  background: var(--danger);
  box-shadow: inset 0 0 0 2px #fff;
}

#view-conta,
#view-ajuda {
  align-items: stretch;
}

.logo-sm { height: 44px; width: auto; }

.link-idpge {
  color: var(--green) !important;
}

.titulo-painel {
  color: var(--green);
  font-weight: 800;
  font-size: 1.85rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.2rem;
}

.aviso-card {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border) !important;
  border-radius: 14px;
  color: #3a3a3a;
  line-height: 1.5;
  font-size: 0.92rem;
}

.aviso-titulo {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8a6a12;
}

.dado-item {
  background: #f7f8f7;
  border: 1px solid #eef0ee;
  border-radius: 12px;
  padding: 0.9rem 1rem;
}

.dado-label {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.2rem;
}

.dado-valor {
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--text);
  word-break: break-word;
}

.dado-valor.is-empty {
  color: #b0b0b0;
  font-weight: 500;
}

.help h3 {
  margin: 1.2rem 0 0.45rem;
  color: var(--green-dark);
  font-size: 1.02rem;
  font-weight: 700;
}

.help-instrucoes figure {
  margin: 1rem 0 1.4rem;
}

.passo-ajuda-link {
  margin: 0 0 0.85rem;
  font-size: 0.86rem;
  text-align: center;
  color: var(--muted);
}

.passo-ajuda-link a {
  font-weight: 600;
}

.help h2 {
  margin: 1.6rem 0 0.5rem;
  color: var(--green);
  font-size: 1.15rem;
}

.help h2:first-of-type {
  margin-top: 0;
}

.help p, .help li { line-height: 1.5; }
.help ul, .help ol { padding-left: 1.2rem; }
.help figure { margin: 1.2rem 0 1.6rem; }
.help figure img,
.help figure svg.figura-guia,
.modal-instrucoes figure img,
.modal-instrucoes figure svg.figura-guia {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: block;
  background: #fff;
}
.help figcaption {
  margin-top: 0.55rem;
  font-size: 0.9rem;
  color: #444;
  line-height: 1.45;
}
.help code {
  background: #f4f4f4;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  font-size: 0.88em;
}

.lead-center {
  text-align: center;
  font-weight: 600;
  color: var(--text);
}

.codigo-aguarde {
  margin: 0;
  padding: 0.9rem 1rem 0.85rem;
  border-radius: 14px;
  border: 1px solid #c5ddd0;
  background: linear-gradient(180deg, #f3faf6 0%, #eaf5ef 100%);
  text-align: center;
  color: var(--green-dark);
}

.codigo-aguarde-topo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.codigo-aguarde-ico {
  font-size: 1.25rem;
  color: var(--green);
  margin-bottom: 0.15rem;
}

.codigo-aguarde-rotulo {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
}

.codigo-aguarde-relogio {
  margin: 0.1rem 0 0;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.codigo-aguarde-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--green-dark);
}

.codigo-aguarde-unidade {
  margin-left: 0.15rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--green);
}

.codigo-aguarde-texto {
  margin: 0.25rem 0 0;
  font-size: 0.88rem;
  color: #3d5a4a;
}

.codigo-aguarde-trilha {
  margin-top: 0.75rem;
  height: 6px;
  border-radius: 999px;
  background: #d7e8de;
  overflow: hidden;
}

.codigo-aguarde-barra {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 0.9s linear;
}

#view-redefinir .step {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

#view-redefinir .step[hidden] {
  display: none !important;
}

.choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.choice-row .btn-idpge {
  margin-top: 0;
}

.btn-passo-vpn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.85rem;
  border: 1px dashed var(--green);
  border-radius: 12px;
  background: #f7fbf9;
  color: var(--green-dark);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
}

.btn-passo-vpn:hover {
  background: #ecf8f1;
}

.btn-passo-vpn-ico {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  color: var(--green);
}

.vpn-guia-titulo {
  margin: 0 0 0.35rem;
  color: var(--green-dark);
  font-size: 1.05rem;
  font-weight: 800;
  text-align: center;
}

.vpn-guia-lead {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: #444;
  text-align: center;
}

.aviso-modo-teste {
  text-align: center;
  background: #eef6ff;
  border: 1px solid #9ec5fe;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin: 0 0 1rem;
  color: #1a4a7a;
  font-size: 0.88rem;
  line-height: 1.45;
}

.aviso-modo-teste p {
  margin: 0;
}

.aviso-modo-teste-titulo {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0d6efd;
  margin-bottom: 0.35rem !important;
}

.aviso-atencao {
  text-align: left;
  background: #fff4f0;
  border: 1px solid #f0b4a8;
  border-radius: 14px;
  padding: 0.95rem 1rem;
  margin: 0 0 1rem;
  color: #5c2218;
  font-size: 0.9rem;
  line-height: 1.45;
}

#btn-notebook-ciente {
  margin-bottom: 0.35rem;
}

#bloco-notebook-pergunta {
  margin-top: 0.85rem;
}

.aviso-atencao p {
  margin: 0;
}

.aviso-atencao p + p {
  margin-top: 0.45rem;
}

.aviso-atencao-titulo {
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #a33b2b;
  margin-bottom: 0.35rem !important;
}

.aviso-atencao-lg {
  padding: 1.15rem 1.25rem;
  font-size: 1rem;
  border-width: 2px;
  background: linear-gradient(180deg, #fff7f4 0%, #ffefea 100%);
}

.aviso-atencao-lg .aviso-atencao-titulo {
  font-size: 0.82rem;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(18, 28, 22, 0.55);
  backdrop-filter: blur(2px);
}

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

.modal-box {
  width: min(100%, var(--modal));
  background: #fff;
  border-radius: 18px;
  padding: 1.75rem 1.5rem 1.4rem;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
  animation: modal-in 0.22s ease-out;
}

.modal-box-wide {
  width: min(100%, var(--modal-wide));
  max-height: min(92vh, 900px);
  overflow-y: auto;
  text-align: left;
}

.modal-box-wide h2 {
  margin: 0 0 0.75rem;
  color: var(--green-dark);
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
}

.modal-instrucoes h3 {
  margin: 1rem 0 0.35rem;
  color: var(--green-dark);
  font-size: 0.98rem;
  font-weight: 700;
}

.modal-instrucoes p {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: #333;
}

.modal-instrucoes figure {
  margin: 0.6rem 0 0.9rem;
}

.modal-instrucoes figure img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}

.modal-instrucoes figure svg.figura-guia {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  background: #fff;
}

.modal-instrucoes figcaption {
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: #555;
  line-height: 1.4;
}

.modal-ajuda-link {
  margin: 0.75rem 0 1rem !important;
  font-size: 0.88rem !important;
  text-align: center;
  color: var(--muted) !important;
}

.btn-voltar-passo {
  margin-top: 0 !important;
}

@keyframes modal-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.modal-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 0.85rem;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 1.55rem;
  font-weight: 700;
  line-height: 52px;
}

.modal-box h2 {
  margin: 0 0 0.45rem;
  color: var(--green-dark);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.modal-box p {
  margin: 0 0 0.35rem;
  color: #333;
  font-size: 0.95rem;
  line-height: 1.45;
}

.modal-detail {
  color: var(--muted) !important;
  font-size: 0.86rem !important;
  margin-bottom: 1.25rem !important;
}

.modal-box .btn-idpge {
  width: 100%;
  margin-top: 0.35rem;
}

@media (max-width: 640px) {
  .titulo-painel { font-size: 1.55rem; }
}
