/* ==========================================================================
   LGPD FIRST - telas de autenticação (login, 2FA, configuração de 2FA)
   Card central: painel esquerdo (logo + saudação) + formulário à direita.
   Paleta LGPD FIRST (azul Steel Azure + Electric Royal, acento verde bandeira).
   Sem fonte externa (CSP). Namespace .au-.
   ========================================================================== */

.au-body {
  --au-blue: #0054A2;
  /* Steel Azure - institucional (logo) */
  --au-blue-d: #024580;
  /* hover */
  --au-deep: #031881;
  /* Electric Royal - gradientes/profundidade */
  --au-green: #007A11;
  /* verde bandeira - acento/sucesso */
  --au-lime: #90BE13;
  /* lima - acento */
  --au-ink: #0b1b2c;
  --au-text: #566577;
  --au-muted: #8b97a4;
  --au-border: #e0e6ed;
  --au-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  min-height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  box-sizing: border-box;
  overflow-x: hidden;
  background:
    radial-gradient(1100px 500px at 85% -10%, rgba(0, 84, 162, .12), transparent 60%),
    radial-gradient(700px 400px at 5% 110%, rgba(0, 122, 17, .08), transparent 55%),
    #eef3f8;
  font-family: var(--au-font);
  color: var(--au-text);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -.003em;
}

.au-shell {
  flex: 1 1 auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.au-card {
  position: relative;
  width: 100%;
  max-width: 940px;
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  background: #fff;
  border: 1px solid var(--au-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(11, 27, 44, .16);
}

/* fina faixa da bandeira (azul→verde→lima) atravessando todo o topo do card */
.au-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 2px;
  z-index: 2;
  background: linear-gradient(90deg, var(--au-deep), var(--au-blue) 45%, var(--au-green) 80%, var(--au-lime));
}

/* Painel esquerdo: logo + saudação ---------------------------------------- */
.au-side {
  position: relative;
  background:
    radial-gradient(620px 320px at 12% -5%, rgba(0, 84, 162, .14), transparent 60%),
    linear-gradient(160deg, #e9f2fb 0%, #f4f7fb 100%);
  color: var(--au-ink);
  border-right: 1px solid var(--au-border);
  padding: clamp(2rem, 4vw, 3rem);
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
}

.au-brand {
  display: inline-flex;
  text-decoration: none;
}

.au-brand img {
  height: 46px;
  width: auto;
  display: block;
}

.au-side-msg h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.02em;
  margin: 0 0 .55rem;
  color: var(--au-ink);
}

.au-side-msg p {
  font-size: .95rem;
  line-height: 1.6;
  color: var(--au-text);
  margin: 0;
}

.au-side-list {
  list-style: none;
  padding: 0;
  margin: .2rem 0 0;
  display: flex;
  flex-direction: column;
  gap: .65rem;
}

.au-side-list li {
  font-size: .9rem;
  color: var(--au-text);
  display: flex;
  align-items: center;
  gap: .6rem;
}

.au-side-list li::before {
  content: "\2713";
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 122, 17, .12);
  color: var(--au-green);
  display: grid;
  place-items: center;
  font-size: .68rem;
  font-weight: 700;
}

.au-side-foot {
  margin-top: auto;
  font-size: .78rem;
  color: var(--au-muted);
  line-height: 1.5;
}

.au-side-foot a.forte {
  color: var(--au-blue);
  font-weight: 600;
  text-decoration: none;
}

.au-side-foot a.forte:hover {
  text-decoration: underline;
}

/* Crédito abaixo do card (com a logo GESPUBLIC) --------------------------- */
.au-below {
  flex: 0 0 auto;
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding-top: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  flex-wrap: wrap;
  text-align: left;
  color: var(--au-muted);
  font-size: .8rem;
  line-height: 1.5;
}

.au-below-logo {
  height: 36px;
  width: auto;
  flex-shrink: 0;
  display: block;
}

.au-below a.forte {
  color: var(--au-blue);
  font-weight: 600;
  text-decoration: none;
}

.au-below a.forte:hover {
  text-decoration: underline;
}

/* Painel direito: formulário ---------------------------------------------- */
.au-main {
  padding: clamp(2rem, 4vw, 3rem);
  display: flex;
  align-items: center;
}

.au-main-inner {
  width: 100%;
}

.au-logo-sm {
  display: none;
}

.gc-auth-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--au-ink);
  letter-spacing: -.02em;
  margin: 0 0 .35rem;
}

.gc-auth-sub {
  font-size: .95rem;
  color: var(--au-text);
  margin: 0 0 1.7rem;
}

.au-main .form-label {
  font-size: .85rem;
  font-weight: 500;
  color: var(--au-ink);
  margin-bottom: .35rem;
}

