/* Login, "Minha conta" e "Usuários" (carregado depois de estilo.css). */

:root {
  --azul: #2f5d8a;
  --azul-escuro: #1c3b5a;
  --tinta: #1d2b3a;
  --verde: #3aa876;
  --foco: rgba(47, 93, 138, .2);
}

/* =================================================================== */
/* Login                                                               */
/* =================================================================== */

.pagina-login {
  min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem;
  background:
    radial-gradient(circle at 1.5px 1.5px, rgba(47, 93, 138, .13) 1.5px, transparent 0) 0 0 / 22px 22px,
    radial-gradient(ellipse at 15% 10%, #dfe8f2 0, transparent 55%),
    radial-gradient(ellipse at 90% 90%, #e4ece6 0, transparent 50%),
    #eef1f5;
  transition: opacity .25s;
}
.pagina-login.saindo { opacity: 0; }

.login {
  width: min(980px, 100%); min-height: 600px;
  display: grid; grid-template-columns: 1.05fr 1fr;
  background: #fff; border-radius: 20px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 32, 48, .06), 0 20px 50px -12px rgba(16, 32, 48, .28);
  animation: surgir .5s cubic-bezier(.2, .8, .2, 1) both;
}
@keyframes surgir { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* ---------- lado da marca ---------- */
.login-marca {
  position: relative; overflow: hidden; color: #fff;
  padding: 2.6rem 2.6rem 2.2rem; display: flex; flex-direction: column; gap: 1.4rem;
  background:
    radial-gradient(circle at 1.5px 1.5px, rgba(255, 255, 255, .09) 1.5px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(155deg, var(--azul) 0%, var(--azul-escuro) 100%);
}
.login-marca::after { /* brilho suave atrás da folha */
  content: ""; position: absolute; width: 380px; height: 380px; right: -90px; top: 120px;
  background: radial-gradient(circle, rgba(255, 255, 255, .16), transparent 65%); pointer-events: none;
}
.marca-icone {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); margin-bottom: .9rem;
}
.marca-texto h1 { margin: 0; font-size: 1.75rem; letter-spacing: -.01em; }
.marca-texto p { margin: .45rem 0 0; font-size: 1rem; line-height: 1.45; opacity: .82; max-width: 22rem; }

.ilustracao {
  position: relative; z-index: 1; width: min(250px, 70%); align-self: center; margin: auto 0;
  filter: drop-shadow(0 18px 28px rgba(0, 0, 0, .3));
}
.ilustracao .folha { transform-origin: 120px 150px; transform: rotate(-5deg); animation: flutuar 6s ease-in-out 1.2s infinite; }
@keyframes flutuar { 50% { transform: rotate(-3.5deg) translateY(-6px); } }

.marcas circle { transform-box: fill-box; transform-origin: center; animation: marcar .42s cubic-bezier(.3, 1.6, .5, 1) both; }
.marcas circle:nth-of-type(1) { animation-delay: .45s; }
.marcas circle:nth-of-type(2) { animation-delay: .62s; }
.marcas circle:nth-of-type(3) { animation-delay: .79s; }
.marcas circle:nth-of-type(4) { animation-delay: .96s; }
.marcas circle:nth-of-type(5) { animation-delay: 1.13s; }
.marcas circle:nth-of-type(6) { animation-delay: 1.30s; }
.marcas circle:nth-of-type(7) { animation-delay: 1.47s; }
.marcas circle:nth-of-type(8) { animation-delay: 1.64s; }
@keyframes marcar { from { transform: scale(0); opacity: 0; } }
.selo { transform-box: fill-box; transform-origin: center; animation: carimbar .5s cubic-bezier(.3, 1.7, .5, 1) 2s both; }
@keyframes carimbar { from { transform: scale(0) rotate(-40deg); opacity: 0; } }

.marca-lista { position: relative; z-index: 1; list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; font-size: .9rem; }
.marca-lista li { display: flex; align-items: center; gap: .55rem; opacity: .9; }
.marca-lista li::before {
  content: ""; flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .75); box-shadow: inset 0 0 0 2px var(--azul-escuro), inset 0 0 0 7px #fff;
}

/* ---------- lado dos formulários ---------- */
.login-lado { padding: 3rem 3rem 2.4rem; display: flex; flex-direction: column; justify-content: center; gap: 1rem; }
.etapa { animation: entrarEtapa .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes entrarEtapa { from { opacity: 0; transform: translateX(16px); } }
.etapa h2 { margin: 0; font-size: 1.6rem; color: var(--tinta); letter-spacing: -.01em; }
.etapa .sub { margin: .35rem 0 1.6rem; color: var(--suave); line-height: 1.45; }
.etapa form { display: grid; gap: 1rem; }

.campo { font-size: .85rem; font-weight: 600; color: #44505c; }
.entrada { position: relative; display: block; margin-top: .35rem; }
.entrada .icone {
  position: absolute; left: .85rem; top: 50%; translate: 0 -50%; width: 18px; height: 18px; pointer-events: none;
  fill: none; stroke: #8795a3; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: stroke .15s;
}
.entrada input {
  margin: 0; height: 48px; padding: 0 2.9rem 0 2.6rem; font-size: 1rem; color: var(--tinta);
  border: 1.5px solid #d5dce3; border-radius: 11px; background: #f9fbfc;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.entrada input:hover { border-color: #b9c4ce; }
.entrada input:focus { outline: none; border-color: var(--azul); background: #fff; box-shadow: 0 0 0 4px var(--foco); }
.entrada:focus-within .icone { stroke: var(--azul); }

.ver-senha {
  position: absolute; right: .35rem; top: 50%; translate: 0 -50%;
  width: 38px; height: 38px; padding: 0; border: 0; border-radius: 8px; background: none; display: grid; place-items: center;
}
.ver-senha:hover { background: #eef2f6; }
.ver-senha:focus-visible { outline: 2px solid var(--azul); }
.ver-senha svg { width: 20px; height: 20px; fill: none; stroke: #6d7b89; stroke-width: 1.8; stroke-linecap: round; }
.ver-senha[aria-pressed="false"] .risco { display: none; }

.aviso-caps { margin: -.4rem 0 0; font-size: .82rem; color: #9a6400; }
.lembrar { font-size: .9rem; color: #44505c; }
.lembrar input { accent-color: var(--azul); width: 16px; height: 16px; }

.erro-login {
  margin: 0; padding: .65rem .8rem; border-radius: 10px; font-size: .9rem; line-height: 1.4;
  background: #fdf0f0; color: #8f2424; border: 1px solid #f2caca;
}
.tremer { animation: tremer .4s; }
@keyframes tremer { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.botao-entrar {
  position: relative; height: 50px; margin-top: .3rem; border: 0; border-radius: 11px;
  font-size: 1rem; font-weight: 650; color: #fff; letter-spacing: .01em;
  background: linear-gradient(180deg, #386ca0, var(--azul));
  box-shadow: 0 1px 0 rgba(255, 255, 255, .25) inset, 0 8px 18px -8px rgba(47, 93, 138, .8);
  transition: transform .12s, box-shadow .15s, filter .15s;
}
.botao-entrar:hover:not(:disabled) { filter: brightness(1.06); transform: translateY(-1px); }
.botao-entrar:active:not(:disabled) { transform: translateY(0); }
.botao-entrar:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--foco), 0 8px 18px -8px rgba(47, 93, 138, .8); }
.botao-entrar:disabled { opacity: .75; cursor: default; }
.botao-entrar.carregando span { visibility: hidden; }
.botao-entrar.carregando::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: girar .7s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

.rodape-login { margin: 1.4rem 0 0; font-size: .82rem; color: var(--suave); line-height: 1.55; }

.aviso-http {
  padding: .6rem .8rem; border-radius: 10px; font-size: .85rem; line-height: 1.4;
  background: #fff7e6; color: #7a5200; border: 1px solid #f3dca8;
}

/* ---------- etapa do código ---------- */
.etapa-icone {
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px; margin-bottom: 1rem;
  background: #e9f0f7; color: var(--azul);
}
.etapa-icone svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.etapa-icone.ok { background: #e6f5ee; color: var(--verde); }
.etapa-icone.ok svg { stroke-width: 2.6; }

.entrada-codigo {
  height: 64px; text-align: center; font-size: 2rem; letter-spacing: .3em; font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; color: var(--tinta);
  border: 1.5px solid #d5dce3; border-radius: 12px; background: #f9fbfc;
}
.entrada-codigo.recuperacao { font-size: 1.35rem; letter-spacing: .12em; }
.entrada-codigo::placeholder { color: #cdd5dd; }
.entrada-codigo:focus { outline: none; border-color: var(--azul); background: #fff; box-shadow: 0 0 0 4px var(--foco); }

.links-codigo { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: 1.2rem; }
button.link {
  padding: 0; border: 0; background: none; color: var(--azul); font-size: .88rem; text-decoration: underline;
  text-decoration-color: rgba(47, 93, 138, .35); text-underline-offset: 3px;
}
button.link:hover { text-decoration-color: currentColor; }

/* ---------- celular ---------- */
@media (max-width: 820px) {
  .pagina-login { padding: 0; place-items: stretch; }
  .login { grid-template-columns: 1fr; min-height: 100vh; border-radius: 0; box-shadow: none; }
  .login-marca { padding: 1.6rem 1.4rem; }
  .marca-icone { margin-bottom: .6rem; }
  .marca-texto h1 { font-size: 1.4rem; }
  .ilustracao, .marca-lista, .login-marca::after { display: none; }
  .login-lado { padding: 2rem 1.4rem 2.4rem; justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* =================================================================== */
/* Minha conta / Usuários                                              */
/* =================================================================== */

.pagina-estreita { max-width: 900px; margin: 0 auto; padding: 1.2rem 1rem 3rem; display: grid; gap: 1rem; }
.pagina-estreita .painel h2 { margin: .1rem 0 .8rem; font-size: 1.05rem; }
.pagina-estreita .painel > p:first-of-type { margin-top: 0; }
.formulario { display: grid; gap: .7rem; max-width: 26rem; }
.formulario.em-linha { max-width: none; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); align-items: end; }
.acoes { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.msg { margin: 0; font-size: .88rem; }
.msg.ok { color: #1f7a4f; }
.msg.erro { color: var(--perigo); }

.pendencia {
  padding: .9rem 1rem; border-radius: var(--raio); line-height: 1.45;
  background: #fff7e6; border: 1px solid #f3dca8; color: #5c3f00;
}
.pendencia b { display: block; margin-bottom: .15rem; }

.medidor { height: 6px; border-radius: 3px; background: #e6eaee; overflow: hidden; }
.medidor span { display: block; height: 100%; width: 0; border-radius: inherit; transition: width .25s, background .25s; }
.medidor-texto { font-size: .8rem; color: var(--suave); margin-top: .25rem; }

.estado {
  display: inline-flex; align-items: center; gap: .35em; padding: .15em .6em; border-radius: 999px;
  font-size: .8rem; font-weight: 600; background: #eef1f4; color: #55616d; white-space: nowrap;
}
.estado::before { content: ""; width: .5em; height: .5em; border-radius: 50%; background: currentColor; }
.estado.ativo { background: #e6f5ee; color: #1f7a4f; }
.estado.alerta { background: #fff4df; color: #8a5a00; }
.estado.inativo { background: #f6e9e9; color: #8f2424; }

.qr-bloco { display: flex; gap: 1.2rem; flex-wrap: wrap; align-items: flex-start; margin: .6rem 0 1rem; }
.qr-bloco img { width: 180px; height: 180px; image-rendering: pixelated; border: 1px solid var(--borda); border-radius: 8px; padding: 6px; background: #fff; }
.qr-bloco ol { margin: 0; padding-left: 1.2rem; line-height: 1.6; flex: 1 1 18rem; }
.segredo { font-family: ui-monospace, monospace; font-size: .95rem; letter-spacing: .05em; user-select: all; word-break: break-all; }

.codigos {
  display: grid; grid-template-columns: repeat(2, max-content); gap: .3rem 2rem; margin: .8rem 0; padding: .9rem 1.2rem;
  font-family: ui-monospace, monospace; font-size: 1.05rem; background: #f6f8fa; border: 1px dashed var(--borda); border-radius: var(--raio);
}

.tabela { width: 100%; border-collapse: collapse; font-size: .88rem; }
.tabela th { text-align: left; font-weight: 600; color: var(--suave); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }
.tabela th, .tabela td { padding: .5rem .5rem; border-bottom: 1px solid #eceff2; vertical-align: middle; }
.tabela tr.inativa td { opacity: .55; }
.tabela .sub-linha { display: block; color: var(--suave); font-size: .8rem; }
.tabela-rolagem { overflow-x: auto; }

details.acoes-usuario { position: relative; }
details.acoes-usuario > summary {
  list-style: none; cursor: pointer; padding: .3em .7em; border: 1px solid var(--borda); border-radius: var(--raio); font-size: .85rem; background: #fff;
}
details.acoes-usuario > summary::-webkit-details-marker { display: none; }
details.acoes-usuario[open] > summary { border-color: var(--cinza); }
details.acoes-usuario .menu-acoes {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 5; min-width: 15rem; padding: .3rem;
  background: #fff; border: 1px solid var(--borda); border-radius: var(--raio); box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
  display: grid;
}
.menu-acoes button { border: 0; text-align: left; padding: .5em .7em; border-radius: 4px; }
.menu-acoes button:hover { background: #f0f3f6; }
.menu-acoes button.perigo:hover { background: #fbeeee; }
.menu-acoes hr { border: 0; border-top: 1px solid #eceff2; margin: .25rem 0; }

dialog.dlg { border: 0; border-radius: 12px; padding: 1.4rem; width: min(30rem, calc(100% - 2rem)); box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }
dialog.dlg::backdrop { background: rgba(20, 30, 40, .45); }
dialog.dlg h3 { margin: 0 0 .6rem; }
dialog.dlg .acoes { justify-content: flex-end; margin-top: 1rem; }
.senha-mostrada {
  display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin: .8rem 0; padding: .8rem 1rem;
  background: #f6f8fa; border: 1px dashed var(--borda); border-radius: var(--raio);
  font-family: ui-monospace, monospace; font-size: 1.25rem; letter-spacing: .06em; user-select: all;
}
.espaco-acima { margin-top: .8rem; }
.pagina-estreita.larga { max-width: 1150px; }
.formulario + .dica { margin: .8rem 0 0; }
.estado:empty { display: none; }
