/* =========================================================
   Ponto Eletrolara — visual moderno (celular primeiro)
   ========================================================= */
:root {
  --marca: #e11d2a;
  --marca-esc: #b3141f;
  --fundo1: #0f1220;
  --fundo2: #1a1f35;
  --vidro: rgba(255,255,255,.07);
  --vidro-borda: rgba(255,255,255,.12);
  --texto: #f5f7fb;
  --suave: rgba(245,247,251,.64);
  --ok: #22c55e;
  --aviso: #f59e0b;
  --azul: #3b82f6;
  --raio: 20px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { min-height: 100%; }
body.pt {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--texto);
  background:
    radial-gradient(900px 500px at 110% -10%, rgba(225,29,42,.28), transparent 60%),
    radial-gradient(700px 500px at -20% 110%, rgba(59,130,246,.18), transparent 60%),
    linear-gradient(170deg, var(--fundo2), var(--fundo1));
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
.pt-app {
  max-width: 460px; margin: 0 auto; min-height: 100vh;
  padding: calc(18px + env(safe-area-inset-top)) 18px calc(26px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 16px;
}

/* topo */
.pt-topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pt-marca { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .01em; }
.pt-marca .q {
  width: 36px; height: 36px; border-radius: 10px; background: var(--marca);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
  box-shadow: 0 8px 20px rgba(225,29,42,.35);
}
.pt-marca small { display: block; font-weight: 500; font-size: 11.5px; color: var(--suave); }
.pt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--texto);
  padding: 7px 12px; border-radius: 999px;
  background: var(--vidro); border: 1px solid var(--vidro-borda);
  text-decoration: none; cursor: pointer;
}
.pt-chip svg { width: 15px; height: 15px; }