.au-main .form-control {
  border: 1px solid var(--au-border);
  border-radius: 10px;
  padding: .7rem .85rem;
  font-size: .95rem;
  color: var(--au-ink);
  background: #fff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.au-main .form-control:focus {
  border-color: var(--au-blue);
  box-shadow: 0 0 0 3px rgba(0, 84, 162, .15);
  outline: 0;
}

.au-code {
  letter-spacing: .5em;
  font-weight: 600;
}

.gc-btn-primary {
  background: var(--au-blue);
  color: #fff;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: .75rem 1.4rem;
  font-weight: 550;
  font-size: .98rem;
  transition: background .15s ease, transform .05s ease;
}

.gc-btn-primary:hover,
.gc-btn-primary:focus {
  background: var(--au-blue-d);
  color: #fff;
}

.gc-btn-primary:active {
  transform: translateY(1px);
}

.au-note {
  font-size: .82rem;
  color: var(--au-muted);
  margin: 1.1rem 0 0;
}

.au-qr {
  text-align: center;
  margin: 0 0 1.1rem;
}

.au-qr img {
  width: 220px;
  height: 220px;
  max-width: 100%;
  border: 1px solid var(--au-border);
  border-radius: 12px;
  padding: 10px;
  background: #fff;
}

.au-qr .au-note {
  margin-top: .5rem;
}

.au-secret {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f4f7fb;
  border: 1px dashed var(--au-border);
  border-radius: 10px;
  padding: .6rem .7rem;
  word-break: break-all;
  color: var(--au-ink);
}

.gc-auth-link {
  margin: 1.3rem 0 0;
  text-align: center;
  font-size: .9rem;
  color: var(--au-muted);
}

.gc-auth-link a {
  color: var(--au-blue);
  text-decoration: none;
  font-weight: 500;
}

.gc-auth-link a:hover {
  text-decoration: underline;
}

.gc-alert-erro,
.alert.gc-alert-erro {
  background: #fdeceb;
  border: 1px solid #f3c5c2;
  color: #b3261e;
  border-radius: 10px;
  padding: .7rem .9rem;
  font-size: .9rem;
  margin-bottom: 1.1rem;
}
/* ===== Captcha de deslizar (motor próprio) + linha de ação ===== */
.au-actions { display:flex; gap:.6rem; align-items:stretch; }
.au-actions .captcha-deslize { flex:1 1 auto; min-width:0; }
.au-actions .au-entrar { flex:0 0 auto; width:auto; height:46px !important; min-height:46px !important; border-radius:10px !important; }

