* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  background: #2A2F6B;
  overflow-x: hidden;
}

.tela { display: none; min-height: 100vh; }
.tela.ativa { display: flex; }

/* ============ TELA 0: PADRÃO ============ */
.tela0 {
  background: #2A2F6B;
  padding: 40px 24px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.logo-area {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}
.logo-texto {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
}
.logo-shield {
  width: 52px;
  height: 52px;
  background: linear-gradient(135deg, #4CAF50, #2E7D32);
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border: 3px solid #A8D5A8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 22px;
}
.logo-texto .auth { color: #fff; }
.logo-texto .now { color: #4CAF50; }

.padrao-titulo {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}
.padrao-titulo.erro { color: #FF6B6B; animation: shake 0.4s; }
.padrao-titulo.sucesso { color: #4CAF50; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

.padrao-container {
  background: #202654;
  border-radius: 24px;
  padding: 60px 50px;
  position: relative;
  touch-action: none;
}
.padrao-grid {
  display: grid;
  grid-template-columns: repeat(3, 40px);
  grid-template-rows: repeat(3, 40px);
  gap: 40px;
  position: relative;
  z-index: 2;
}
.ponto {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  box-shadow: 0 0 0 6px rgba(255,255,255,0.05);
}
.ponto.dica {
  box-shadow:
    0 0 0 6px rgba(76, 175, 80, 0.25),
    0 0 0 10px rgba(76, 175, 80, 0.1);
  animation: pulsar 1.6s infinite;
}
@keyframes pulsar {
  0%, 100% {
    box-shadow:
      0 0 0 6px rgba(76, 175, 80, 0.25),
      0 0 0 10px rgba(76, 175, 80, 0.1);
  }
  50% {
    box-shadow:
      0 0 0 8px rgba(76, 175, 80, 0.45),
      0 0 0 14px rgba(76, 175, 80, 0.15);
  }
}
.ponto.ativo {
  background: #4CAF50;
  box-shadow:
    0 0 0 8px rgba(76, 175, 80, 0.4),
    0 0 24px rgba(76, 175, 80, 0.9);
  transform: scale(1.15);
  animation: none;
}
.padrao-svg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}
.padrao-svg line {
  stroke: #4CAF50;
  stroke-width: 6;
  stroke-linecap: round;
  filter: drop-shadow(0 0 6px rgba(76, 175, 80, 0.8));
}

/* ============ TELA 1: INSTRUÇÕES ============ */
.tela1 {
  background: #2A2F6B;
  padding: 60px 24px 40px;
  flex-direction: column;
  align-items: center;
}
.card {
  background: #fff;
  border-radius: 20px;
  padding: 32px 26px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 15px 50px rgba(0,0,0,0.35);
  margin-top: 20px;
}
.passo { display: flex; gap: 14px; margin-bottom: 26px; }
.numero {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: #5B4FCF;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 15px;
}
.passo-texto { flex: 1; }
.passo-texto h2 {
  font-size: 16px;
  color: #1A1A1A;
  margin-bottom: 4px;
  font-weight: 800;
}
.passo-texto p {
  font-size: 13px;
  color: #6B6B6B;
  line-height: 1.5;
}
.qr-icon {
  width: 60px;
  height: 60px;
  margin-top: 12px;
  background:
    linear-gradient(#333 0 0) 0 0/15px 15px no-repeat,
    linear-gradient(#333 0 0) 100% 0/15px 15px no-repeat,
    linear-gradient(#333 0 0) 0 100%/15px 15px no-repeat,
    #fff;
  border: 2px solid #333;
  opacity: 0.25;
}
.btn-autenticar {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: 40px;
  background: linear-gradient(90deg, #5B5FE0 0%, #8B5FBF 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
  box-shadow: 0 8px 20px rgba(91,95,224,0.45);
  font-family: inherit;
}

/* ============ TELA 2: SCANNER ============ */
.tela2 {
  background: #3A3F9B;
  padding: 60px 24px 40px;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}
.scanner-wrap {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}
.camera-box {
  position: relative;
  width: 100%;
  max-width: 340px;
  aspect-ratio: 1 / 1;
  background: #7A7A7A;
  border-radius: 14px;
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.camera-box::before {
  content: '';
  position: absolute;
  inset: 10px;
  border: 3px solid #4CAF50;
  border-radius: 10px;
  pointer-events: none;
  z-index: 2;
}
#reader {
  width: 100%;
  height: 100%;
  border-radius: 10px;
  overflow: hidden;
  background: #D9D9D9;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
#reader video {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  border-radius: 10px;
}
.camera-msg {
  position: absolute;
  z-index: 3;
  text-align: center;
  color: #4A4A4A;
  font-size: 12px;
  line-height: 1.5;
  padding: 0 20px;
  pointer-events: none;
}
.flash-btn {
  position: absolute;
  bottom: -22px;
  right: -10px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #3A3A3A;
  color: #fff;
  border: none;
  font-size: 20px;
  cursor: pointer;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
}
.progress-bar {
  width: 100%;
  max-width: 340px;
  height: 14px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  margin-top: 26px;
}
.progress-fill {
  height: 100%;
  background: #22A045;
  border-radius: 10px;
  width: 45%;
  transition: width 0.4s;
}
.info-central {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 100px;
}
.info-icon {
  width: 34px;
  height: 34px;
  background: #fff;
  color: #3A3F9B;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-style: italic;
}
.info-central h3 { color: #fff; font-size: 19px; font-weight: 800; }
.btn-simular {
  background: transparent;
  border: 2px dashed rgba(255,255,255,0.4);
  color: rgba(255,255,255,0.7);
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 10px;
}
.btn-parar {
  width: 100%;
  max-width: 340px;
  padding: 18px;
  border: 3px solid #fff;
  border-radius: 40px;
  background: #22A045;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 40px;
  font-family: inherit;
}

/* ============ TELA 3: PRODUTO REAL ============ */
.tela3 { background: #F5F5F5; justify-content: center; }
.tela3-inner {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  padding-bottom: 40px;
}
.header {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.menu-btn-claro {
  background: #F0F0F0;
  border: none;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  font-size: 18px;
  cursor: pointer;
}
.logo-mini {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #B8961E, #8B6F14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 9px;
  padding: 4px;
}
.pais-btn {
  background: #fff;
  border: 1px solid #CCC;
  border-radius: 20px;
  padding: 8px 14px;
  font-weight: 600;
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
}
.titulo-produto {
  text-align: center;
  padding: 14px;
  font-weight: 700;
  font-size: 15px;
  color: #333;
}
.banner-real {
  background: #fff;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid #EEE;
  border-bottom: 1px solid #EEE;
}
.check {
  background: #1A4D8F;
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}
.banner-real strong { color: #1A8F3A; font-size: 16px; }
.banner-real p { font-size: 13px; color: #333; font-weight: 600; margin-top: 2px; }
.seta { margin-left: auto; font-size: 26px; color: #333; }
.produto-img {
  background: #fff;
  padding: 40px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
}
.produto-placeholder {
  width: 200px;
  height: 200px;
  background: linear-gradient(160deg, #fff 0%, #f0e6c8 40%, #B8961E 100%);
  border-radius: 6px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 20px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
  text-align: center;
  padding: 10px;
}
.texto-explicativo {
  padding: 24px 20px 12px;
  font-size: 13px;
  color: #333;
  line-height: 1.6;
}
.dosagem { padding: 0 20px 8px; font-size: 13px; color: #333; font-weight: 600; }
.icones-footer {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 20px;
}
.icone-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #B8961E;
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

/* ============ TELA 4: PRODUTO FALSO ============ */
.tela4 {
  background: #F5F0F8;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
  text-align: center;
}
.tela4-inner {
  max-width: 420px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.logo-indufar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, #B8961E, #8B6F14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  margin-bottom: 20px;
}
.falso-titulo {
  color: #333;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 1px;
}
.falso-codigo {
  color: #333;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}
.falso-texto {
  color: #555;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 10px;
}

.btn-voltar {
  position: fixed;
  bottom: 20px;
  left: 20px;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 20px;
  font-size: 12px;
  cursor: pointer;
  z-index: 100;
  font-family: inherit;
}