/* relógio */
.pt-relogio { text-align: center; padding: 10px 0 4px; }
.pt-relogio .hora { font-size: 64px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.pt-relogio .hora span { color: var(--suave); font-weight: 600; font-size: 28px; margin-left: 4px; }
.pt-relogio .data { margin-top: 8px; color: var(--suave); font-size: 14px; text-transform: capitalize; }

/* cartões */
.pt-card {
  background: var(--vidro); border: 1px solid var(--vidro-borda);
  border-radius: var(--raio); padding: 16px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.pt-titulo { font-size: 22px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.pt-sub { color: var(--suave); font-size: 14px; margin: 4px 0 0; line-height: 1.45; }

/* botão principal */
.pt-principal {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 16px;
  width: 100%; border: 0; border-radius: 24px; padding: 22px 20px;
  background: linear-gradient(135deg, #ef4444, var(--marca-esc));
  color: #fff; text-align: left; cursor: pointer;
  box-shadow: 0 18px 40px rgba(225,29,42,.35);
  transition: transform .12s ease;
}
.pt-principal:active { transform: scale(.98); }
.pt-principal .ic { width: 58px; height: 58px; border-radius: 18px; background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center; flex: none; }
.pt-principal .ic svg { width: 30px; height: 30px; }
.pt-principal b { display: block; font-size: 22px; letter-spacing: -.01em; }
.pt-principal small { font-size: 13px; opacity: .85; }
.pt-principal::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
  transform: translateX(-100%); animation: pt-brilho 3.2s ease-in-out infinite;
}
@keyframes pt-brilho { 60%, 100% { transform: translateX(100%); } }

/* grade de ações */
.pt-grade { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pt-acao {
  display: flex; flex-direction: column; align-items: flex-start; gap: 10px;
  padding: 16px; border-radius: 18px; border: 1px solid var(--vidro-borda);
  background: var(--vidro); color: var(--texto); text-align: left; cursor: pointer;
  font: inherit; transition: background .15s, transform .12s;
}
.pt-acao:active { transform: scale(.98); }
.pt-acao:hover { background: rgba(255,255,255,.1); }
.pt-acao .ic { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; }
.pt-acao .ic svg { width: 20px; height: 20px; }
.pt-acao b { font-size: 14.5px; }
.pt-acao small { color: var(--suave); font-size: 12px; margin-top: -6px; }
.pt-acao.larga { grid-column: 1 / -1; flex-direction: row; align-items: center; }
.pt-acao.larga small { margin-top: 0; }
.c-amarelo { background: rgba(245,158,11,.18); color: #fbbf24; }
.c-azul { background: rgba(59,130,246,.18); color: #93c5fd; }
.c-verde { background: rgba(34,197,94,.18); color: #86efac; }
.c-roxo { background: rgba(168,85,247,.18); color: #d8b4fe; }

/* etapas do dia (marcar) */
.pt-etapas { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pt-etapa {
  position: relative; min-height: 132px;
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  padding: 16px; border-radius: 20px; border: 1px solid var(--vidro-borda);
  background: var(--vidro); color: var(--texto); font: inherit; text-align: left; cursor: pointer;
  transition: transform .12s, box-shadow .15s;
}
.pt-etapa .n { font-size: 12px; font-weight: 700; color: var(--suave); letter-spacing: .06em; }
.pt-etapa .ic { width: 40px; height: 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: rgba(255,255,255,.1); }
.pt-etapa .ic svg { width: 22px; height: 22px; }
.pt-etapa b { font-size: 18px; }
.pt-etapa .hr { font-size: 13px; color: var(--suave); font-variant-numeric: tabular-nums; }
.pt-etapa.feito { opacity: .8; cursor: default; }
.pt-etapa.feito .hr { color: #86efac; font-weight: 700; }
.pt-etapa.feito::after {
  content: "✓"; position: absolute; top: 14px; right: 14px;
  width: 24px; height: 24px; border-radius: 50%; background: var(--ok); color: #06240f;
  display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 13px;
}
.pt-etapa.proxima {
  background: linear-gradient(140deg, #ef4444, var(--marca-esc)); border-color: transparent;
  box-shadow: 0 16px 34px rgba(225,29,42,.35); animation: pt-pulso 2s ease-in-out infinite;
}
.pt-etapa.proxima .n, .pt-etapa.proxima .hr { color: rgba(255,255,255,.85); }
.pt-etapa.proxima .ic { background: rgba(255,255,255,.2); }
.pt-etapa.bloqueada { opacity: .38; cursor: not-allowed; }
.pt-etapa:not(:disabled):active { transform: scale(.98); }
@keyframes pt-pulso { 50% { box-shadow: 0 16px 44px rgba(225,29,42,.55); } }

/* localização */
.pt-local { display: flex; gap: 12px; align-items: flex-start; }
.pt-local .pino {
  width: 40px; height: 40px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: rgba(59,130,246,.18); color: #93c5fd; position: relative;
}
.pt-local .pino svg { width: 20px; height: 20px; }
.pt-local .pino.buscando::after {
  content: ""; position: absolute; inset: -4px; border-radius: 14px; border: 2px solid rgba(147,197,253,.6);
  animation: pt-radar 1.4s ease-out infinite;
}
@keyframes pt-radar { from { transform: scale(.8); opacity: 1; } to { transform: scale(1.35); opacity: 0; } }
.pt-local .rot { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #93c5fd; }
.pt-local .end { font-size: 14px; font-weight: 600; line-height: 1.4; margin-top: 3px; }
.pt-local .coord { font-size: 12px; color: var(--suave); margin-top: 3px; font-variant-numeric: tabular-nums; }
.pt-mapa { margin-top: 12px; border-radius: 14px; overflow: hidden; height: 140px; border: 1px solid var(--vidro-borda); display: none; }
.pt-mapa iframe { width: 100%; height: 100%; border: 0; filter: saturate(.9); }
.pt-aviso-local { font-size: 12px; color: var(--suave); margin-top: 10px; display: flex; gap: 6px; align-items: flex-start; }

/* ---------- câmera ---------- */
.pt-camera {
  position: relative; width: 100%; aspect-ratio: 3 / 4; border-radius: 26px; overflow: hidden;
  background: #000; border: 1px solid var(--vidro-borda);
  box-shadow: 0 24px 60px rgba(0,0,0,.45);
}
.pt-camera video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pt-camera .mascara {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse 36% 31% at 50% 44%, transparent 98%, rgba(10,12,20,.62) 100%);
}
.pt-camera .oval {
  position: absolute; left: 50%; top: 44%; width: 72%; height: 62%;
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 3px dashed rgba(255,255,255,.55); transition: border-color .2s, box-shadow .2s;
}
.pt-camera.rosto-ok .oval { border: 3px solid var(--ok); box-shadow: 0 0 0 6px rgba(34,197,94,.18), 0 0 40px rgba(34,197,94,.35); }
.pt-camera.rosto-ruim .oval { border-color: var(--aviso); }
.pt-camera .linha-scan {
  position: absolute; left: 18%; right: 18%; height: 2px; top: 20%;
  background: linear-gradient(90deg, transparent, #60a5fa, transparent);
  animation: pt-scan 2.2s ease-in-out infinite; opacity: .8;
}
.pt-camera.rosto-ok .linha-scan { display: none; }
@keyframes pt-scan { 50% { top: 68%; } }
.pt-camera .status {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: rgba(10,12,20,.7); border: 1px solid rgba(255,255,255,.14);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.pt-camera .status i { width: 9px; height: 9px; border-radius: 50%; background: var(--aviso); box-shadow: 0 0 0 4px rgba(245,158,11,.25); }
.pt-camera.rosto-ok .status i { background: var(--ok); box-shadow: 0 0 0 4px rgba(34,197,94,.25); }
.pt-camera .rodape-cam {
  position: absolute; left: 12px; right: 12px; bottom: 12px;
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-radius: 14px; font-size: 12px; line-height: 1.35;
  background: rgba(10,12,20,.7); border: 1px solid rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.pt-camera .rodape-cam svg { width: 16px; height: 16px; flex: none; color: #93c5fd; }
.pt-camera .flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.pt-camera .flash.on { animation: pt-flash .45s ease-out; }
@keyframes pt-flash { 0% { opacity: .9; } 100% { opacity: 0; } }
.pt-camera .erro-cam { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; text-align: center; padding: 24px; color: var(--suave); font-size: 14px; }

.pt-disparo {
  width: 100%; border: 0; border-radius: 18px; padding: 18px;
  font-weight: 700; font-size: 17px; line-height: 1; font-family: inherit; color: #fff; cursor: pointer;
  background: linear-gradient(135deg, #22c55e, #15803d);
  box-shadow: 0 16px 34px rgba(34,197,94,.3);
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: opacity .2s, transform .12s;
}
.pt-disparo svg { width: 22px; height: 22px; }
.pt-disparo:disabled { background: rgba(255,255,255,.1); box-shadow: none; color: var(--suave); cursor: not-allowed; }
.pt-disparo:not(:disabled):active { transform: scale(.98); }

/* sucesso */
.pt-sucesso { text-align: center; }
.pt-sucesso .selo {
  width: 74px; height: 74px; margin: 6px auto 12px; border-radius: 50%;
  background: var(--ok); color: #052e14; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 10px rgba(34,197,94,.18), 0 20px 40px rgba(34,197,94,.35);
  animation: pt-pop .5s cubic-bezier(.2,1.4,.4,1);
}
.pt-sucesso .selo svg { width: 38px; height: 38px; }
@keyframes pt-pop { from { transform: scale(.4); opacity: 0; } to { transform: none; opacity: 1; } }
.pt-foto-final { width: 100%; max-width: 280px; border-radius: 20px; margin: 14px auto 0; display: block; box-shadow: 0 20px 50px rgba(0,0,0,.45); }
.pt-contagem { margin-top: 14px; font-size: 12.5px; color: var(--suave); }

/* login (senha) */
.pt-senha {
  width: 100%; text-align: center; letter-spacing: .5em; font-size: 34px; font-weight: 800;
  padding: 16px; border-radius: 18px; border: 1px solid var(--vidro-borda);
  background: rgba(0,0,0,.25); color: #fff; outline: none; -moz-appearance: textfield;
}
.pt-senha::-webkit-outer-spin-button, .pt-senha::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pt-senha:focus { border-color: rgba(255,255,255,.35); }
.pt-senha::placeholder { color: rgba(255,255,255,.25); letter-spacing: .2em; font-weight: 600; font-size: 22px; }
.pt-teclado { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.pt-teclado button {
  height: 64px; border-radius: 18px; border: 1px solid var(--vidro-borda);
  background: var(--vidro); color: #fff; font-weight: 700; font-size: 24px; line-height: 1; font-family: inherit; cursor: pointer;
  transition: background .12s, transform .08s;
}
.pt-teclado button:active { transform: scale(.95); background: rgba(255,255,255,.16); }
.pt-teclado .ok { background: linear-gradient(135deg, #22c55e, #15803d); border-color: transparent; }
.pt-teclado .apagar { font-size: 18px; color: var(--suave); }
.pt-erro {
  background: rgba(225,29,42,.16); border: 1px solid rgba(225,29,42,.4); color: #fecaca;
  padding: 10px 14px; border-radius: 14px; font-size: 13.5px; text-align: center;
}
.pt-erro p { margin: 0; }
.pt-voltar { color: var(--suave); font-size: 13px; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }

/* instalar app */
.pt-instalar {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px;
  background: linear-gradient(135deg, rgba(59,130,246,.22), rgba(168,85,247,.18));
  border: 1px solid rgba(147,197,253,.3); cursor: pointer; color: var(--texto); font: inherit; text-align: left; width: 100%;
}
.pt-instalar img { width: 42px; height: 42px; border-radius: 11px; }
.pt-instalar b { display: block; font-size: 14.5px; }
.pt-instalar small { color: var(--suave); font-size: 12px; }
.pt-instalar .bt { margin-left: auto; background: #fff; color: #111827; font-weight: 800; font-size: 12.5px; padding: 8px 12px; border-radius: 999px; }
.pt-folha-fundo { position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 50; display: none; }
.pt-folha {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 51; max-width: 460px; margin: 0 auto;
  background: #161a2c; border-radius: 24px 24px 0 0; border: 1px solid var(--vidro-borda);
  padding: 18px 20px calc(22px + env(safe-area-inset-bottom)); transform: translateY(110%); transition: transform .3s ease;
}
.pt-folha.on { transform: none; }
.pt-folha h3 { margin: 0 0 6px; font-size: 18px; }
.pt-folha ol { margin: 12px 0 16px; padding-left: 20px; color: var(--suave); font-size: 14px; line-height: 1.8; }
.pt-folha ol b { color: var(--texto); }
.pt-folha button { width: 100%; border: 0; border-radius: 14px; padding: 14px; font-weight: 700; font-size: 15px; line-height: 1; font-family: inherit; background: #fff; color: #111827; cursor: pointer; }

.pt-rodape { text-align: center; color: rgba(245,247,251,.35); font-size: 11.5px; margin-top: auto; padding-top: 8px; }

/* leitor de QR (existente) */
.qr-inline-container { text-align: center; }
#qr-open { background: none; border: 0; cursor: pointer; }
#qr-open i { font-size: 26px !important; color: rgba(245,247,251,.45) !important; margin: 0 6px; }
.qr-modal-content { color: #111827; border-radius: 18px !important; }

@media (min-width: 700px) {
  .pt-app { padding-top: 40px; }
}
.pt-aviso-local svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.pt-voltar svg, .pt-chip svg { width: 15px; height: 15px; flex: none; }
/* botão antigo sem função que ficava sobreposto no topo */
.scanner-container { display: none !important; }

/* ---------- Aviso "Ponto NÃO registrado" ---------- */
.pt-falhou {
  position: fixed; inset: 0; z-index: 100; display: none;
  flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 28px 24px calc(28px + env(safe-area-inset-bottom));
  background: radial-gradient(600px 400px at 50% 30%, rgba(220,38,38,.35), transparent 70%), rgba(10,12,20,.96);
}
.pt-falhou.on { display: flex; animation: pt-pop .35s ease-out; }
.pt-falhou .xis {
  width: 150px; height: 150px; border-radius: 50%; background: #dc2626; color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 14px rgba(220,38,38,.2), 0 0 0 30px rgba(220,38,38,.08), 0 24px 60px rgba(220,38,38,.45);
  animation: pt-tremer .5s ease-in-out .35s 2;
}
.pt-falhou .xis svg { width: 84px; height: 84px; }
.pt-falhou h2 { margin: 30px 0 8px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; color: #fff; }
.pt-falhou p { margin: 0; color: rgba(255,255,255,.75); font-size: 15px; max-width: 360px; line-height: 1.45; }
.pt-falhou ul { list-style: none; padding: 0; margin: 16px 0 24px; max-width: 360px; width: 100%; }
.pt-falhou li {
  background: rgba(220,38,38,.15); border: 1px solid rgba(248,113,113,.35); color: #fecaca;
  border-radius: 12px; padding: 10px 14px; margin-bottom: 8px; font-size: 14px; font-weight: 600; text-align: left;
}
.pt-falhou li::before { content: "✕  "; font-weight: 900; }
.pt-falhou .tentar {
  width: 100%; max-width: 360px; border: 0; border-radius: 16px; padding: 17px;
  background: #fff; color: #111827; font-weight: 800; font-size: 17px; line-height: 1; font-family: inherit; cursor: pointer;
}
.pt-falhou .sair { margin-top: 16px; color: rgba(255,255,255,.7); font-size: 14px; }
.pt-falhou small { margin-top: 12px; color: rgba(255,255,255,.45); font-size: 12px; }
@keyframes pt-tremer { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