.captcha-deslize { position:relative; user-select:none; touch-action:none; }
.captcha-trilho { position:relative; display:flex; align-items:center; height:46px; border-radius:10px;
  background:#eef3f8; border:1px solid var(--au-border); overflow:hidden; }
.captcha-pino { position:absolute; left:2px; top:2px; width:44px; height:40px; border-radius:8px;
  background:var(--au-blue); color:#fff; display:grid; place-items:center; font-size:1.15rem; font-weight:700;
  cursor:grab; z-index:2; box-shadow:0 2px 6px rgba(0,84,162,.35); transition:background .15s ease; }
.captcha-rotulo { width:100%; text-align:center; font-size:.82rem; color:var(--au-muted); padding-left:22px;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.captcha-deslize.captcha-arrastando .captcha-pino { cursor:grabbing; }
.captcha-deslize.captcha-ok .captcha-trilho { background:rgba(0,122,17,.10); border-color:var(--au-green); }
.captcha-deslize.captcha-ok .captcha-pino { background:var(--au-green); }
.captcha-deslize.captcha-ok .captcha-rotulo { color:var(--au-green); font-weight:600; }
@keyframes captcha-treme { 0%,100%{transform:translateX(0)} 20%{transform:translateX(-6px)} 40%{transform:translateX(6px)} 60%{transform:translateX(-4px)} 80%{transform:translateX(4px)} }
.captcha-deslize.captcha-treme { animation:captcha-treme .35s ease; }

/* =========================================================================
   Responsivo: Empilhamento vertical fiel da tela original (coluna unica)
   - Mantem logo, mensagem explicativa, lista de conformidade e formulario
   - Card centralizado com respiro superior e inferior (sem colar no topo)
   - Tipografia rigorosamente compacta (sem aumentar fontes)
   ========================================================================= */
@media (max-width: 768px) {
  .au-body {
    padding: 1.25rem .75rem;
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: center;
  }

  .au-shell {
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: auto 0;
    min-width: 0;
  }

  .au-card {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    border-radius: 18px;
    min-width: 0;
  }

  .au-side {
    background:
      radial-gradient(620px 320px at 12% -5%, rgba(0, 84, 162, .10), transparent 60%),
      linear-gradient(160deg, #e9f2fb 0%, #f4f7fb 100%);
    padding: 1.35rem 1.2rem 1.15rem;
    gap: .7rem;
    border-right: 0;
    border-bottom: 1px solid var(--au-border);
    min-width: 0;
  }

  .au-brand {
    justify-content: center;
  }

  .au-brand img {
    height: 38px;
  }

  .au-side-msg {
    text-align: center;
  }

  .au-side-msg h2 {
    font-size: 1.05rem;
    font-weight: 600;
    text-align: center;
    margin: 0 0 .3rem;
    color: var(--au-ink);
  }

  .au-side-msg p {
    display: block;
    font-size: .82rem;
    line-height: 1.48;
    color: var(--au-text);
    text-align: center;
    margin: 0;
  }

  .au-side-list {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin: .35rem 0 0;
    padding: 0;
  }

  .au-side-list li {
    font-size: .80rem;
    color: var(--au-text);
    display: flex;
    align-items: center;
    gap: .5rem;
    line-height: 1.35;
  }

  .au-side-list li::before {
    width: 17px;
    height: 17px;
    min-width: 17px;
    min-height: 17px;
    font-size: .60rem;
  }

  .au-side-foot {
    display: none;
  }

  .au-main {
    padding: 1.35rem 1.2rem 1.4rem;
    min-width: 0;
    width: 100%;
  }

  .au-main-inner {
    min-width: 0;
    width: 100%;
  }

  .gc-auth-title {
    font-size: 1.18rem;
    font-weight: 600;
    color: var(--au-ink);
    margin: 0 0 .2rem;
  }

  .gc-auth-sub {
    font-size: .83rem;
    color: var(--au-text);
    margin: 0 0 .95rem;
    line-height: 1.45;
  }

  .au-main .form-label {
    font-size: .80rem;
    margin-bottom: .25rem;
  }

  .au-main .form-control {
    font-size: 16px; /* Evita zoom forçado no iOS Safari ao focar */
    padding: .62rem .8rem;
  }

  .au-main .mb-3 {
    margin-bottom: .75rem !important;
  }

  .au-actions {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    gap: .5rem;
    width: 100%;
  }

  .au-actions .captcha-deslize {
    flex: 1.35 1 0;
    min-width: 0;
  }

  .au-actions .au-entrar {
    flex: 0.95 1 0;
    min-width: 0;
    height: 46px !important;
    min-height: 46px !important;
    border-radius: 10px !important;
    font-size: .92rem !important;
    font-weight: 600 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: .5rem .6rem !important;
    margin: 0 !important;
    white-space: nowrap !important;
  }

  .captcha-trilho {
    height: 46px;
    border-radius: 10px;
  }

  .captcha-pino {
    width: 42px;
    height: 40px;
    border-radius: 8px;
  }

  .captcha-rotulo {
    font-size: .78rem;
    padding-left: 18px;
  }

  .au-voltar {
    margin-top: .95rem;
    font-size: .83rem;
  }

  .au-below {
    padding-top: 1rem;
    font-size: .72rem;
    text-align: center;
    justify-content: center;
    gap: .45rem;
    line-height: 1.4;
  }

  .au-below > div {
    min-width: 0;
  }

  .au-below-logo {
    height: 24px;
  }
}

@media (max-width: 480px) {
  .au-body {
    padding: .9rem .55rem;
  }

  .au-card {
    max-width: 100%;
    border-radius: 16px;
  }

  .au-side {
    padding: 1.15rem 1rem .95rem;
  }

  .au-main {
    padding: 1.15rem 1rem 1.25rem;
  }

  .au-actions {
    gap: .4rem;
    width: 100%;
  }

  .au-actions .captcha-deslize {
    flex: 1.4 1 0;
    min-width: 0;
  }

  .au-actions .au-entrar {
    flex: 0.9 1 0;
    min-width: 0;
  }

  .captcha-pino {
    width: 38px;
    height: 40px;
  }

  .captcha-rotulo {
    font-size: .74rem;
    padding-left: 14px;
  }
}

/* =========================================================================
   Padronizacao de TAMANHO de botao (mesma regra do panel.css; auth.css e o
   unico CSS carregado nas telas de login). Altura/padding/fonte uniformes.
   ========================================================================= */
.btn:not(.btn-close),
.btn-brand,
.gc-btn-primary {
    min-height: 40px !important;
    padding: .5rem 1.2rem !important;
    font-size: .9rem !important;
    line-height: 1.2 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .4rem !important;
}

/* Link "Voltar ao site" abaixo do form de login. */
.au-voltar { text-align: center; margin-top: 1.15rem; }
.au-voltar a { color: #64748b; font-size: .9rem; text-decoration: none; display: inline-flex; align-items: center; }
.au-voltar a:hover { color: var(--brand-primary, #0054A2); text-decoration: underline; }
